Sha256: f0ed0cbc44157bae1918a806dd9a1b278af4635d68d68869177ec1c41c78b8d8

Contents?: true

Size: 699 Bytes

Versions: 2

Compression:

Stored size: 699 Bytes

Contents

/**
 * @fileoverview Rule to flag when initializing to undefined
 * @author Ilya Volodin
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

module.exports = function(context) {

    return {

        "VariableDeclarator": function(node) {
            var name = node.id.name;
            var init = node.init && node.init.name;

            if (init === "undefined") {
                context.report(node, "It's not necessary to initialize '{{name}}' to undefined.", { name: name });
            }
        }
    };

};

module.exports.schema = [];

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
eslint_node_modules-1.6.0.1 vendor/node_modules/eslint/lib/rules/no-undef-init.js
eslint_node_modules-1.6.0 vendor/node_modules/eslint/lib/rules/no-undef-init.js