lancew/DojoList

View on GitHub
js/prototype/prototype-1.6.0.3.js

Summary

Maintainability
F
1 mo
Test Coverage

eval can be harmful.
Open

    return this.extractScripts().map(function(script) { return eval(script) });
Severity: Minor
Found in js/prototype/prototype-1.6.0.3.js by eslint

Disallow eval() (no-eval)

JavaScript's eval() function is potentially dangerous and is often misused. Using eval() on untrusted code can open a program up to several different injection attacks. The use of eval() in most contexts can be substituted for a better, alternative approach to a problem.

var obj = { x: "foo" },
    key = "x",
    value = eval("obj." + key);

Rule Details

This rule is aimed at preventing potentially dangerous, unnecessary, and slow code by disallowing the use of the eval() function. As such, it will warn whenever the eval() function is used.

Examples of incorrect code for this rule:

/*eslint no-eval: "error"*/

var obj = { x: "foo" },
    key = "x",
    value = eval("obj." + key);

(0, eval)("var a = 0");

var foo = eval;
foo("var a = 0");

// This `this` is the global object.
this.eval("var a = 0");

Example of additional incorrect code for this rule when browser environment is set to true:

/*eslint no-eval: "error"*/
/*eslint-env browser*/

window.eval("var a = 0");

Example of additional incorrect code for this rule when node environment is set to true:

/*eslint no-eval: "error"*/
/*eslint-env node*/

global.eval("var a = 0");

Examples of correct code for this rule:

/*eslint no-eval: "error"*/
/*eslint-env es6*/

var obj = { x: "foo" },
    key = "x",
    value = obj[key];

class A {
    foo() {
        // This is a user-defined method.
        this.eval("var a = 0");
    }

    eval() {
    }
}

Options

This rule has an option to allow indirect calls to eval. Indirect calls to eval are less dangerous than direct calls to eval because they cannot dynamically change the scope. Because of this, they also will not negatively impact performance to the degree of direct eval.

{
    "no-eval": ["error", {"allowIndirect": true}] // default is false
}

Example of incorrect code for this rule with the {"allowIndirect": true} option:

/*eslint no-eval: "error"*/

var obj = { x: "foo" },
    key = "x",
    value = eval("obj." + key);

Examples of correct code for this rule with the {"allowIndirect": true} option:

/*eslint no-eval: "error"*/

(0, eval)("var a = 0");

var foo = eval;
foo("var a = 0");

this.eval("var a = 0");
/*eslint no-eval: "error"*/
/*eslint-env browser*/

window.eval("var a = 0");
/*eslint no-eval: "error"*/
/*eslint-env node*/

global.eval("var a = 0");

Known Limitations

  • This rule is warning every eval() even if the eval is not global's. This behavior is in order to detect calls of direct eval. Such as:
module.exports = function(eval) {
      // If the value of this `eval` is built-in `eval` function, this is a
      // call of direct `eval`.
      eval("var a = 0");
  };
  • This rule cannot catch renaming the global object. Such as:
var foo = window;
  foo.eval("var a = 0");

Further Reading

Related Rules

eval can be harmful.
Open

      return eval((this.transport.responseText || '').unfilterJSON());
Severity: Minor
Found in js/prototype/prototype-1.6.0.3.js by eslint

Disallow eval() (no-eval)

JavaScript's eval() function is potentially dangerous and is often misused. Using eval() on untrusted code can open a program up to several different injection attacks. The use of eval() in most contexts can be substituted for a better, alternative approach to a problem.

var obj = { x: "foo" },
    key = "x",
    value = eval("obj." + key);

Rule Details

This rule is aimed at preventing potentially dangerous, unnecessary, and slow code by disallowing the use of the eval() function. As such, it will warn whenever the eval() function is used.

Examples of incorrect code for this rule:

/*eslint no-eval: "error"*/

var obj = { x: "foo" },
    key = "x",
    value = eval("obj." + key);

(0, eval)("var a = 0");

var foo = eval;
foo("var a = 0");

// This `this` is the global object.
this.eval("var a = 0");

Example of additional incorrect code for this rule when browser environment is set to true:

/*eslint no-eval: "error"*/
/*eslint-env browser*/

window.eval("var a = 0");

Example of additional incorrect code for this rule when node environment is set to true:

/*eslint no-eval: "error"*/
/*eslint-env node*/

global.eval("var a = 0");

Examples of correct code for this rule:

/*eslint no-eval: "error"*/
/*eslint-env es6*/

var obj = { x: "foo" },
    key = "x",
    value = obj[key];

class A {
    foo() {
        // This is a user-defined method.
        this.eval("var a = 0");
    }

    eval() {
    }
}

Options

This rule has an option to allow indirect calls to eval. Indirect calls to eval are less dangerous than direct calls to eval because they cannot dynamically change the scope. Because of this, they also will not negatively impact performance to the degree of direct eval.

{
    "no-eval": ["error", {"allowIndirect": true}] // default is false
}

Example of incorrect code for this rule with the {"allowIndirect": true} option:

/*eslint no-eval: "error"*/

var obj = { x: "foo" },
    key = "x",
    value = eval("obj." + key);

Examples of correct code for this rule with the {"allowIndirect": true} option:

/*eslint no-eval: "error"*/

(0, eval)("var a = 0");

var foo = eval;
foo("var a = 0");

this.eval("var a = 0");
/*eslint no-eval: "error"*/
/*eslint-env browser*/

window.eval("var a = 0");
/*eslint no-eval: "error"*/
/*eslint-env node*/

global.eval("var a = 0");

Known Limitations

  • This rule is warning every eval() even if the eval is not global's. This behavior is in order to detect calls of direct eval. Such as:
module.exports = function(eval) {
      // If the value of this `eval` is built-in `eval` function, this is a
      // call of direct `eval`.
      eval("var a = 0");
  };
  • This rule cannot catch renaming the global object. Such as:
var foo = window;
  foo.eval("var a = 0");

Further Reading

Related Rules

eval can be harmful.
Open

      if (!sanitize || json.isJSON()) return eval('(' + json + ')');
Severity: Minor
Found in js/prototype/prototype-1.6.0.3.js by eslint

Disallow eval() (no-eval)

JavaScript's eval() function is potentially dangerous and is often misused. Using eval() on untrusted code can open a program up to several different injection attacks. The use of eval() in most contexts can be substituted for a better, alternative approach to a problem.

var obj = { x: "foo" },
    key = "x",
    value = eval("obj." + key);

Rule Details

This rule is aimed at preventing potentially dangerous, unnecessary, and slow code by disallowing the use of the eval() function. As such, it will warn whenever the eval() function is used.

Examples of incorrect code for this rule:

/*eslint no-eval: "error"*/

var obj = { x: "foo" },
    key = "x",
    value = eval("obj." + key);

(0, eval)("var a = 0");

var foo = eval;
foo("var a = 0");

// This `this` is the global object.
this.eval("var a = 0");

Example of additional incorrect code for this rule when browser environment is set to true:

/*eslint no-eval: "error"*/
/*eslint-env browser*/

window.eval("var a = 0");

Example of additional incorrect code for this rule when node environment is set to true:

/*eslint no-eval: "error"*/
/*eslint-env node*/

global.eval("var a = 0");

Examples of correct code for this rule:

/*eslint no-eval: "error"*/
/*eslint-env es6*/

var obj = { x: "foo" },
    key = "x",
    value = obj[key];

class A {
    foo() {
        // This is a user-defined method.
        this.eval("var a = 0");
    }

    eval() {
    }
}

Options

This rule has an option to allow indirect calls to eval. Indirect calls to eval are less dangerous than direct calls to eval because they cannot dynamically change the scope. Because of this, they also will not negatively impact performance to the degree of direct eval.

{
    "no-eval": ["error", {"allowIndirect": true}] // default is false
}

Example of incorrect code for this rule with the {"allowIndirect": true} option:

/*eslint no-eval: "error"*/

var obj = { x: "foo" },
    key = "x",
    value = eval("obj." + key);

Examples of correct code for this rule with the {"allowIndirect": true} option:

/*eslint no-eval: "error"*/

(0, eval)("var a = 0");

var foo = eval;
foo("var a = 0");

this.eval("var a = 0");
/*eslint no-eval: "error"*/
/*eslint-env browser*/

window.eval("var a = 0");
/*eslint no-eval: "error"*/
/*eslint-env node*/

global.eval("var a = 0");

Known Limitations

  • This rule is warning every eval() even if the eval is not global's. This behavior is in order to detect calls of direct eval. Such as:
module.exports = function(eval) {
      // If the value of this `eval` is built-in `eval` function, this is a
      // call of direct `eval`.
      eval("var a = 0");
  };
  • This rule cannot catch renaming the global object. Such as:
var foo = window;
  foo.eval("var a = 0");

Further Reading

Related Rules

eval can be harmful.
Open

    eval(this.matcher.join('\n'));
Severity: Minor
Found in js/prototype/prototype-1.6.0.3.js by eslint

Disallow eval() (no-eval)

JavaScript's eval() function is potentially dangerous and is often misused. Using eval() on untrusted code can open a program up to several different injection attacks. The use of eval() in most contexts can be substituted for a better, alternative approach to a problem.

var obj = { x: "foo" },
    key = "x",
    value = eval("obj." + key);

Rule Details

This rule is aimed at preventing potentially dangerous, unnecessary, and slow code by disallowing the use of the eval() function. As such, it will warn whenever the eval() function is used.

Examples of incorrect code for this rule:

/*eslint no-eval: "error"*/

var obj = { x: "foo" },
    key = "x",
    value = eval("obj." + key);

(0, eval)("var a = 0");

var foo = eval;
foo("var a = 0");

// This `this` is the global object.
this.eval("var a = 0");

Example of additional incorrect code for this rule when browser environment is set to true:

/*eslint no-eval: "error"*/
/*eslint-env browser*/

window.eval("var a = 0");

Example of additional incorrect code for this rule when node environment is set to true:

/*eslint no-eval: "error"*/
/*eslint-env node*/

global.eval("var a = 0");

Examples of correct code for this rule:

/*eslint no-eval: "error"*/
/*eslint-env es6*/

var obj = { x: "foo" },
    key = "x",
    value = obj[key];

class A {
    foo() {
        // This is a user-defined method.
        this.eval("var a = 0");
    }

    eval() {
    }
}

Options

This rule has an option to allow indirect calls to eval. Indirect calls to eval are less dangerous than direct calls to eval because they cannot dynamically change the scope. Because of this, they also will not negatively impact performance to the degree of direct eval.

{
    "no-eval": ["error", {"allowIndirect": true}] // default is false
}

Example of incorrect code for this rule with the {"allowIndirect": true} option:

/*eslint no-eval: "error"*/

var obj = { x: "foo" },
    key = "x",
    value = eval("obj." + key);

Examples of correct code for this rule with the {"allowIndirect": true} option:

/*eslint no-eval: "error"*/

(0, eval)("var a = 0");

var foo = eval;
foo("var a = 0");

this.eval("var a = 0");
/*eslint no-eval: "error"*/
/*eslint-env browser*/

window.eval("var a = 0");
/*eslint no-eval: "error"*/
/*eslint-env node*/

global.eval("var a = 0");

Known Limitations

  • This rule is warning every eval() even if the eval is not global's. This behavior is in order to detect calls of direct eval. Such as:
module.exports = function(eval) {
      // If the value of this `eval` is built-in `eval` function, this is a
      // call of direct `eval`.
      eval("var a = 0");
  };
  • This rule cannot catch renaming the global object. Such as:
var foo = window;
  foo.eval("var a = 0");

Further Reading

Related Rules

File prototype-1.6.0.3.js has 3532 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*  Prototype JavaScript framework, version 1.6.0.3
 *  (c) 2005-2008 Sam Stephenson
 *
 *  Prototype is freely distributable under the terms of an MIT-style license.
 *  For details, see the Prototype web site: http://www.prototypejs.org/
Severity: Major
Found in js/prototype/prototype-1.6.0.3.js - About 1 wk to fix

    Methods has 56 functions (exceeds 20 allowed). Consider refactoring.
    Open

    Element.Methods = {
      visible: function(element) {
        return $(element).style.display != 'none';
      },
    
    
    Severity: Major
    Found in js/prototype/prototype-1.6.0.3.js - About 1 day to fix

      Function id has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
      Open

          id: function(nodes, root, id, combinator) {
            var targetNode = $(id), h = Selector.handlers;
            if (!targetNode) return [];
            if (!nodes && root == document) return [targetNode];
            if (nodes) {
      Severity: Minor
      Found in js/prototype/prototype-1.6.0.3.js - About 6 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function addMethods has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

      Element.addMethods = function(methods) {
        var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;
      
        if (!methods) {
          Object.extend(Form, Form.Methods);
      Severity: Minor
      Found in js/prototype/prototype-1.6.0.3.js - About 4 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function nth has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

          nth: function(nodes, formula, root, reverse, ofType) {
            if (nodes.length == 0) return [];
            if (formula == 'even') formula = '2n+0';
            if (formula == 'odd')  formula = '2n+1';
            var h = Selector.handlers, results = [], indexed = [], m;
      Severity: Minor
      Found in js/prototype/prototype-1.6.0.3.js - About 4 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      `` has 30 functions (exceeds 20 allowed). Consider refactoring.
      Open

      Object.extend(String.prototype, {
        gsub: function(pattern, replacement) {
          var result = '', source = this, match;
          replacement = arguments.callee.prepareReplacement(replacement);
      
      
      Severity: Minor
      Found in js/prototype/prototype-1.6.0.3.js - About 3 hrs to fix

        Function serializeElements has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

          serializeElements: function(elements, options) {
            if (typeof options != 'object') options = { hash: !!options };
            else if (Object.isUndefined(options.hash)) options.hash = true;
            var key, value, submitted = false, submit = options.submit;
        
        
        Severity: Minor
        Found in js/prototype/prototype-1.6.0.3.js - About 3 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function getStyle has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

          Element.Methods.getStyle = function(element, style) {
            element = $(element);
            style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
            var value = element.style[style];
            if (!value && element.currentStyle) value = element.currentStyle[style];
        Severity: Minor
        Found in js/prototype/prototype-1.6.0.3.js - About 3 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function Hash has 74 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var Hash = Class.create(Enumerable, (function() {
        
          function toQueryPair(key, value) {
            if (Object.isUndefined(value)) return key;
            return key + '=' + encodeURIComponent(String.interpret(value));
        Severity: Major
        Found in js/prototype/prototype-1.6.0.3.js - About 2 hrs to fix

          Method 'id' has a complexity of 17.
          Open

              id: function(nodes, root, id, combinator) {
          Severity: Minor
          Found in js/prototype/prototype-1.6.0.3.js by eslint

          Limit Cyclomatic Complexity (complexity)

          Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

          function a(x) {
              if (true) {
                  return x; // 1st path
              } else if (false) {
                  return x+1; // 2nd path
              } else {
                  return 4; // 3rd path
              }
          }

          Rule Details

          This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

          Examples of incorrect code for a maximum of 2:

          /*eslint complexity: ["error", 2]*/
          
          function a(x) {
              if (true) {
                  return x;
              } else if (false) {
                  return x+1;
              } else {
                  return 4; // 3rd path
              }
          }

          Examples of correct code for a maximum of 2:

          /*eslint complexity: ["error", 2]*/
          
          function a(x) {
              if (true) {
                  return x;
              } else {
                  return 4;
              }
          }

          Options

          Optionally, you may specify a max object property:

          "complexity": ["error", 2]

          is equivalent to

          "complexity": ["error", { "max": 2 }]

          Deprecated: the object property maximum is deprecated. Please use the property max instead.

          When Not To Use It

          If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

          Further Reading

          Related Rules

          • [max-depth](max-depth.md)
          • [max-len](max-len.md)
          • [max-nested-callbacks](max-nested-callbacks.md)
          • [max-params](max-params.md)
          • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

          Function addMethods has 73 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Element.addMethods = function(methods) {
            var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;
          
            if (!methods) {
              Object.extend(Form, Form.Methods);
          Severity: Major
          Found in js/prototype/prototype-1.6.0.3.js - About 2 hrs to fix

            Method 'nth' has a complexity of 16.
            Open

                nth: function(nodes, formula, root, reverse, ofType) {
            Severity: Minor
            Found in js/prototype/prototype-1.6.0.3.js by eslint

            Limit Cyclomatic Complexity (complexity)

            Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

            function a(x) {
                if (true) {
                    return x; // 1st path
                } else if (false) {
                    return x+1; // 2nd path
                } else {
                    return 4; // 3rd path
                }
            }

            Rule Details

            This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

            Examples of incorrect code for a maximum of 2:

            /*eslint complexity: ["error", 2]*/
            
            function a(x) {
                if (true) {
                    return x;
                } else if (false) {
                    return x+1;
                } else {
                    return 4; // 3rd path
                }
            }

            Examples of correct code for a maximum of 2:

            /*eslint complexity: ["error", 2]*/
            
            function a(x) {
                if (true) {
                    return x;
                } else {
                    return 4;
                }
            }

            Options

            Optionally, you may specify a max object property:

            "complexity": ["error", 2]

            is equivalent to

            "complexity": ["error", { "max": 2 }]

            Deprecated: the object property maximum is deprecated. Please use the property max instead.

            When Not To Use It

            If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

            Further Reading

            Related Rules

            • [max-depth](max-depth.md)
            • [max-len](max-len.md)
            • [max-nested-callbacks](max-nested-callbacks.md)
            • [max-params](max-params.md)
            • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

            Function Methods has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Event.Methods = (function() {
              var isButton;
            
              if (Prototype.Browser.IE) {
                var buttonMap = { 0: 1, 1: 4, 2: 2 };
            Severity: Major
            Found in js/prototype/prototype-1.6.0.3.js - About 2 hrs to fix

              Method 'insert' has a complexity of 13.
              Open

                insert: function(element, insertions) {
              Severity: Minor
              Found in js/prototype/prototype-1.6.0.3.js by eslint

              Limit Cyclomatic Complexity (complexity)

              Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

              function a(x) {
                  if (true) {
                      return x; // 1st path
                  } else if (false) {
                      return x+1; // 2nd path
                  } else {
                      return 4; // 3rd path
                  }
              }

              Rule Details

              This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

              Examples of incorrect code for a maximum of 2:

              /*eslint complexity: ["error", 2]*/
              
              function a(x) {
                  if (true) {
                      return x;
                  } else if (false) {
                      return x+1;
                  } else {
                      return 4; // 3rd path
                  }
              }

              Examples of correct code for a maximum of 2:

              /*eslint complexity: ["error", 2]*/
              
              function a(x) {
                  if (true) {
                      return x;
                  } else {
                      return 4;
                  }
              }

              Options

              Optionally, you may specify a max object property:

              "complexity": ["error", 2]

              is equivalent to

              "complexity": ["error", { "max": 2 }]

              Deprecated: the object property maximum is deprecated. Please use the property max instead.

              When Not To Use It

              If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

              Further Reading

              Related Rules

              • [max-depth](max-depth.md)
              • [max-len](max-len.md)
              • [max-nested-callbacks](max-nested-callbacks.md)
              • [max-params](max-params.md)
              • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

              Function tagName has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

                  tagName: function(nodes, root, tagName, combinator) {
                    var uTagName = tagName.toUpperCase();
                    var results = [], h = Selector.handlers;
                    if (nodes) {
                      if (combinator) {
              Severity: Minor
              Found in js/prototype/prototype-1.6.0.3.js - About 2 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Method 'request' has a complexity of 12.
              Open

                request: function(url) {
              Severity: Minor
              Found in js/prototype/prototype-1.6.0.3.js by eslint

              Limit Cyclomatic Complexity (complexity)

              Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

              function a(x) {
                  if (true) {
                      return x; // 1st path
                  } else if (false) {
                      return x+1; // 2nd path
                  } else {
                      return 4; // 3rd path
                  }
              }

              Rule Details

              This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

              Examples of incorrect code for a maximum of 2:

              /*eslint complexity: ["error", 2]*/
              
              function a(x) {
                  if (true) {
                      return x;
                  } else if (false) {
                      return x+1;
                  } else {
                      return 4; // 3rd path
                  }
              }

              Examples of correct code for a maximum of 2:

              /*eslint complexity: ["error", 2]*/
              
              function a(x) {
                  if (true) {
                      return x;
                  } else {
                      return 4;
                  }
              }

              Options

              Optionally, you may specify a max object property:

              "complexity": ["error", 2]

              is equivalent to

              "complexity": ["error", { "max": 2 }]

              Deprecated: the object property maximum is deprecated. Please use the property max instead.

              When Not To Use It

              If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

              Further Reading

              Related Rules

              • [max-depth](max-depth.md)
              • [max-len](max-len.md)
              • [max-nested-callbacks](max-nested-callbacks.md)
              • [max-params](max-params.md)
              • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

              Enumerable has 22 functions (exceeds 20 allowed). Consider refactoring.
              Open

              var Enumerable = {
                each: function(iterator, context) {
                  var index = 0;
                  try {
                    this._each(function(value) {
              Severity: Minor
              Found in js/prototype/prototype-1.6.0.3.js - About 2 hrs to fix

                Method 'respondToReadyState' has a complexity of 11.
                Open

                  respondToReadyState: function(readyState) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Function has a complexity of 11.
                Open

                  Element.Methods.getStyle = function(element, style) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Function has a complexity of 11.
                Open

                    function(proceed, element, style) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Function has a complexity of 11.
                Open

                Element.addMethods = function(methods) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Method 'toJSON' has a complexity of 10.
                Open

                  toJSON: function(object) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Method 'viewportOffset' has a complexity of 10.
                Open

                  viewportOffset: function(forElement) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Function has a complexity of 10.
                Open

                    return this.template.gsub(this.pattern, function(match) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Function Hash has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                var Hash = Class.create(Enumerable, (function() {
                
                  function toQueryPair(key, value) {
                    if (Object.isUndefined(value)) return key;
                    return key + '=' + encodeURIComponent(String.interpret(value));
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js - About 2 hrs to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function insert has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                  insert: function(element, insertions) {
                    element = $(element);
                
                    if (Object.isString(insertions) || Object.isNumber(insertions) ||
                        Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js - About 2 hrs to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function index has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                    index: function(parentNode, reverse, ofType) {
                      parentNode._countedByPrototype = Prototype.emptyFunction;
                      if (reverse) {
                        for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) {
                          var node = nodes[i];
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js - About 2 hrs to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Method 'writeAttribute' has a complexity of 9.
                Open

                  writeAttribute: function(element, name, value) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Method 'setRequestHeaders' has a complexity of 9.
                Open

                  setRequestHeaders: function() {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Function setOpacity has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                  Element.Methods.setOpacity = function(element, value) {
                    element = $(element);
                    element.style.opacity = (value == 1 || value === '') ? '' :
                      (value < 0.00001) ? 0 : value;
                
                
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function match has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                  match: function(element) {
                    this.tokens = [];
                
                    var e = this.expression, ps = Selector.patterns, as = Selector.assertions;
                    var le, p, m;
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function Methods has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                Event.Methods = (function() {
                  var isButton;
                
                  if (Prototype.Browser.IE) {
                    var buttonMap = { 0: 1, 1: 4, 2: 2 };
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function getStyle has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                    function(proceed, element, style) {
                      switch (style) {
                        case 'left': case 'top': case 'right': case 'bottom':
                          if (proceed(element, 'position') === 'static') return null;
                        case 'height': case 'width':
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Method 'setStyle' has a complexity of 8.
                Open

                  setStyle: function(element, styles) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Method 'tagName' has a complexity of 8.
                Open

                    tagName: function(nodes, root, tagName, combinator) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Function has a complexity of 8.
                Open

                  var extend = Object.extend(function(element) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Method 'nth' has a complexity of 8.
                Open

                      nth: function(fragment, m) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Method 'getStyle' has a complexity of 8.
                Open

                  getStyle: function(element, style) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Method 'index' has a complexity of 8.
                Open

                    index: function(parentNode, reverse, ofType) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Method 'clonePosition' has a complexity of 8.
                Open

                  clonePosition: function(element, source) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Method 'pointer' has a complexity of 8.
                Open

                    pointer: function(event) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Method 'match' has a complexity of 7.
                Open

                  match: function(element) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Method '_getResponseJSON' has a complexity of 7.
                Open

                  _getResponseJSON: function() {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Function has a complexity of 7.
                Open

                  Element.Methods.setOpacity = function(element, value) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Function has a complexity of 7.
                Open

                  Element.Methods.setOpacity = function(element, value) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Method 'positionedOffset' has a complexity of 7.
                Open

                  positionedOffset: function(element) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Method 'readAttribute' has a complexity of 7.
                Open

                  readAttribute: function(element, name) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Method 'request' has a complexity of 7.
                Open

                  request: function(form, options) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Method 'prepare' has a complexity of 7.
                Open

                  prepare: function() {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Function has a complexity of 7.
                Open

                    var data = elements.inject({ }, function(result, element) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js by eslint

                Limit Cyclomatic Complexity (complexity)

                Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                function a(x) {
                    if (true) {
                        return x; // 1st path
                    } else if (false) {
                        return x+1; // 2nd path
                    } else {
                        return 4; // 3rd path
                    }
                }

                Rule Details

                This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                Examples of incorrect code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else if (false) {
                        return x+1;
                    } else {
                        return 4; // 3rd path
                    }
                }

                Examples of correct code for a maximum of 2:

                /*eslint complexity: ["error", 2]*/
                
                function a(x) {
                    if (true) {
                        return x;
                    } else {
                        return 4;
                    }
                }

                Options

                Optionally, you may specify a max object property:

                "complexity": ["error", 2]

                is equivalent to

                "complexity": ["error", { "max": 2 }]

                Deprecated: the object property maximum is deprecated. Please use the property max instead.

                When Not To Use It

                If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                Further Reading

                Related Rules

                • [max-depth](max-depth.md)
                • [max-len](max-len.md)
                • [max-nested-callbacks](max-nested-callbacks.md)
                • [max-params](max-params.md)
                • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                Function request has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                  request: function(url) {
                    this.url = url;
                    this.method = this.options.method;
                    var params = Object.clone(this.options.parameters);
                
                
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function extend has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                Element.extend = (function() {
                  if (Prototype.BrowserFeatures.SpecificElementExtensions)
                    return Prototype.K;
                
                  var Methods = { }, ByTag = Element.Methods.ByTag;
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function setRequestHeaders has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                  setRequestHeaders: function() {
                    var headers = {
                      'X-Requested-With': 'XMLHttpRequest',
                      'X-Prototype-Version': Prototype.Version,
                      'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function getElementsByClassName has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
                  function iter(name) {
                    return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
                  }
                
                
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function setStyle has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                  setStyle: function(element, styles) {
                    element = $(element);
                    var elementStyle = element.style, match;
                    if (Object.isString(styles)) {
                      element.style.cssText += ';' + styles;
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function select has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                  select: function(element, value) {
                    if (Object.isUndefined(value))
                      return this[element.type == 'select-one' ?
                        'selectOne' : 'selectMany'](element);
                    else {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function compileMatcher has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                  compileMatcher: function() {
                    var e = this.expression, ps = Selector.patterns, h = Selector.handlers,
                        c = Selector.criteria, le, p, m;
                
                    if (Selector._cache[e]) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function concat has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                  Array.prototype.concat = function() {
                    var array = [];
                    for (var i = 0, length = this.length; i < length; i++) array.push(this[i]);
                    for (var i = 0, length = arguments.length; i < length; i++) {
                      if (Object.isArray(arguments[i])) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Consider simplifying this complex logical expression.
                Open

                        if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted &&
                            submit !== false && (!submit || key == submit) && (submitted = true)))) {
                          if (key in result) {
                            // a key is already present; construct an array of values
                            if (!Object.isArray(result[key])) result[key] = [result[key]];
                Severity: Critical
                Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                  Function not has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                        'not': function(m) {
                          var e = m[6], p = Selector.patterns,
                              x = Selector.xpath, le, v;
                  
                          var exclusion = [];
                  Severity: Minor
                  Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function compileXPathMatcher has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                    compileXPathMatcher: function() {
                      var e = this.expression, ps = Selector.patterns,
                          x = Selector.xpath, le, m;
                  
                      if (Selector._cache[e]) {
                  Severity: Minor
                  Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function respondToReadyState has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                    respondToReadyState: function(readyState) {
                      var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this);
                  
                      if (state == 'Complete') {
                        try {
                  Severity: Minor
                  Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function setOpacity has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                    Element.Methods.setOpacity = function(element, value) {
                      function stripAlpha(filter){
                        return filter.replace(/alpha\([^\)]*\)/gi,'');
                      }
                      element = $(element);
                  Severity: Minor
                  Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function viewportOffset has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                    viewportOffset: function(forElement) {
                      var valueT = 0, valueL = 0;
                  
                      var element = forElement;
                      do {
                  Severity: Minor
                  Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function request has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    request: function(url) {
                      this.url = url;
                      this.method = this.options.method;
                      var params = Object.clone(this.options.parameters);
                  
                  
                  Severity: Minor
                  Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                    Function nth has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        nth: function(nodes, formula, root, reverse, ofType) {
                          if (nodes.length == 0) return [];
                          if (formula == 'even') formula = '2n+0';
                          if (formula == 'odd')  formula = '2n+1';
                          var h = Selector.handlers, results = [], indexed = [], m;
                    Severity: Minor
                    Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                      Function extend has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      Event.extend = (function() {
                        var methods = Object.keys(Event.Methods).inject({ }, function(m, name) {
                          m[name] = Event.Methods[name].methodize();
                          return m;
                        });
                      Severity: Minor
                      Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                        Function cumulativeOffset has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                          Element.Methods.cumulativeOffset = function(element) {
                            var valueT = 0, valueL = 0;
                            do {
                              valueT += element.offsetTop  || 0;
                              valueL += element.offsetLeft || 0;
                        Severity: Minor
                        Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function nth has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                              nth: function(fragment, m) {
                                var mm, formula = m[6], predicate;
                                if (formula == 'even') formula = '2n+0';
                                if (formula == 'odd')  formula = '2n+1';
                                if (mm = formula.match(/^(\d+)$/)) // digit only
                        Severity: Minor
                        Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function readAttribute has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                          readAttribute: function(element, name) {
                            element = $(element);
                            if (Prototype.Browser.IE) {
                              var t = Element._attributeTranslations.read;
                              if (t.values[name]) return t.values[name](element, name);
                        Severity: Minor
                        Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function clonePosition has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          clonePosition: function(element, source) {
                            var options = Object.extend({
                              setLeft:    true,
                              setTop:     true,
                              setWidth:   true,
                        Severity: Minor
                        Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                          Function getElementsByClassName has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
                            function iter(name) {
                              return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
                            }
                          
                          
                          Severity: Minor
                          Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                            Function extend has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            Element.extend = (function() {
                              if (Prototype.BrowserFeatures.SpecificElementExtensions)
                                return Prototype.K;
                            
                              var Methods = { }, ByTag = Element.Methods.ByTag;
                            Severity: Minor
                            Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

                              Function positionedOffset has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                positionedOffset: function(element) {
                                  var valueT = 0, valueL = 0;
                                  do {
                                    valueT += element.offsetTop  || 0;
                                    valueL += element.offsetLeft || 0;
                              Severity: Minor
                              Found in js/prototype/prototype-1.6.0.3.js - About 55 mins to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Function setOpacity has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                Element.Methods.setOpacity = function(element, value) {
                                  element = $(element);
                                  element.style.opacity = (value == 1) ? 0.999999 :
                                    (value === '') ? '' : (value < 0.00001) ? 0 : value;
                                  return element;
                              Severity: Minor
                              Found in js/prototype/prototype-1.6.0.3.js - About 55 mins to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Function writeAttribute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                writeAttribute: function(element, name, value) {
                                  element = $(element);
                                  var attributes = { }, t = Element._attributeTranslations.write;
                              
                                  if (typeof name == 'object') attributes = name;
                              Severity: Minor
                              Found in js/prototype/prototype-1.6.0.3.js - About 55 mins to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Function replace has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                Element.Methods.replace = function(element, content) {
                                  element = $(element);
                              
                                  if (content && content.toElement) content = content.toElement();
                                  if (Object.isElement(content)) {
                              Severity: Minor
                              Found in js/prototype/prototype-1.6.0.3.js - About 55 mins to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Function getStyle has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                getStyle: function(element, style) {
                                  element = $(element);
                                  style = style == 'float' ? 'cssFloat' : style.camelize();
                                  var value = element.style[style];
                                  if (!value || value == 'auto') {
                              Severity: Minor
                              Found in js/prototype/prototype-1.6.0.3.js - About 55 mins to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Function updateContent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                updateContent: function(responseText) {
                                  var receiver = this.container[this.success() ? 'success' : 'failure'],
                                      options = this.options;
                              
                                  if (!options.evalScripts) responseText = responseText.stripScripts();
                              Severity: Minor
                              Found in js/prototype/prototype-1.6.0.3.js - About 45 mins to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Avoid deeply nested control flow statements.
                              Open

                                            if (targetNode.parentNode == node) return [targetNode];
                              Severity: Major
                              Found in js/prototype/prototype-1.6.0.3.js - About 45 mins to fix

                                Function attr has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    attr: function(nodes, root, attr, value, operator, combinator) {
                                Severity: Minor
                                Found in js/prototype/prototype-1.6.0.3.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                          if (value[1]) return parseFloat(value[1]) / 100;
                                  Severity: Major
                                  Found in js/prototype/prototype-1.6.0.3.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                for (var i = 0, node; node = nodes[i]; i++)
                                                  if (Element.descendantOf(targetNode, node)) return [targetNode];
                                    Severity: Major
                                    Found in js/prototype/prototype-1.6.0.3.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                            if (element.offsetParent == document.body)
                                              if (Element.getStyle(element, 'position') == 'absolute') break;
                                      Severity: Major
                                      Found in js/prototype/prototype-1.6.0.3.js - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                              if(element.tagName.toUpperCase() == 'IMG' && element.width) {
                                                element.width++; element.width--;
                                              } else try {
                                                var n = document.createTextNode(' ');
                                                element.appendChild(n);
                                        Severity: Major
                                        Found in js/prototype/prototype-1.6.0.3.js - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                      if (node.nodeIndex == indices[j]) results.push(node);
                                          Severity: Major
                                          Found in js/prototype/prototype-1.6.0.3.js - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                      } else if (combinator == 'adjacent') {
                                                        for (var i = 0, node; node = nodes[i]; i++)
                                                          if (Selector.handlers.previousElementSibling(targetNode) == node)
                                                            return [targetNode];
                                                      } else nodes = h[combinator](nodes);
                                            Severity: Major
                                            Found in js/prototype/prototype-1.6.0.3.js - About 45 mins to fix

                                              Consider simplifying this complex logical expression.
                                              Open

                                                    if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) ||
                                                        (classNames && classNames.all(function(name) {
                                                          return !name.toString().blank() && cn.include(' ' + name + ' ');
                                                        }))))
                                                      elements.push(Element.extend(child));
                                              Severity: Major
                                              Found in js/prototype/prototype-1.6.0.3.js - About 40 mins to fix

                                                Consider simplifying this complex logical expression.
                                                Open

                                                    if (Object.isString(insertions) || Object.isNumber(insertions) ||
                                                        Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
                                                          insertions = {bottom:insertions};
                                                Severity: Major
                                                Found in js/prototype/prototype-1.6.0.3.js - About 40 mins to fix

                                                  Function nth has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                  Open

                                                      nth: function(nodes, formula, root, reverse, ofType) {
                                                  Severity: Minor
                                                  Found in js/prototype/prototype-1.6.0.3.js - About 35 mins to fix

                                                    Function pseudo has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                    Open

                                                        pseudo: function(nodes, name, value, root, combinator) {
                                                    Severity: Minor
                                                    Found in js/prototype/prototype-1.6.0.3.js - About 35 mins to fix

                                                      Function child has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                          child: function(nodes) {
                                                            var h = Selector.handlers;
                                                            for (var i = 0, results = [], node; node = nodes[i]; i++) {
                                                              for (var j = 0, child; child = node.childNodes[j]; j++)
                                                                if (child.nodeType == 1 && child.tagName != '!') results.push(child);
                                                      Severity: Minor
                                                      Found in js/prototype/prototype-1.6.0.3.js - About 35 mins to fix

                                                      Cognitive Complexity

                                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                      A method's cognitive complexity is based on a few simple rules:

                                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                      • Code is considered more complex for each "break in the linear flow of the code"
                                                      • Code is considered more complex when "flow breaking structures are nested"

                                                      Further reading

                                                      Function request has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                        request: function(form, options) {
                                                          form = $(form), options = Object.clone(options || { });
                                                      
                                                          var params = options.parameters, action = form.readAttribute('action') || '';
                                                          if (action.blank()) action = window.location.href;
                                                      Severity: Minor
                                                      Found in js/prototype/prototype-1.6.0.3.js - About 35 mins to fix

                                                      Cognitive Complexity

                                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                      A method's cognitive complexity is based on a few simple rules:

                                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                      • Code is considered more complex for each "break in the linear flow of the code"
                                                      • Code is considered more complex when "flow breaking structures are nested"

                                                      Further reading

                                                      Function attr has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                          attr: function(nodes, root, attr, value, operator, combinator) {
                                                            if (!nodes) nodes = root.getElementsByTagName("*");
                                                            if (nodes && combinator) nodes = this[combinator](nodes);
                                                            var handler = Selector.operators[operator], results = [];
                                                            for (var i = 0, node; node = nodes[i]; i++) {
                                                      Severity: Minor
                                                      Found in js/prototype/prototype-1.6.0.3.js - About 35 mins to fix

                                                      Cognitive Complexity

                                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                      A method's cognitive complexity is based on a few simple rules:

                                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                      • Code is considered more complex for each "break in the linear flow of the code"
                                                      • Code is considered more complex when "flow breaking structures are nested"

                                                      Further reading

                                                      Function toJSON has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                        toJSON: function(object) {
                                                          var type = typeof object;
                                                          switch (type) {
                                                            case 'undefined':
                                                            case 'function':
                                                      Severity: Minor
                                                      Found in js/prototype/prototype-1.6.0.3.js - About 35 mins to fix

                                                      Cognitive Complexity

                                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                      A method's cognitive complexity is based on a few simple rules:

                                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                      • Code is considered more complex for each "break in the linear flow of the code"
                                                      • Code is considered more complex when "flow breaking structures are nested"

                                                      Further reading

                                                      Function update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                        Element.Methods.update = function(element, content) {
                                                          element = $(element);
                                                      
                                                          if (content && content.toElement) content = content.toElement();
                                                          if (Object.isElement(content)) return element.update().insert(content);
                                                      Severity: Minor
                                                      Found in js/prototype/prototype-1.6.0.3.js - About 35 mins to fix

                                                      Cognitive Complexity

                                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                      A method's cognitive complexity is based on a few simple rules:

                                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                      • Code is considered more complex for each "break in the linear flow of the code"
                                                      • Code is considered more complex when "flow breaking structures are nested"

                                                      Further reading

                                                      Function lastIndexOf has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                      if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) {
                                                        i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1;
                                                        var n = this.slice(0, i).reverse().indexOf(item);
                                                        return (n < 0) ? n : i - n - 1;
                                                      };
                                                      Severity: Minor
                                                      Found in js/prototype/prototype-1.6.0.3.js - About 35 mins to fix

                                                      Cognitive Complexity

                                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                      A method's cognitive complexity is based on a few simple rules:

                                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                      • Code is considered more complex for each "break in the linear flow of the code"
                                                      • Code is considered more complex when "flow breaking structures are nested"

                                                      Further reading

                                                      Function byClassName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                          byClassName: function(nodes, root, className) {
                                                            if (!nodes) nodes = Selector.handlers.descendant([root]);
                                                            var needle = ' ' + className + ' ';
                                                            for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) {
                                                              nodeClassName = node.className;
                                                      Severity: Minor
                                                      Found in js/prototype/prototype-1.6.0.3.js - About 35 mins to fix

                                                      Cognitive Complexity

                                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                      A method's cognitive complexity is based on a few simple rules:

                                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                      • Code is considered more complex for each "break in the linear flow of the code"
                                                      • Code is considered more complex when "flow breaking structures are nested"

                                                      Further reading

                                                      Function indexOf has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                      if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) {
                                                        i || (i = 0);
                                                        var length = this.length;
                                                        if (i < 0) i = length + i;
                                                        for (; i < length; i++)
                                                      Severity: Minor
                                                      Found in js/prototype/prototype-1.6.0.3.js - About 35 mins to fix

                                                      Cognitive Complexity

                                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                      A method's cognitive complexity is based on a few simple rules:

                                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                      • Code is considered more complex for each "break in the linear flow of the code"
                                                      • Code is considered more complex when "flow breaking structures are nested"

                                                      Further reading

                                                      Avoid too many return statements within this function.
                                                      Open

                                                              return [];
                                                      Severity: Major
                                                      Found in js/prototype/prototype-1.6.0.3.js - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                                        return [targetNode];
                                                        Severity: Major
                                                        Found in js/prototype/prototype-1.6.0.3.js - About 30 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                                    if (node == targetNode) return [targetNode];
                                                          Severity: Major
                                                          Found in js/prototype/prototype-1.6.0.3.js - About 30 mins to fix

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                return value;
                                                            Severity: Major
                                                            Found in js/prototype/prototype-1.6.0.3.js - About 30 mins to fix

                                                              Avoid too many return statements within this function.
                                                              Open

                                                                    return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : [];
                                                              Severity: Major
                                                              Found in js/prototype/prototype-1.6.0.3.js - About 30 mins to fix

                                                                Function initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                  initialize: function(request){
                                                                    this.request = request;
                                                                    var transport  = this.transport  = request.transport,
                                                                        readyState = this.readyState = transport.readyState;
                                                                
                                                                
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js - About 25 mins to fix

                                                                Cognitive Complexity

                                                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                                A method's cognitive complexity is based on a few simple rules:

                                                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                                • Code is considered more complex for each "break in the linear flow of the code"
                                                                • Code is considered more complex when "flow breaking structures are nested"

                                                                Further reading

                                                                Function clonePosition has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                  clonePosition: function(element, source) {
                                                                    var options = Object.extend({
                                                                      setLeft:    true,
                                                                      setTop:     true,
                                                                      setWidth:   true,
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js - About 25 mins to fix

                                                                Cognitive Complexity

                                                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                                A method's cognitive complexity is based on a few simple rules:

                                                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                                • Code is considered more complex for each "break in the linear flow of the code"
                                                                • Code is considered more complex when "flow breaking structures are nested"

                                                                Further reading

                                                                Function attrPresence has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                    attrPresence: function(nodes, root, attr, combinator) {
                                                                      if (!nodes) nodes = root.getElementsByTagName("*");
                                                                      if (nodes && combinator) nodes = this[combinator](nodes);
                                                                      var results = [];
                                                                      for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js - About 25 mins to fix

                                                                Cognitive Complexity

                                                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                                A method's cognitive complexity is based on a few simple rules:

                                                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                                • Code is considered more complex for each "break in the linear flow of the code"
                                                                • Code is considered more complex when "flow breaking structures are nested"

                                                                Further reading

                                                                Function getInputs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                  getInputs: function(form, typeName, name) {
                                                                    form = $(form);
                                                                    var inputs = form.getElementsByTagName('input');
                                                                
                                                                    if (!typeName && !name) return $A(inputs).map(Element.extend);
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js - About 25 mins to fix

                                                                Cognitive Complexity

                                                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                                A method's cognitive complexity is based on a few simple rules:

                                                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                                • Code is considered more complex for each "break in the linear flow of the code"
                                                                • Code is considered more complex when "flow breaking structures are nested"

                                                                Further reading

                                                                Function getOffsetParent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                  getOffsetParent: function(element) {
                                                                    if (element.offsetParent) return $(element.offsetParent);
                                                                    if (element == document.body) return $(element);
                                                                
                                                                    while ((element = element.parentNode) && element != document.body)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js - About 25 mins to fix

                                                                Cognitive Complexity

                                                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                                A method's cognitive complexity is based on a few simple rules:

                                                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                                • Code is considered more complex for each "break in the linear flow of the code"
                                                                • Code is considered more complex when "flow breaking structures are nested"

                                                                Further reading

                                                                Function inspect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                  inspect: function(object) {
                                                                    try {
                                                                      if (Object.isUndefined(object)) return 'undefined';
                                                                      if (object === null) return 'null';
                                                                      return object.inspect ? object.inspect() : String(object);
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js - About 25 mins to fix

                                                                Cognitive Complexity

                                                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                                A method's cognitive complexity is based on a few simple rules:

                                                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                                • Code is considered more complex for each "break in the linear flow of the code"
                                                                • Code is considered more complex when "flow breaking structures are nested"

                                                                Further reading

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                    return object != null && typeof object == "object" &&
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    return typeof object == "undefined";
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Return statement should not contain assignment.
                                                                Open

                                                                    return this._methodized = function() {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Assignment in return Statement (no-return-assign)

                                                                One of the interesting, and sometimes confusing, aspects of JavaScript is that assignment can happen at almost any point. Because of this, an errant equals sign can end up causing assignment when the true intent was to do a comparison. This is especially true when using a return statement. For example:

                                                                function doSomething() {
                                                                    return foo = bar + 2;
                                                                }

                                                                It is difficult to tell the intent of the return statement here. It's possible that the function is meant to return the result of bar + 2, but then why is it assigning to foo? It's also possible that the intent was to use a comparison operator such as == and that this code is an error.

                                                                Because of this ambiguity, it's considered a best practice to not use assignment in return statements.

                                                                Rule Details

                                                                This rule aims to eliminate assignments from return statements. As such, it will warn whenever an assignment is found as part of return.

                                                                Options

                                                                The rule takes one option, a string, which must contain one of the following values:

                                                                • except-parens (default): Disallow assignments unless they are enclosed in parentheses.
                                                                • always: Disallow all assignments.

                                                                except-parens

                                                                This is the default option. It disallows assignments unless they are enclosed in parentheses.

                                                                Examples of incorrect code for the default "except-parens" option:

                                                                /*eslint no-return-assign: "error"*/
                                                                
                                                                function doSomething() {
                                                                    return foo = bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return foo += 2;
                                                                }

                                                                Examples of correct code for the default "except-parens" option:

                                                                /*eslint no-return-assign: "error"*/
                                                                
                                                                function doSomething() {
                                                                    return foo == bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return foo === bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return (foo = bar + 2);
                                                                }

                                                                always

                                                                This option disallows all assignments in return statements. All assignments are treated as problems.

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint no-return-assign: ["error", "always"]*/
                                                                
                                                                function doSomething() {
                                                                    return foo = bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return foo += 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return (foo = bar + 2);
                                                                }

                                                                Examples of correct code for the "always" option:

                                                                /*eslint no-return-assign: ["error", "always"]*/
                                                                
                                                                function doSomething() {
                                                                    return foo == bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return foo === bar + 2;
                                                                }

                                                                When Not To Use It

                                                                If you want to allow the use of assignment operators in a return statement, then you can safely disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (result == null || value < result)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (state == 'Complete') {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                    if (receiver = $(receiver)) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      tagName = ((position == 'before' || position == 'after')
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected an assignment or function call and instead saw an expression.
                                                                Open

                                                                      try { element.offsetParent }
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Unused Expressions (no-unused-expressions)

                                                                An unused expression which has no effect on the state of the program indicates a logic error.

                                                                For example, n + 1; is not a syntax error, but it might be a typing mistake where a programmer meant an assignment statement n += 1; instead.

                                                                Rule Details

                                                                This rule aims to eliminate unused expressions which have no effect on the state of the program.

                                                                This rule does not apply to function calls or constructor calls with the new operator, because they could have side effects on the state of the program.

                                                                var i = 0;
                                                                function increment() { i += 1; }
                                                                increment(); // return value is unused, but i changed as a side effect
                                                                
                                                                var nThings = 0;
                                                                function Thing() { nThings += 1; }
                                                                new Thing(); // constructed object is unused, but nThings changed as a side effect

                                                                This rule does not apply to directives (which are in the form of literal string expressions such as "use strict"; at the beginning of a script, module, or function).

                                                                Sequence expressions (those using a comma, such as a = 1, b = 2) are always considered unused unless their return value is assigned or used in a condition evaluation, or a function call is made with the sequence expression value.

                                                                Options

                                                                This rule, in its default state, does not require any arguments. If you would like to enable one or more of the following you may pass an object with the options set as follows:

                                                                • allowShortCircuit set to true will allow you to use short circuit evaluations in your expressions (Default: false).
                                                                • allowTernary set to true will enable you to use ternary operators in your expressions similarly to short circuit evaluations (Default: false).
                                                                • allowTaggedTemplates set to true will enable you to use tagged template literals in your expressions (Default: false).

                                                                These options allow unused expressions only if all of the code paths either directly change the state (for example, assignment statement) or could have side effects (for example, function call).

                                                                Examples of incorrect code for the default { "allowShortCircuit": false, "allowTernary": false } options:

                                                                /*eslint no-unused-expressions: "error"*/
                                                                
                                                                0
                                                                
                                                                if(0) 0
                                                                
                                                                {0}
                                                                
                                                                f(0), {}
                                                                
                                                                a && b()
                                                                
                                                                a, b()
                                                                
                                                                c = a, b;
                                                                
                                                                a() && function namedFunctionInExpressionContext () {f();}
                                                                
                                                                (function anIncompleteIIFE () {});
                                                                
                                                                injectGlobal`body{ color: red; }`

                                                                Note that one or more string expression statements (with or without semi-colons) will only be considered as unused if they are not in the beginning of a script, module, or function (alone and uninterrupted by other statements). Otherwise, they will be treated as part of a "directive prologue", a section potentially usable by JavaScript engines. This includes "strict mode" directives.

                                                                "use strict";
                                                                "use asm"
                                                                "use stricter";
                                                                "use babel"
                                                                "any other strings like this in the prologue";

                                                                Examples of correct code for the default { "allowShortCircuit": false, "allowTernary": false } options:

                                                                /*eslint no-unused-expressions: "error"*/
                                                                
                                                                {} // In this context, this is a block statement, not an object literal
                                                                
                                                                {myLabel: someVar} // In this context, this is a block statement with a label and expression, not an object literal
                                                                
                                                                function namedFunctionDeclaration () {}
                                                                
                                                                (function aGenuineIIFE () {}());
                                                                
                                                                f()
                                                                
                                                                a = 0
                                                                
                                                                new C
                                                                
                                                                delete a.b
                                                                
                                                                void a

                                                                allowShortCircuit

                                                                Examples of incorrect code for the { "allowShortCircuit": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
                                                                
                                                                a || b

                                                                Examples of correct code for the { "allowShortCircuit": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
                                                                
                                                                a && b()
                                                                a() || (b = c)

                                                                allowTernary

                                                                Examples of incorrect code for the { "allowTernary": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
                                                                
                                                                a ? b : 0
                                                                a ? b : c()

                                                                Examples of correct code for the { "allowTernary": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
                                                                
                                                                a ? b() : c()
                                                                a ? (b = c) : d()

                                                                allowShortCircuit and allowTernary

                                                                Examples of correct code for the { "allowShortCircuit": true, "allowTernary": true } options:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true, "allowTernary": true }]*/
                                                                
                                                                a ? b() || (c = d) : e()

                                                                allowTaggedTemplates

                                                                Examples of incorrect code for the { "allowTaggedTemplates": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
                                                                
                                                                `some untagged template string`;

                                                                Examples of correct code for the { "allowTaggedTemplates": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
                                                                
                                                                tag`some tagged template string`;

                                                                Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if(element.tagName.toUpperCase() == 'IMG' && element.width) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                        element.nodeType != 1 || element == window) return element;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                        if (mm = formula.match(/^(\d+)$/)) // digit only
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                          if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                'i' is already defined.
                                                                Open

                                                                        for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow variable redeclaration (no-redeclare)

                                                                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                                                                Rule Details

                                                                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                var a = 10;

                                                                Examples of correct code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                // ...
                                                                a = 10;

                                                                Options

                                                                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                                                                builtinGlobals

                                                                Examples of incorrect code for the { "builtinGlobals": true } option:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                
                                                                var Object = 0;

                                                                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                /*eslint-env browser*/
                                                                
                                                                var top = 0;

                                                                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                                                                'node' is already defined.
                                                                Open

                                                                        for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow variable redeclaration (no-redeclare)

                                                                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                                                                Rule Details

                                                                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                var a = 10;

                                                                Examples of correct code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                // ...
                                                                a = 10;

                                                                Options

                                                                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                                                                builtinGlobals

                                                                Examples of incorrect code for the { "builtinGlobals": true } option:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                
                                                                var Object = 0;

                                                                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                /*eslint-env browser*/
                                                                
                                                                var top = 0;

                                                                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                                                                'i' is already defined.
                                                                Open

                                                                            for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow variable redeclaration (no-redeclare)

                                                                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                                                                Rule Details

                                                                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                var a = 10;

                                                                Examples of correct code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                // ...
                                                                a = 10;

                                                                Options

                                                                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                                                                builtinGlobals

                                                                Examples of incorrect code for the { "builtinGlobals": true } option:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                
                                                                var Object = 0;

                                                                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                /*eslint-env browser*/
                                                                
                                                                var top = 0;

                                                                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                                                                String prototype is read only, properties should not be added.
                                                                Open

                                                                String.prototype.parseQuery = String.prototype.toQueryParams;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Extending of Native Objects (no-extend-native)

                                                                In JavaScript, you can extend any object, including builtin or "native" objects. Sometimes people change the behavior of these native objects in ways that break the assumptions made about them in other parts of the code.

                                                                For example here we are overriding a builtin method that will then affect all Objects, even other builtins.

                                                                // seems harmless
                                                                Object.prototype.extra = 55;
                                                                
                                                                // loop through some userIds
                                                                var users = {
                                                                    "123": "Stan",
                                                                    "456": "David"
                                                                };
                                                                
                                                                // not what you'd expect
                                                                for (var id in users) {
                                                                    console.log(id); // "123", "456", "extra"
                                                                }

                                                                A common suggestion to avoid this problem would be to wrap the inside of the for loop with users.hasOwnProperty(id). However, if this rule is strictly enforced throughout your codebase you won't need to take that step.

                                                                Rule Details

                                                                Disallows directly modifying the prototype of builtin objects.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-extend-native: "error"*/
                                                                
                                                                Object.prototype.a = "a";
                                                                Object.defineProperty(Array.prototype, "times", { value: 999 });

                                                                Options

                                                                This rule accepts an exceptions option, which can be used to specify a list of builtins for which extensions will be allowed.

                                                                exceptions

                                                                Examples of correct code for the sample { "exceptions": ["Object"] } option:

                                                                /*eslint no-extend-native: ["error", { "exceptions": ["Object"] }]*/
                                                                
                                                                Object.prototype.a = "a";

                                                                Known Limitations

                                                                This rule does not report any of the following less obvious approaches to modify the prototype of builtin objects:

                                                                var x = Object;
                                                                x.prototype.thing = a;
                                                                
                                                                eval("Array.prototype.forEach = 'muhahaha'");
                                                                
                                                                with(Array) {
                                                                    prototype.thing = 'thing';
                                                                };
                                                                
                                                                window.Function.prototype.bind = 'tight';

                                                                When Not To Use It

                                                                You may want to disable this rule when working with polyfills that try to patch older versions of JavaScript with the latest spec, such as those that might Function.prototype.bind or Array.prototype.forEach in a future-friendly way.

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (before == '\\') return match[2];
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Use ‘===’ to compare with ‘null’.
                                                                Open

                                                                      if (match == null) return before;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Null Comparisons (no-eq-null)

                                                                Comparing to null without a type-checking operator (== or !=), can have unintended results as the comparison will evaluate to true when comparing to not just a null, but also an undefined value.

                                                                if (foo == null) {
                                                                  bar();
                                                                }

                                                                Rule Details

                                                                The no-eq-null rule aims reduce potential bug and unwanted behavior by ensuring that comparisons to null only match null, and not also undefined. As such it will flag comparisons to null when using == and !=.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo == null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux != null) {
                                                                  baz();
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo === null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux !== null) {
                                                                  baz();
                                                                }

                                                                Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element));
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    element.style.overflow = element._overflow == 'auto' ? '' : element._overflow;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (element.getStyle('position') == 'relative') return element;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                        if (Element.getStyle(element, 'position') == 'absolute') break;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
                                                                Open

                                                                    for (var property in methods) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require Guarding for-in (guard-for-in)

                                                                Looping over objects with a for in loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.

                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Note that simply checking foo.hasOwnProperty(key) is likely to cause an error in some cases; see [no-prototype-builtins](no-prototype-builtins.md).

                                                                Rule Details

                                                                This rule is aimed at preventing unexpected behavior that could arise from using a for in loop without filtering the results in the loop. As such, it will warn when for in loops do not filter their results with an if statement.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    if (Object.prototype.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                    if ({}.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                }

                                                                Related Rules

                                                                • [no-prototype-builtins](no-prototype-builtins.md)

                                                                Further Reading

                                                                Empty block statement.
                                                                Open

                                                                    } catch (e) { }
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow empty block statements (no-empty)

                                                                Empty block statements, while not technically errors, usually occur due to refactoring that wasn't completed. They can cause confusion when reading code.

                                                                Rule Details

                                                                This rule disallows empty block statements. This rule ignores block statements which contain a comment (for example, in an empty catch or finally block of a try statement to indicate that execution should continue regardless of errors).

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-empty: "error"*/
                                                                
                                                                if (foo) {
                                                                }
                                                                
                                                                while (foo) {
                                                                }
                                                                
                                                                switch(foo) {
                                                                }
                                                                
                                                                try {
                                                                    doSomething();
                                                                } catch(ex) {
                                                                
                                                                } finally {
                                                                
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint no-empty: "error"*/
                                                                
                                                                if (foo) {
                                                                    // empty
                                                                }
                                                                
                                                                while (foo) {
                                                                    /* empty */
                                                                }
                                                                
                                                                try {
                                                                    doSomething();
                                                                } catch (ex) {
                                                                    // continue regardless of error
                                                                }
                                                                
                                                                try {
                                                                    doSomething();
                                                                } finally {
                                                                    /* continue regardless of error */
                                                                }

                                                                Options

                                                                This rule has an object option for exceptions:

                                                                • "allowEmptyCatch": true allows empty catch clauses (that is, which do not contain a comment)

                                                                allowEmptyCatch

                                                                Examples of additional correct code for this rule with the { "allowEmptyCatch": true } option:

                                                                /* eslint no-empty: ["error", { "allowEmptyCatch": true }] */
                                                                try {
                                                                    doSomething();
                                                                } catch (ex) {}
                                                                
                                                                try {
                                                                    doSomething();
                                                                }
                                                                catch (ex) {}
                                                                finally {
                                                                    /* continue regardless of error */
                                                                }

                                                                When Not To Use It

                                                                If you intentionally use empty block statements then you can disable this rule.

                                                                Related Rules

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                      if (0 == index || (sorted ? array.last() != value : !array.include(value)))
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
                                                                Open

                                                                  for (var property in source)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require Guarding for-in (guard-for-in)

                                                                Looping over objects with a for in loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.

                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Note that simply checking foo.hasOwnProperty(key) is likely to cause an error in some cases; see [no-prototype-builtins](no-prototype-builtins.md).

                                                                Rule Details

                                                                This rule is aimed at preventing unexpected behavior that could arise from using a for in loop without filtering the results in the loop. As such, it will warn when for in loops do not filter their results with an if statement.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    if (Object.prototype.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                    if ({}.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                }

                                                                Related Rules

                                                                • [no-prototype-builtins](no-prototype-builtins.md)

                                                                Further Reading

                                                                The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
                                                                Open

                                                                      for (var i in ps) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require Guarding for-in (guard-for-in)

                                                                Looping over objects with a for in loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.

                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Note that simply checking foo.hasOwnProperty(key) is likely to cause an error in some cases; see [no-prototype-builtins](no-prototype-builtins.md).

                                                                Rule Details

                                                                This rule is aimed at preventing unexpected behavior that could arise from using a for in loop without filtering the results in the loop. As such, it will warn when for in loops do not filter their results with an if statement.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    if (Object.prototype.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                    if ({}.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                }

                                                                Related Rules

                                                                • [no-prototype-builtins](no-prototype-builtins.md)

                                                                Further Reading

                                                                The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
                                                                Open

                                                                    for (var property in object)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require Guarding for-in (guard-for-in)

                                                                Looping over objects with a for in loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.

                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Note that simply checking foo.hasOwnProperty(key) is likely to cause an error in some cases; see [no-prototype-builtins](no-prototype-builtins.md).

                                                                Rule Details

                                                                This rule is aimed at preventing unexpected behavior that could arise from using a for in loop without filtering the results in the loop. As such, it will warn when for in loops do not filter their results with an if statement.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    if (Object.prototype.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                    if ({}.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                }

                                                                Related Rules

                                                                • [no-prototype-builtins](no-prototype-builtins.md)

                                                                Further Reading

                                                                Array prototype is read only, properties should not be added.
                                                                Open

                                                                  Array.prototype.concat = function() {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Extending of Native Objects (no-extend-native)

                                                                In JavaScript, you can extend any object, including builtin or "native" objects. Sometimes people change the behavior of these native objects in ways that break the assumptions made about them in other parts of the code.

                                                                For example here we are overriding a builtin method that will then affect all Objects, even other builtins.

                                                                // seems harmless
                                                                Object.prototype.extra = 55;
                                                                
                                                                // loop through some userIds
                                                                var users = {
                                                                    "123": "Stan",
                                                                    "456": "David"
                                                                };
                                                                
                                                                // not what you'd expect
                                                                for (var id in users) {
                                                                    console.log(id); // "123", "456", "extra"
                                                                }

                                                                A common suggestion to avoid this problem would be to wrap the inside of the for loop with users.hasOwnProperty(id). However, if this rule is strictly enforced throughout your codebase you won't need to take that step.

                                                                Rule Details

                                                                Disallows directly modifying the prototype of builtin objects.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-extend-native: "error"*/
                                                                
                                                                Object.prototype.a = "a";
                                                                Object.defineProperty(Array.prototype, "times", { value: 999 });

                                                                Options

                                                                This rule accepts an exceptions option, which can be used to specify a list of builtins for which extensions will be allowed.

                                                                exceptions

                                                                Examples of correct code for the sample { "exceptions": ["Object"] } option:

                                                                /*eslint no-extend-native: ["error", { "exceptions": ["Object"] }]*/
                                                                
                                                                Object.prototype.a = "a";

                                                                Known Limitations

                                                                This rule does not report any of the following less obvious approaches to modify the prototype of builtin objects:

                                                                var x = Object;
                                                                x.prototype.thing = a;
                                                                
                                                                eval("Array.prototype.forEach = 'muhahaha'");
                                                                
                                                                with(Array) {
                                                                    prototype.thing = 'thing';
                                                                };
                                                                
                                                                window.Function.prototype.bind = 'tight';

                                                                When Not To Use It

                                                                You may want to disable this rule when working with polyfills that try to patch older versions of JavaScript with the latest spec, such as those that might Function.prototype.bind or Array.prototype.forEach in a future-friendly way.

                                                                Related Rules

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                        if (m = e.match(p)) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    return value == null ? '' : String(value);
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                        if (m = e.match(ps[i])) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected an assignment or function call and instead saw an expression.
                                                                Open

                                                                        result += source, source = '';
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Unused Expressions (no-unused-expressions)

                                                                An unused expression which has no effect on the state of the program indicates a logic error.

                                                                For example, n + 1; is not a syntax error, but it might be a typing mistake where a programmer meant an assignment statement n += 1; instead.

                                                                Rule Details

                                                                This rule aims to eliminate unused expressions which have no effect on the state of the program.

                                                                This rule does not apply to function calls or constructor calls with the new operator, because they could have side effects on the state of the program.

                                                                var i = 0;
                                                                function increment() { i += 1; }
                                                                increment(); // return value is unused, but i changed as a side effect
                                                                
                                                                var nThings = 0;
                                                                function Thing() { nThings += 1; }
                                                                new Thing(); // constructed object is unused, but nThings changed as a side effect

                                                                This rule does not apply to directives (which are in the form of literal string expressions such as "use strict"; at the beginning of a script, module, or function).

                                                                Sequence expressions (those using a comma, such as a = 1, b = 2) are always considered unused unless their return value is assigned or used in a condition evaluation, or a function call is made with the sequence expression value.

                                                                Options

                                                                This rule, in its default state, does not require any arguments. If you would like to enable one or more of the following you may pass an object with the options set as follows:

                                                                • allowShortCircuit set to true will allow you to use short circuit evaluations in your expressions (Default: false).
                                                                • allowTernary set to true will enable you to use ternary operators in your expressions similarly to short circuit evaluations (Default: false).
                                                                • allowTaggedTemplates set to true will enable you to use tagged template literals in your expressions (Default: false).

                                                                These options allow unused expressions only if all of the code paths either directly change the state (for example, assignment statement) or could have side effects (for example, function call).

                                                                Examples of incorrect code for the default { "allowShortCircuit": false, "allowTernary": false } options:

                                                                /*eslint no-unused-expressions: "error"*/
                                                                
                                                                0
                                                                
                                                                if(0) 0
                                                                
                                                                {0}
                                                                
                                                                f(0), {}
                                                                
                                                                a && b()
                                                                
                                                                a, b()
                                                                
                                                                c = a, b;
                                                                
                                                                a() && function namedFunctionInExpressionContext () {f();}
                                                                
                                                                (function anIncompleteIIFE () {});
                                                                
                                                                injectGlobal`body{ color: red; }`

                                                                Note that one or more string expression statements (with or without semi-colons) will only be considered as unused if they are not in the beginning of a script, module, or function (alone and uninterrupted by other statements). Otherwise, they will be treated as part of a "directive prologue", a section potentially usable by JavaScript engines. This includes "strict mode" directives.

                                                                "use strict";
                                                                "use asm"
                                                                "use stricter";
                                                                "use babel"
                                                                "any other strings like this in the prologue";

                                                                Examples of correct code for the default { "allowShortCircuit": false, "allowTernary": false } options:

                                                                /*eslint no-unused-expressions: "error"*/
                                                                
                                                                {} // In this context, this is a block statement, not an object literal
                                                                
                                                                {myLabel: someVar} // In this context, this is a block statement with a label and expression, not an object literal
                                                                
                                                                function namedFunctionDeclaration () {}
                                                                
                                                                (function aGenuineIIFE () {}());
                                                                
                                                                f()
                                                                
                                                                a = 0
                                                                
                                                                new C
                                                                
                                                                delete a.b
                                                                
                                                                void a

                                                                allowShortCircuit

                                                                Examples of incorrect code for the { "allowShortCircuit": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
                                                                
                                                                a || b

                                                                Examples of correct code for the { "allowShortCircuit": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
                                                                
                                                                a && b()
                                                                a() || (b = c)

                                                                allowTernary

                                                                Examples of incorrect code for the { "allowTernary": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
                                                                
                                                                a ? b : 0
                                                                a ? b : c()

                                                                Examples of correct code for the { "allowTernary": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
                                                                
                                                                a ? b() : c()
                                                                a ? (b = c) : d()

                                                                allowShortCircuit and allowTernary

                                                                Examples of correct code for the { "allowShortCircuit": true, "allowTernary": true } options:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true, "allowTernary": true }]*/
                                                                
                                                                a ? b() || (c = d) : e()

                                                                allowTaggedTemplates

                                                                Examples of incorrect code for the { "allowTaggedTemplates": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
                                                                
                                                                `some untagged template string`;

                                                                Examples of correct code for the { "allowTaggedTemplates": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
                                                                
                                                                tag`some tagged template string`;

                                                                Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                        if (values && typeof values == 'object') {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (m[1] == '*') return '';
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                      if (this.indexOf(object) != -1) return true;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                          } else if (combinator == 'descendant') {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                unnecessary '.apply()'.
                                                                Open

                                                                          responder[callback].apply(responder, [request, transport, json]);
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow unnecessary .call() and .apply(). (no-useless-call)

                                                                The function invocation can be written by Function.prototype.call() and Function.prototype.apply(). But Function.prototype.call() and Function.prototype.apply() are slower than the normal function invocation.

                                                                Rule Details

                                                                This rule is aimed to flag usage of Function.prototype.call() and Function.prototype.apply() that can be replaced with the normal function invocation.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-useless-call: "error"*/
                                                                
                                                                // These are same as `foo(1, 2, 3);`
                                                                foo.call(undefined, 1, 2, 3);
                                                                foo.apply(undefined, [1, 2, 3]);
                                                                foo.call(null, 1, 2, 3);
                                                                foo.apply(null, [1, 2, 3]);
                                                                
                                                                // These are same as `obj.foo(1, 2, 3);`
                                                                obj.foo.call(obj, 1, 2, 3);
                                                                obj.foo.apply(obj, [1, 2, 3]);

                                                                Examples of correct code for this rule:

                                                                /*eslint no-useless-call: "error"*/
                                                                
                                                                // The `this` binding is different.
                                                                foo.call(obj, 1, 2, 3);
                                                                foo.apply(obj, [1, 2, 3]);
                                                                obj.foo.call(null, 1, 2, 3);
                                                                obj.foo.apply(null, [1, 2, 3]);
                                                                obj.foo.call(otherObj, 1, 2, 3);
                                                                obj.foo.apply(otherObj, [1, 2, 3]);
                                                                
                                                                // The argument list is variadic.
                                                                foo.apply(undefined, args);
                                                                foo.apply(null, args);
                                                                obj.foo.apply(obj, args);

                                                                Known Limitations

                                                                This rule compares code statically to check whether or not thisArg is changed. So if the code about thisArg is a dynamic expression, this rule cannot judge correctly.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-useless-call: "error"*/
                                                                
                                                                a[i++].foo.call(a[i++], 1, 2, 3);

                                                                Examples of correct code for this rule:

                                                                /*eslint no-useless-call: "error"*/
                                                                
                                                                a[++i].foo.call(a[i], 1, 2, 3);

                                                                When Not To Use It

                                                                If you don't want to be notified about unnecessary .call() and .apply(), you can safely disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                    return $(element).style.display != 'none';
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (position == 'top' || position == 'after') childNodes.reverse();
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                        elementStyle[(property == 'float' || property == 'cssFloat') ?
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (element.nodeType == 1)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                    while ((element = element.parentNode) && element != document.body)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                    while (element && element.nodeType != 1) element = element.nextSibling;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                    } while (element = element.parentNode);
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (value == 'auto') {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Empty block statement.
                                                                Open

                                                                      } catch (e) { }
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow empty block statements (no-empty)

                                                                Empty block statements, while not technically errors, usually occur due to refactoring that wasn't completed. They can cause confusion when reading code.

                                                                Rule Details

                                                                This rule disallows empty block statements. This rule ignores block statements which contain a comment (for example, in an empty catch or finally block of a try statement to indicate that execution should continue regardless of errors).

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-empty: "error"*/
                                                                
                                                                if (foo) {
                                                                }
                                                                
                                                                while (foo) {
                                                                }
                                                                
                                                                switch(foo) {
                                                                }
                                                                
                                                                try {
                                                                    doSomething();
                                                                } catch(ex) {
                                                                
                                                                } finally {
                                                                
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint no-empty: "error"*/
                                                                
                                                                if (foo) {
                                                                    // empty
                                                                }
                                                                
                                                                while (foo) {
                                                                    /* empty */
                                                                }
                                                                
                                                                try {
                                                                    doSomething();
                                                                } catch (ex) {
                                                                    // continue regardless of error
                                                                }
                                                                
                                                                try {
                                                                    doSomething();
                                                                } finally {
                                                                    /* continue regardless of error */
                                                                }

                                                                Options

                                                                This rule has an object option for exceptions:

                                                                • "allowEmptyCatch": true allows empty catch clauses (that is, which do not contain a comment)

                                                                allowEmptyCatch

                                                                Examples of additional correct code for this rule with the { "allowEmptyCatch": true } option:

                                                                /* eslint no-empty: ["error", { "allowEmptyCatch": true }] */
                                                                try {
                                                                    doSomething();
                                                                } catch (ex) {}
                                                                
                                                                try {
                                                                    doSomething();
                                                                }
                                                                catch (ex) {}
                                                                finally {
                                                                    /* continue regardless of error */
                                                                }

                                                                When Not To Use It

                                                                If you intentionally use empty block statements then you can disable this rule.

                                                                Related Rules

                                                                The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
                                                                Open

                                                                    for (var tag in Element.Methods.ByTag) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require Guarding for-in (guard-for-in)

                                                                Looping over objects with a for in loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.

                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Note that simply checking foo.hasOwnProperty(key) is likely to cause an error in some cases; see [no-prototype-builtins](no-prototype-builtins.md).

                                                                Rule Details

                                                                This rule is aimed at preventing unexpected behavior that could arise from using a for in loop without filtering the results in the loop. As such, it will warn when for in loops do not filter their results with an if statement.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    if (Object.prototype.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                    if ({}.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                }

                                                                Related Rules

                                                                • [no-prototype-builtins](no-prototype-builtins.md)

                                                                Further Reading

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      return matches[1].toUpperCase() == element.tagName.toUpperCase();
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      for (var i = 0, node; node = b[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                          if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                        for (var j = 0, child; child = node.childNodes[j]; j++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
                                                                Open

                                                                    for (var property in object) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require Guarding for-in (guard-for-in)

                                                                Looping over objects with a for in loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.

                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Note that simply checking foo.hasOwnProperty(key) is likely to cause an error in some cases; see [no-prototype-builtins](no-prototype-builtins.md).

                                                                Rule Details

                                                                This rule is aimed at preventing unexpected behavior that could arise from using a for in loop without filtering the results in the loop. As such, it will warn when for in loops do not filter their results with an if statement.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    if (Object.prototype.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                    if ({}.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                }

                                                                Related Rules

                                                                • [no-prototype-builtins](no-prototype-builtins.md)

                                                                Further Reading

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    return typeof object == "number";
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                '$A' is a function.
                                                                Open

                                                                  $A = function(iterable) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow reassigning function declarations (no-func-assign)

                                                                JavaScript functions can be written as a FunctionDeclaration function foo() { ... } or as a FunctionExpression var foo = function() { ... };. While a JavaScript interpreter might tolerate it, overwriting/reassigning a function written as a FunctionDeclaration is often indicative of a mistake or issue.

                                                                function foo() {}
                                                                foo = bar;

                                                                Rule Details

                                                                This rule disallows reassigning function declarations.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-func-assign: "error"*/
                                                                
                                                                function foo() {}
                                                                foo = bar;
                                                                
                                                                function foo() {
                                                                    foo = bar;
                                                                }

                                                                Examples of incorrect code for this rule, unlike the corresponding rule in JSHint:

                                                                /*eslint no-func-assign: "error"*/
                                                                
                                                                foo = bar;
                                                                function foo() {}

                                                                Examples of correct code for this rule:

                                                                /*eslint no-func-assign: "error"*/
                                                                
                                                                var foo = function () {}
                                                                foo = bar;
                                                                
                                                                function foo(foo) { // `foo` is shadowed.
                                                                    foo = bar;
                                                                }
                                                                
                                                                function foo() {
                                                                    var foo = bar;  // `foo` is shadowed.
                                                                }

                                                                Source: http://eslint.org/docs/rules/

                                                                Array prototype is read only, properties should not be added.
                                                                Open

                                                                if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Extending of Native Objects (no-extend-native)

                                                                In JavaScript, you can extend any object, including builtin or "native" objects. Sometimes people change the behavior of these native objects in ways that break the assumptions made about them in other parts of the code.

                                                                For example here we are overriding a builtin method that will then affect all Objects, even other builtins.

                                                                // seems harmless
                                                                Object.prototype.extra = 55;
                                                                
                                                                // loop through some userIds
                                                                var users = {
                                                                    "123": "Stan",
                                                                    "456": "David"
                                                                };
                                                                
                                                                // not what you'd expect
                                                                for (var id in users) {
                                                                    console.log(id); // "123", "456", "extra"
                                                                }

                                                                A common suggestion to avoid this problem would be to wrap the inside of the for loop with users.hasOwnProperty(id). However, if this rule is strictly enforced throughout your codebase you won't need to take that step.

                                                                Rule Details

                                                                Disallows directly modifying the prototype of builtin objects.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-extend-native: "error"*/
                                                                
                                                                Object.prototype.a = "a";
                                                                Object.defineProperty(Array.prototype, "times", { value: 999 });

                                                                Options

                                                                This rule accepts an exceptions option, which can be used to specify a list of builtins for which extensions will be allowed.

                                                                exceptions

                                                                Examples of correct code for the sample { "exceptions": ["Object"] } option:

                                                                /*eslint no-extend-native: ["error", { "exceptions": ["Object"] }]*/
                                                                
                                                                Object.prototype.a = "a";

                                                                Known Limitations

                                                                This rule does not report any of the following less obvious approaches to modify the prototype of builtin objects:

                                                                var x = Object;
                                                                x.prototype.thing = a;
                                                                
                                                                eval("Array.prototype.forEach = 'muhahaha'");
                                                                
                                                                with(Array) {
                                                                    prototype.thing = 'thing';
                                                                };
                                                                
                                                                window.Function.prototype.bind = 'tight';

                                                                When Not To Use It

                                                                You may want to disable this rule when working with polyfills that try to patch older versions of JavaScript with the latest spec, such as those that might Function.prototype.bind or Array.prototype.forEach in a future-friendly way.

                                                                Related Rules

                                                                Return statement should not contain assignment.
                                                                Open

                                                                      return this._object[key] = value;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Assignment in return Statement (no-return-assign)

                                                                One of the interesting, and sometimes confusing, aspects of JavaScript is that assignment can happen at almost any point. Because of this, an errant equals sign can end up causing assignment when the true intent was to do a comparison. This is especially true when using a return statement. For example:

                                                                function doSomething() {
                                                                    return foo = bar + 2;
                                                                }

                                                                It is difficult to tell the intent of the return statement here. It's possible that the function is meant to return the result of bar + 2, but then why is it assigning to foo? It's also possible that the intent was to use a comparison operator such as == and that this code is an error.

                                                                Because of this ambiguity, it's considered a best practice to not use assignment in return statements.

                                                                Rule Details

                                                                This rule aims to eliminate assignments from return statements. As such, it will warn whenever an assignment is found as part of return.

                                                                Options

                                                                The rule takes one option, a string, which must contain one of the following values:

                                                                • except-parens (default): Disallow assignments unless they are enclosed in parentheses.
                                                                • always: Disallow all assignments.

                                                                except-parens

                                                                This is the default option. It disallows assignments unless they are enclosed in parentheses.

                                                                Examples of incorrect code for the default "except-parens" option:

                                                                /*eslint no-return-assign: "error"*/
                                                                
                                                                function doSomething() {
                                                                    return foo = bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return foo += 2;
                                                                }

                                                                Examples of correct code for the default "except-parens" option:

                                                                /*eslint no-return-assign: "error"*/
                                                                
                                                                function doSomething() {
                                                                    return foo == bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return foo === bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return (foo = bar + 2);
                                                                }

                                                                always

                                                                This option disallows all assignments in return statements. All assignments are treated as problems.

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint no-return-assign: ["error", "always"]*/
                                                                
                                                                function doSomething() {
                                                                    return foo = bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return foo += 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return (foo = bar + 2);
                                                                }

                                                                Examples of correct code for the "always" option:

                                                                /*eslint no-return-assign: ["error", "always"]*/
                                                                
                                                                function doSomething() {
                                                                    return foo == bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return foo === bar + 2;
                                                                }

                                                                When Not To Use It

                                                                If you want to allow the use of assignment operators in a return statement, then you can safely disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (this.method == 'post') {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (this.options.evalJS == 'force'
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (arguments.length == 1) return element.firstDescendant();
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (property == 'opacity') element.setOpacity(styles[property]);
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (element.getStyle('position') == 'absolute') return element;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (!Prototype.Browser.Opera || (element.tagName && (element.tagName.toUpperCase() == 'BODY'))) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (parent == document.body) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a 'break' statement before 'case'.
                                                                Open

                                                                        case 'height': case 'width':
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Case Statement Fallthrough (no-fallthrough)

                                                                The switch statement in JavaScript is one of the more error-prone constructs of the language thanks in part to the ability to "fall through" from one case to the next. For example:

                                                                switch(foo) {
                                                                    case 1:
                                                                        doSomething();
                                                                
                                                                    case 2:
                                                                        doSomethingElse();
                                                                }

                                                                In this example, if foo is 1, then execution will flow through both cases, as the first falls through to the second. You can prevent this by using break, as in this example:

                                                                switch(foo) {
                                                                    case 1:
                                                                        doSomething();
                                                                        break;
                                                                
                                                                    case 2:
                                                                        doSomethingElse();
                                                                }

                                                                That works fine when you don't want a fallthrough, but what if the fallthrough is intentional, there is no way to indicate that in the language. It's considered a best practice to always indicate when a fallthrough is intentional using a comment which matches the /falls?\s?through/i regular expression:

                                                                switch(foo) {
                                                                    case 1:
                                                                        doSomething();
                                                                        // falls through
                                                                
                                                                    case 2:
                                                                        doSomethingElse();
                                                                }
                                                                
                                                                switch(foo) {
                                                                    case 1:
                                                                        doSomething();
                                                                        // fall through
                                                                
                                                                    case 2:
                                                                        doSomethingElse();
                                                                }
                                                                
                                                                switch(foo) {
                                                                    case 1:
                                                                        doSomething();
                                                                        // fallsthrough
                                                                
                                                                    case 2:
                                                                        doSomethingElse();
                                                                }

                                                                In this example, there is no confusion as to the expected behavior. It is clear that the first case is meant to fall through to the second case.

                                                                Rule Details

                                                                This rule is aimed at eliminating unintentional fallthrough of one case to the other. As such, it flags any fallthrough scenarios that are not marked by a comment.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-fallthrough: "error"*/
                                                                
                                                                switch(foo) {
                                                                    case 1:
                                                                        doSomething();
                                                                
                                                                    case 2:
                                                                        doSomething();
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint no-fallthrough: "error"*/
                                                                
                                                                switch(foo) {
                                                                    case 1:
                                                                        doSomething();
                                                                        break;
                                                                
                                                                    case 2:
                                                                        doSomething();
                                                                }
                                                                
                                                                function bar(foo) {
                                                                    switch(foo) {
                                                                        case 1:
                                                                            doSomething();
                                                                            return;
                                                                
                                                                        case 2:
                                                                            doSomething();
                                                                    }
                                                                }
                                                                
                                                                switch(foo) {
                                                                    case 1:
                                                                        doSomething();
                                                                        throw new Error("Boo!");
                                                                
                                                                    case 2:
                                                                        doSomething();
                                                                }
                                                                
                                                                switch(foo) {
                                                                    case 1:
                                                                    case 2:
                                                                        doSomething();
                                                                }
                                                                
                                                                switch(foo) {
                                                                    case 1:
                                                                        doSomething();
                                                                        // falls through
                                                                
                                                                    case 2:
                                                                        doSomething();
                                                                }

                                                                Note that the last case statement in these examples does not cause a warning because there is nothing to fall through into.

                                                                Options

                                                                This rule accepts a single options argument:

                                                                • Set the commentPattern option to a regular expression string to change the test for intentional fallthrough comment

                                                                commentPattern

                                                                Examples of correct code for the { "commentPattern": "break[\\s\\w]*omitted" } option:

                                                                /*eslint no-fallthrough: ["error", { "commentPattern": "break[\\s\\w]*omitted" }]*/
                                                                
                                                                switch(foo) {
                                                                    case 1:
                                                                        doSomething();
                                                                        // break omitted
                                                                
                                                                    case 2:
                                                                        doSomething();
                                                                }
                                                                
                                                                switch(foo) {
                                                                    case 1:
                                                                        doSomething();
                                                                        // caution: break is omitted intentionally
                                                                
                                                                    default:
                                                                        doSomething();
                                                                }

                                                                When Not To Use It

                                                                If you don't want to enforce that each case statement should end with a throw, return, break, or comment, then you can safely turn this rule off.

                                                                Related Rules

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                      if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none'))
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      (!currentStyle && element.style.zoom == 'normal'))
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                        if (node.nodeType == 1) return node;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                          value.argumentNames().first() == "$super") {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
                                                                Open

                                                                    for (var property in object)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require Guarding for-in (guard-for-in)

                                                                Looping over objects with a for in loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.

                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Note that simply checking foo.hasOwnProperty(key) is likely to cause an error in some cases; see [no-prototype-builtins](no-prototype-builtins.md).

                                                                Rule Details

                                                                This rule is aimed at preventing unexpected behavior that could arise from using a for in loop without filtering the results in the loop. As such, it will warn when for in loops do not filter their results with an if statement.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    if (Object.prototype.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                    if ({}.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                }

                                                                Related Rules

                                                                • [no-prototype-builtins](no-prototype-builtins.md)

                                                                Further Reading

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    var camelized = this.charAt(0) == '-'
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Unexpected control character(s) in regular expression: \x00, \x1f, ].
                                                                Open

                                                                    var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow control characters in regular expressions (no-control-regex)

                                                                Control characters are special, invisible characters in the ASCII range 0-31. These characters are rarely used in JavaScript strings so a regular expression containing these characters is most likely a mistake.

                                                                Rule Details

                                                                This rule disallows control characters in regular expressions.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-control-regex: "error"*/
                                                                
                                                                var pattern1 = /\x1f/;
                                                                var pattern2 = new RegExp("\x1f");

                                                                Examples of correct code for this rule:

                                                                /*eslint no-control-regex: "error"*/
                                                                
                                                                var pattern1 = /\x20/;
                                                                var pattern2 = new RegExp("\x20");

                                                                When Not To Use It

                                                                If you need to use control character pattern matching, then you should turn this rule off.

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    return this == '';
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                        expr = expr.substring('[' == match[3] ? match[1].length : match[0].length);
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      if (result = !!iterator.call(context, value, index))
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected an assignment or function call and instead saw an expression.
                                                                Open

                                                                  i || (i = 0);
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Unused Expressions (no-unused-expressions)

                                                                An unused expression which has no effect on the state of the program indicates a logic error.

                                                                For example, n + 1; is not a syntax error, but it might be a typing mistake where a programmer meant an assignment statement n += 1; instead.

                                                                Rule Details

                                                                This rule aims to eliminate unused expressions which have no effect on the state of the program.

                                                                This rule does not apply to function calls or constructor calls with the new operator, because they could have side effects on the state of the program.

                                                                var i = 0;
                                                                function increment() { i += 1; }
                                                                increment(); // return value is unused, but i changed as a side effect
                                                                
                                                                var nThings = 0;
                                                                function Thing() { nThings += 1; }
                                                                new Thing(); // constructed object is unused, but nThings changed as a side effect

                                                                This rule does not apply to directives (which are in the form of literal string expressions such as "use strict"; at the beginning of a script, module, or function).

                                                                Sequence expressions (those using a comma, such as a = 1, b = 2) are always considered unused unless their return value is assigned or used in a condition evaluation, or a function call is made with the sequence expression value.

                                                                Options

                                                                This rule, in its default state, does not require any arguments. If you would like to enable one or more of the following you may pass an object with the options set as follows:

                                                                • allowShortCircuit set to true will allow you to use short circuit evaluations in your expressions (Default: false).
                                                                • allowTernary set to true will enable you to use ternary operators in your expressions similarly to short circuit evaluations (Default: false).
                                                                • allowTaggedTemplates set to true will enable you to use tagged template literals in your expressions (Default: false).

                                                                These options allow unused expressions only if all of the code paths either directly change the state (for example, assignment statement) or could have side effects (for example, function call).

                                                                Examples of incorrect code for the default { "allowShortCircuit": false, "allowTernary": false } options:

                                                                /*eslint no-unused-expressions: "error"*/
                                                                
                                                                0
                                                                
                                                                if(0) 0
                                                                
                                                                {0}
                                                                
                                                                f(0), {}
                                                                
                                                                a && b()
                                                                
                                                                a, b()
                                                                
                                                                c = a, b;
                                                                
                                                                a() && function namedFunctionInExpressionContext () {f();}
                                                                
                                                                (function anIncompleteIIFE () {});
                                                                
                                                                injectGlobal`body{ color: red; }`

                                                                Note that one or more string expression statements (with or without semi-colons) will only be considered as unused if they are not in the beginning of a script, module, or function (alone and uninterrupted by other statements). Otherwise, they will be treated as part of a "directive prologue", a section potentially usable by JavaScript engines. This includes "strict mode" directives.

                                                                "use strict";
                                                                "use asm"
                                                                "use stricter";
                                                                "use babel"
                                                                "any other strings like this in the prologue";

                                                                Examples of correct code for the default { "allowShortCircuit": false, "allowTernary": false } options:

                                                                /*eslint no-unused-expressions: "error"*/
                                                                
                                                                {} // In this context, this is a block statement, not an object literal
                                                                
                                                                {myLabel: someVar} // In this context, this is a block statement with a label and expression, not an object literal
                                                                
                                                                function namedFunctionDeclaration () {}
                                                                
                                                                (function aGenuineIIFE () {}());
                                                                
                                                                f()
                                                                
                                                                a = 0
                                                                
                                                                new C
                                                                
                                                                delete a.b
                                                                
                                                                void a

                                                                allowShortCircuit

                                                                Examples of incorrect code for the { "allowShortCircuit": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
                                                                
                                                                a || b

                                                                Examples of correct code for the { "allowShortCircuit": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
                                                                
                                                                a && b()
                                                                a() || (b = c)

                                                                allowTernary

                                                                Examples of incorrect code for the { "allowTernary": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
                                                                
                                                                a ? b : 0
                                                                a ? b : c()

                                                                Examples of correct code for the { "allowTernary": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
                                                                
                                                                a ? b() : c()
                                                                a ? (b = c) : d()

                                                                allowShortCircuit and allowTernary

                                                                Examples of correct code for the { "allowShortCircuit": true, "allowTernary": true } options:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true, "allowTernary": true }]*/
                                                                
                                                                a ? b() || (c = d) : e()

                                                                allowTaggedTemplates

                                                                Examples of incorrect code for the { "allowTaggedTemplates": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
                                                                
                                                                `some untagged template string`;

                                                                Examples of correct code for the { "allowTaggedTemplates": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
                                                                
                                                                tag`some tagged template string`;

                                                                Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (arguments.length == 1) return $(element.parentNode);
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Use ‘===’ to compare with ‘null’.
                                                                Open

                                                                    if (display != 'none' && display != null) // Safari bug
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Null Comparisons (no-eq-null)

                                                                Comparing to null without a type-checking operator (== or !=), can have unintended results as the comparison will evaluate to true when comparing to not just a null, but also an undefined value.

                                                                if (foo == null) {
                                                                  bar();
                                                                }

                                                                Rule Details

                                                                The no-eq-null rule aims reduce potential bug and unwanted behavior by ensuring that comparisons to null only match null, and not also undefined. As such it will flag comparisons to null when using == and !=.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo == null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux != null) {
                                                                  baz();
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo === null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux !== null) {
                                                                  baz();
                                                                }

                                                                Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (value == 1 || value === '') {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                        if (m = e.match(p)) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                    for (var i = 0, token; token = this.tokens[i]; i++) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (!nodes && root == document) return [targetNode];
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    return names.length == 1 && !names[0] ? [] : names;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Use ‘===’ to compare with ‘null’.
                                                                Open

                                                                    return value == null ? '' : String(value);
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Null Comparisons (no-eq-null)

                                                                Comparing to null without a type-checking operator (== or !=), can have unintended results as the comparison will evaluate to true when comparing to not just a null, but also an undefined value.

                                                                if (foo == null) {
                                                                  bar();
                                                                }

                                                                Rule Details

                                                                The no-eq-null rule aims reduce potential bug and unwanted behavior by ensuring that comparisons to null only match null, and not also undefined. As such it will flag comparisons to null when using == and !=.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo == null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux != null) {
                                                                  baz();
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo === null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux !== null) {
                                                                  baz();
                                                                }

                                                                Source: http://eslint.org/docs/rules/

                                                                Use ‘===’ to compare with ‘null’.
                                                                Open

                                                                      while (match != null) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Null Comparisons (no-eq-null)

                                                                Comparing to null without a type-checking operator (== or !=), can have unintended results as the comparison will evaluate to true when comparing to not just a null, but also an undefined value.

                                                                if (foo == null) {
                                                                  bar();
                                                                }

                                                                Rule Details

                                                                The no-eq-null rule aims reduce potential bug and unwanted behavior by ensuring that comparisons to null only match null, and not also undefined. As such it will flag comparisons to null when using == and !=.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo == null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux != null) {
                                                                  baz();
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo === null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux !== null) {
                                                                  baz();
                                                                }

                                                                Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                        if (null == ctx || '' == match[3]) break;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Array prototype is read only, properties should not be added.
                                                                Open

                                                                if (!Array.prototype._reverse) Array.prototype._reverse = Array.prototype.reverse;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Extending of Native Objects (no-extend-native)

                                                                In JavaScript, you can extend any object, including builtin or "native" objects. Sometimes people change the behavior of these native objects in ways that break the assumptions made about them in other parts of the code.

                                                                For example here we are overriding a builtin method that will then affect all Objects, even other builtins.

                                                                // seems harmless
                                                                Object.prototype.extra = 55;
                                                                
                                                                // loop through some userIds
                                                                var users = {
                                                                    "123": "Stan",
                                                                    "456": "David"
                                                                };
                                                                
                                                                // not what you'd expect
                                                                for (var id in users) {
                                                                    console.log(id); // "123", "456", "extra"
                                                                }

                                                                A common suggestion to avoid this problem would be to wrap the inside of the for loop with users.hasOwnProperty(id). However, if this rule is strictly enforced throughout your codebase you won't need to take that step.

                                                                Rule Details

                                                                Disallows directly modifying the prototype of builtin objects.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-extend-native: "error"*/
                                                                
                                                                Object.prototype.a = "a";
                                                                Object.defineProperty(Array.prototype, "times", { value: 999 });

                                                                Options

                                                                This rule accepts an exceptions option, which can be used to specify a list of builtins for which extensions will be allowed.

                                                                exceptions

                                                                Examples of correct code for the sample { "exceptions": ["Object"] } option:

                                                                /*eslint no-extend-native: ["error", { "exceptions": ["Object"] }]*/
                                                                
                                                                Object.prototype.a = "a";

                                                                Known Limitations

                                                                This rule does not report any of the following less obvious approaches to modify the prototype of builtin objects:

                                                                var x = Object;
                                                                x.prototype.thing = a;
                                                                
                                                                eval("Array.prototype.forEach = 'muhahaha'");
                                                                
                                                                with(Array) {
                                                                    prototype.thing = 'thing';
                                                                };
                                                                
                                                                window.Function.prototype.bind = 'tight';

                                                                When Not To Use It

                                                                You may want to disable this rule when working with polyfills that try to patch older versions of JavaScript with the latest spec, such as those that might Function.prototype.bind or Array.prototype.forEach in a future-friendly way.

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (result == null || value >= result)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Use ‘===’ to compare with ‘null’.
                                                                Open

                                                                      return value != null;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Null Comparisons (no-eq-null)

                                                                Comparing to null without a type-checking operator (== or !=), can have unintended results as the comparison will evaluate to true when comparing to not just a null, but also an undefined value.

                                                                if (foo == null) {
                                                                  bar();
                                                                }

                                                                Rule Details

                                                                The no-eq-null rule aims reduce potential bug and unwanted behavior by ensuring that comparisons to null only match null, and not also undefined. As such it will flag comparisons to null when using == and !=.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo == null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux != null) {
                                                                  baz();
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo === null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux !== null) {
                                                                  baz();
                                                                }

                                                                Source: http://eslint.org/docs/rules/

                                                                Array prototype is read only, properties should not be added.
                                                                Open

                                                                if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Extending of Native Objects (no-extend-native)

                                                                In JavaScript, you can extend any object, including builtin or "native" objects. Sometimes people change the behavior of these native objects in ways that break the assumptions made about them in other parts of the code.

                                                                For example here we are overriding a builtin method that will then affect all Objects, even other builtins.

                                                                // seems harmless
                                                                Object.prototype.extra = 55;
                                                                
                                                                // loop through some userIds
                                                                var users = {
                                                                    "123": "Stan",
                                                                    "456": "David"
                                                                };
                                                                
                                                                // not what you'd expect
                                                                for (var id in users) {
                                                                    console.log(id); // "123", "456", "extra"
                                                                }

                                                                A common suggestion to avoid this problem would be to wrap the inside of the for loop with users.hasOwnProperty(id). However, if this rule is strictly enforced throughout your codebase you won't need to take that step.

                                                                Rule Details

                                                                Disallows directly modifying the prototype of builtin objects.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-extend-native: "error"*/
                                                                
                                                                Object.prototype.a = "a";
                                                                Object.defineProperty(Array.prototype, "times", { value: 999 });

                                                                Options

                                                                This rule accepts an exceptions option, which can be used to specify a list of builtins for which extensions will be allowed.

                                                                exceptions

                                                                Examples of correct code for the sample { "exceptions": ["Object"] } option:

                                                                /*eslint no-extend-native: ["error", { "exceptions": ["Object"] }]*/
                                                                
                                                                Object.prototype.a = "a";

                                                                Known Limitations

                                                                This rule does not report any of the following less obvious approaches to modify the prototype of builtin objects:

                                                                var x = Object;
                                                                x.prototype.thing = a;
                                                                
                                                                eval("Array.prototype.forEach = 'muhahaha'");
                                                                
                                                                with(Array) {
                                                                    prototype.thing = 'thing';
                                                                };
                                                                
                                                                window.Function.prototype.bind = 'tight';

                                                                When Not To Use It

                                                                You may want to disable this rule when working with polyfills that try to patch older versions of JavaScript with the latest spec, such as those that might Function.prototype.bind or Array.prototype.forEach in a future-friendly way.

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element));
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Array prototype is read only, properties should not be added.
                                                                Open

                                                                Array.prototype.toArray = Array.prototype.clone;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Extending of Native Objects (no-extend-native)

                                                                In JavaScript, you can extend any object, including builtin or "native" objects. Sometimes people change the behavior of these native objects in ways that break the assumptions made about them in other parts of the code.

                                                                For example here we are overriding a builtin method that will then affect all Objects, even other builtins.

                                                                // seems harmless
                                                                Object.prototype.extra = 55;
                                                                
                                                                // loop through some userIds
                                                                var users = {
                                                                    "123": "Stan",
                                                                    "456": "David"
                                                                };
                                                                
                                                                // not what you'd expect
                                                                for (var id in users) {
                                                                    console.log(id); // "123", "456", "extra"
                                                                }

                                                                A common suggestion to avoid this problem would be to wrap the inside of the for loop with users.hasOwnProperty(id). However, if this rule is strictly enforced throughout your codebase you won't need to take that step.

                                                                Rule Details

                                                                Disallows directly modifying the prototype of builtin objects.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-extend-native: "error"*/
                                                                
                                                                Object.prototype.a = "a";
                                                                Object.defineProperty(Array.prototype, "times", { value: 999 });

                                                                Options

                                                                This rule accepts an exceptions option, which can be used to specify a list of builtins for which extensions will be allowed.

                                                                exceptions

                                                                Examples of correct code for the sample { "exceptions": ["Object"] } option:

                                                                /*eslint no-extend-native: ["error", { "exceptions": ["Object"] }]*/
                                                                
                                                                Object.prototype.a = "a";

                                                                Known Limitations

                                                                This rule does not report any of the following less obvious approaches to modify the prototype of builtin objects:

                                                                var x = Object;
                                                                x.prototype.thing = a;
                                                                
                                                                eval("Array.prototype.forEach = 'muhahaha'");
                                                                
                                                                with(Array) {
                                                                    prototype.thing = 'thing';
                                                                };
                                                                
                                                                window.Function.prototype.bind = 'tight';

                                                                When Not To Use It

                                                                You may want to disable this rule when working with polyfills that try to patch older versions of JavaScript with the latest spec, such as those that might Function.prototype.bind or Array.prototype.forEach in a future-friendly way.

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (element == document.body) return $(element);
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none'))
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Unnecessary semicolon.
                                                                Open

                                                                };
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow unnecessary semicolons (no-extra-semi)

                                                                Typing mistakes and misunderstandings about where semicolons are required can lead to semicolons that are unnecessary. While not technically an error, extra semicolons can cause confusion when reading code.

                                                                Rule Details

                                                                This rule disallows unnecessary semicolons.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-extra-semi: "error"*/
                                                                
                                                                var x = 5;;
                                                                
                                                                function foo() {
                                                                    // code
                                                                };

                                                                Examples of correct code for this rule:

                                                                /*eslint no-extra-semi: "error"*/
                                                                
                                                                var x = 5;
                                                                
                                                                var foo = function() {
                                                                    // code
                                                                };

                                                                When Not To Use It

                                                                If you intentionally use extra semicolons then you can disable this rule.

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                        if (node.nodeType == 1) return node;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
                                                                Open

                                                                    for (var name in headers)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require Guarding for-in (guard-for-in)

                                                                Looping over objects with a for in loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.

                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Note that simply checking foo.hasOwnProperty(key) is likely to cause an error in some cases; see [no-prototype-builtins](no-prototype-builtins.md).

                                                                Rule Details

                                                                This rule is aimed at preventing unexpected behavior that could arise from using a for in loop without filtering the results in the loop. As such, it will warn when for in loops do not filter their results with an if statement.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    if (Object.prototype.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                    if ({}.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                }

                                                                Related Rules

                                                                • [no-prototype-builtins](no-prototype-builtins.md)

                                                                Further Reading

                                                                'i' is already defined.
                                                                Open

                                                                            for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow variable redeclaration (no-redeclare)

                                                                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                                                                Rule Details

                                                                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                var a = 10;

                                                                Examples of correct code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                // ...
                                                                a = 10;

                                                                Options

                                                                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                                                                builtinGlobals

                                                                Examples of incorrect code for the { "builtinGlobals": true } option:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                
                                                                var Object = 0;

                                                                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                /*eslint-env browser*/
                                                                
                                                                var top = 0;

                                                                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if(readyState == 4) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (typeof name == 'object') attributes = name;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected an assignment or function call and instead saw an expression.
                                                                Open

                                                                    element = $(element), ancestor = $(ancestor);
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Unused Expressions (no-unused-expressions)

                                                                An unused expression which has no effect on the state of the program indicates a logic error.

                                                                For example, n + 1; is not a syntax error, but it might be a typing mistake where a programmer meant an assignment statement n += 1; instead.

                                                                Rule Details

                                                                This rule aims to eliminate unused expressions which have no effect on the state of the program.

                                                                This rule does not apply to function calls or constructor calls with the new operator, because they could have side effects on the state of the program.

                                                                var i = 0;
                                                                function increment() { i += 1; }
                                                                increment(); // return value is unused, but i changed as a side effect
                                                                
                                                                var nThings = 0;
                                                                function Thing() { nThings += 1; }
                                                                new Thing(); // constructed object is unused, but nThings changed as a side effect

                                                                This rule does not apply to directives (which are in the form of literal string expressions such as "use strict"; at the beginning of a script, module, or function).

                                                                Sequence expressions (those using a comma, such as a = 1, b = 2) are always considered unused unless their return value is assigned or used in a condition evaluation, or a function call is made with the sequence expression value.

                                                                Options

                                                                This rule, in its default state, does not require any arguments. If you would like to enable one or more of the following you may pass an object with the options set as follows:

                                                                • allowShortCircuit set to true will allow you to use short circuit evaluations in your expressions (Default: false).
                                                                • allowTernary set to true will enable you to use ternary operators in your expressions similarly to short circuit evaluations (Default: false).
                                                                • allowTaggedTemplates set to true will enable you to use tagged template literals in your expressions (Default: false).

                                                                These options allow unused expressions only if all of the code paths either directly change the state (for example, assignment statement) or could have side effects (for example, function call).

                                                                Examples of incorrect code for the default { "allowShortCircuit": false, "allowTernary": false } options:

                                                                /*eslint no-unused-expressions: "error"*/
                                                                
                                                                0
                                                                
                                                                if(0) 0
                                                                
                                                                {0}
                                                                
                                                                f(0), {}
                                                                
                                                                a && b()
                                                                
                                                                a, b()
                                                                
                                                                c = a, b;
                                                                
                                                                a() && function namedFunctionInExpressionContext () {f();}
                                                                
                                                                (function anIncompleteIIFE () {});
                                                                
                                                                injectGlobal`body{ color: red; }`

                                                                Note that one or more string expression statements (with or without semi-colons) will only be considered as unused if they are not in the beginning of a script, module, or function (alone and uninterrupted by other statements). Otherwise, they will be treated as part of a "directive prologue", a section potentially usable by JavaScript engines. This includes "strict mode" directives.

                                                                "use strict";
                                                                "use asm"
                                                                "use stricter";
                                                                "use babel"
                                                                "any other strings like this in the prologue";

                                                                Examples of correct code for the default { "allowShortCircuit": false, "allowTernary": false } options:

                                                                /*eslint no-unused-expressions: "error"*/
                                                                
                                                                {} // In this context, this is a block statement, not an object literal
                                                                
                                                                {myLabel: someVar} // In this context, this is a block statement with a label and expression, not an object literal
                                                                
                                                                function namedFunctionDeclaration () {}
                                                                
                                                                (function aGenuineIIFE () {}());
                                                                
                                                                f()
                                                                
                                                                a = 0
                                                                
                                                                new C
                                                                
                                                                delete a.b
                                                                
                                                                void a

                                                                allowShortCircuit

                                                                Examples of incorrect code for the { "allowShortCircuit": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
                                                                
                                                                a || b

                                                                Examples of correct code for the { "allowShortCircuit": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
                                                                
                                                                a && b()
                                                                a() || (b = c)

                                                                allowTernary

                                                                Examples of incorrect code for the { "allowTernary": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
                                                                
                                                                a ? b : 0
                                                                a ? b : c()

                                                                Examples of correct code for the { "allowTernary": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
                                                                
                                                                a ? b() : c()
                                                                a ? (b = c) : d()

                                                                allowShortCircuit and allowTernary

                                                                Examples of correct code for the { "allowShortCircuit": true, "allowTernary": true } options:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true, "allowTernary": true }]*/
                                                                
                                                                a ? b() || (c = d) : e()

                                                                allowTaggedTemplates

                                                                Examples of incorrect code for the { "allowTaggedTemplates": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
                                                                
                                                                `some untagged template string`;

                                                                Examples of correct code for the { "allowTaggedTemplates": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
                                                                
                                                                tag`some tagged template string`;

                                                                Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    element.style.opacity = (value == 1 || value === '') ? '' :
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                    if (display != 'none' && display != null) // Safari bug
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (object == null) return '';
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                        Element.getStyle(element, 'position') == 'absolute') break;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (value == object) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected an assignment or function call and instead saw an expression.
                                                                Open

                                                                      (filter = stripAlpha(filter)) ?
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Unused Expressions (no-unused-expressions)

                                                                An unused expression which has no effect on the state of the program indicates a logic error.

                                                                For example, n + 1; is not a syntax error, but it might be a typing mistake where a programmer meant an assignment statement n += 1; instead.

                                                                Rule Details

                                                                This rule aims to eliminate unused expressions which have no effect on the state of the program.

                                                                This rule does not apply to function calls or constructor calls with the new operator, because they could have side effects on the state of the program.

                                                                var i = 0;
                                                                function increment() { i += 1; }
                                                                increment(); // return value is unused, but i changed as a side effect
                                                                
                                                                var nThings = 0;
                                                                function Thing() { nThings += 1; }
                                                                new Thing(); // constructed object is unused, but nThings changed as a side effect

                                                                This rule does not apply to directives (which are in the form of literal string expressions such as "use strict"; at the beginning of a script, module, or function).

                                                                Sequence expressions (those using a comma, such as a = 1, b = 2) are always considered unused unless their return value is assigned or used in a condition evaluation, or a function call is made with the sequence expression value.

                                                                Options

                                                                This rule, in its default state, does not require any arguments. If you would like to enable one or more of the following you may pass an object with the options set as follows:

                                                                • allowShortCircuit set to true will allow you to use short circuit evaluations in your expressions (Default: false).
                                                                • allowTernary set to true will enable you to use ternary operators in your expressions similarly to short circuit evaluations (Default: false).
                                                                • allowTaggedTemplates set to true will enable you to use tagged template literals in your expressions (Default: false).

                                                                These options allow unused expressions only if all of the code paths either directly change the state (for example, assignment statement) or could have side effects (for example, function call).

                                                                Examples of incorrect code for the default { "allowShortCircuit": false, "allowTernary": false } options:

                                                                /*eslint no-unused-expressions: "error"*/
                                                                
                                                                0
                                                                
                                                                if(0) 0
                                                                
                                                                {0}
                                                                
                                                                f(0), {}
                                                                
                                                                a && b()
                                                                
                                                                a, b()
                                                                
                                                                c = a, b;
                                                                
                                                                a() && function namedFunctionInExpressionContext () {f();}
                                                                
                                                                (function anIncompleteIIFE () {});
                                                                
                                                                injectGlobal`body{ color: red; }`

                                                                Note that one or more string expression statements (with or without semi-colons) will only be considered as unused if they are not in the beginning of a script, module, or function (alone and uninterrupted by other statements). Otherwise, they will be treated as part of a "directive prologue", a section potentially usable by JavaScript engines. This includes "strict mode" directives.

                                                                "use strict";
                                                                "use asm"
                                                                "use stricter";
                                                                "use babel"
                                                                "any other strings like this in the prologue";

                                                                Examples of correct code for the default { "allowShortCircuit": false, "allowTernary": false } options:

                                                                /*eslint no-unused-expressions: "error"*/
                                                                
                                                                {} // In this context, this is a block statement, not an object literal
                                                                
                                                                {myLabel: someVar} // In this context, this is a block statement with a label and expression, not an object literal
                                                                
                                                                function namedFunctionDeclaration () {}
                                                                
                                                                (function aGenuineIIFE () {}());
                                                                
                                                                f()
                                                                
                                                                a = 0
                                                                
                                                                new C
                                                                
                                                                delete a.b
                                                                
                                                                void a

                                                                allowShortCircuit

                                                                Examples of incorrect code for the { "allowShortCircuit": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
                                                                
                                                                a || b

                                                                Examples of correct code for the { "allowShortCircuit": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
                                                                
                                                                a && b()
                                                                a() || (b = c)

                                                                allowTernary

                                                                Examples of incorrect code for the { "allowTernary": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
                                                                
                                                                a ? b : 0
                                                                a ? b : c()

                                                                Examples of correct code for the { "allowTernary": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
                                                                
                                                                a ? b() : c()
                                                                a ? (b = c) : d()

                                                                allowShortCircuit and allowTernary

                                                                Examples of correct code for the { "allowShortCircuit": true, "allowTernary": true } options:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true, "allowTernary": true }]*/
                                                                
                                                                a ? b() || (c = d) : e()

                                                                allowTaggedTemplates

                                                                Examples of incorrect code for the { "allowTaggedTemplates": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
                                                                
                                                                `some untagged template string`;

                                                                Examples of correct code for the { "allowTaggedTemplates": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
                                                                
                                                                tag`some tagged template string`;

                                                                Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                    while (element && element.nodeType != 1) element = element.nextSibling;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                    while (e && le != e && (/\S/).test(e)) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (element == ancestor) return true;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      for (var i = 0, results = [], node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (element.offsetParent == document.body &&
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                            for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                        if (formula == 'even') formula = '2n+0';
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                        if (formula == 'odd')  formula = '2n+1';
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      for (var i = 0, results = [], node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                          if (child.nodeType == 1 && child.tagName != '!') results.push(child);
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                        for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                      if (e != $break) throw e;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (0 == index || (sorted ? array.last() != value : !array.include(value)))
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (state == 'Complete') {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                    if (!options.evalJSON || (options.evalJSON != 'force' &&
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    style = style == 'float' ? 'cssFloat' : style.camelize();
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                        element.nodeType != 1 || element == window) return element;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                        while (e && le != e && (/\S/).test(e)) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                        if (mm = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      while (node = node.previousSibling)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                              if (targetNode.parentNode == node) return [targetNode];
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                            for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Empty block statement.
                                                                Open

                                                                      } catch (e) { }
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow empty block statements (no-empty)

                                                                Empty block statements, while not technically errors, usually occur due to refactoring that wasn't completed. They can cause confusion when reading code.

                                                                Rule Details

                                                                This rule disallows empty block statements. This rule ignores block statements which contain a comment (for example, in an empty catch or finally block of a try statement to indicate that execution should continue regardless of errors).

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-empty: "error"*/
                                                                
                                                                if (foo) {
                                                                }
                                                                
                                                                while (foo) {
                                                                }
                                                                
                                                                switch(foo) {
                                                                }
                                                                
                                                                try {
                                                                    doSomething();
                                                                } catch(ex) {
                                                                
                                                                } finally {
                                                                
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint no-empty: "error"*/
                                                                
                                                                if (foo) {
                                                                    // empty
                                                                }
                                                                
                                                                while (foo) {
                                                                    /* empty */
                                                                }
                                                                
                                                                try {
                                                                    doSomething();
                                                                } catch (ex) {
                                                                    // continue regardless of error
                                                                }
                                                                
                                                                try {
                                                                    doSomething();
                                                                } finally {
                                                                    /* continue regardless of error */
                                                                }

                                                                Options

                                                                This rule has an object option for exceptions:

                                                                • "allowEmptyCatch": true allows empty catch clauses (that is, which do not contain a comment)

                                                                allowEmptyCatch

                                                                Examples of additional correct code for this rule with the { "allowEmptyCatch": true } option:

                                                                /* eslint no-empty: ["error", { "allowEmptyCatch": true }] */
                                                                try {
                                                                    doSomething();
                                                                } catch (ex) {}
                                                                
                                                                try {
                                                                    doSomething();
                                                                }
                                                                catch (ex) {}
                                                                finally {
                                                                    /* continue regardless of error */
                                                                }

                                                                When Not To Use It

                                                                If you intentionally use empty block statements then you can disable this rule.

                                                                Related Rules

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                      return value != null;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Empty block statement.
                                                                Open

                                                                        } catch (e) { }
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow empty block statements (no-empty)

                                                                Empty block statements, while not technically errors, usually occur due to refactoring that wasn't completed. They can cause confusion when reading code.

                                                                Rule Details

                                                                This rule disallows empty block statements. This rule ignores block statements which contain a comment (for example, in an empty catch or finally block of a try statement to indicate that execution should continue regardless of errors).

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-empty: "error"*/
                                                                
                                                                if (foo) {
                                                                }
                                                                
                                                                while (foo) {
                                                                }
                                                                
                                                                switch(foo) {
                                                                }
                                                                
                                                                try {
                                                                    doSomething();
                                                                } catch(ex) {
                                                                
                                                                } finally {
                                                                
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint no-empty: "error"*/
                                                                
                                                                if (foo) {
                                                                    // empty
                                                                }
                                                                
                                                                while (foo) {
                                                                    /* empty */
                                                                }
                                                                
                                                                try {
                                                                    doSomething();
                                                                } catch (ex) {
                                                                    // continue regardless of error
                                                                }
                                                                
                                                                try {
                                                                    doSomething();
                                                                } finally {
                                                                    /* continue regardless of error */
                                                                }

                                                                Options

                                                                This rule has an object option for exceptions:

                                                                • "allowEmptyCatch": true allows empty catch clauses (that is, which do not contain a comment)

                                                                allowEmptyCatch

                                                                Examples of additional correct code for this rule with the { "allowEmptyCatch": true } option:

                                                                /* eslint no-empty: ["error", { "allowEmptyCatch": true }] */
                                                                try {
                                                                    doSomething();
                                                                } catch (ex) {}
                                                                
                                                                try {
                                                                    doSomething();
                                                                }
                                                                catch (ex) {}
                                                                finally {
                                                                    /* continue regardless of error */
                                                                }

                                                                When Not To Use It

                                                                If you intentionally use empty block statements then you can disable this rule.

                                                                Related Rules

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                    if (params = Object.toQueryString(params)) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                    while (element = element.parentNode)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                        elementStyle[(property == 'float' || property == 'cssFloat') ?
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/))
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                          if (mm[1] == "-") mm[1] = -1;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                'nodes' is already defined.
                                                                Open

                                                                        for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow variable redeclaration (no-redeclare)

                                                                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                                                                Rule Details

                                                                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                var a = 10;

                                                                Examples of correct code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                // ...
                                                                a = 10;

                                                                Options

                                                                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                                                                builtinGlobals

                                                                Examples of incorrect code for the { "builtinGlobals": true } option:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                
                                                                var Object = 0;

                                                                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                /*eslint-env browser*/
                                                                
                                                                var top = 0;

                                                                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                                                                'node' is already defined.
                                                                Open

                                                                            for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow variable redeclaration (no-redeclare)

                                                                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                                                                Rule Details

                                                                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                var a = 10;

                                                                Examples of correct code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                // ...
                                                                a = 10;

                                                                Options

                                                                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                                                                builtinGlobals

                                                                Examples of incorrect code for the { "builtinGlobals": true } option:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                
                                                                var Object = 0;

                                                                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                /*eslint-env browser*/
                                                                
                                                                var top = 0;

                                                                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                                                                'node' is already defined.
                                                                Open

                                                                            for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow variable redeclaration (no-redeclare)

                                                                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                                                                Rule Details

                                                                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                var a = 10;

                                                                Examples of correct code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                // ...
                                                                a = 10;

                                                                Options

                                                                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                                                                builtinGlobals

                                                                Examples of incorrect code for the { "builtinGlobals": true } option:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                
                                                                var Object = 0;

                                                                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                /*eslint-env browser*/
                                                                
                                                                var top = 0;

                                                                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    return typeof object == "function";
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Use ‘===’ to compare with ‘null’.
                                                                Open

                                                                      if (result == null || value < result)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Null Comparisons (no-eq-null)

                                                                Comparing to null without a type-checking operator (== or !=), can have unintended results as the comparison will evaluate to true when comparing to not just a null, but also an undefined value.

                                                                if (foo == null) {
                                                                  bar();
                                                                }

                                                                Rule Details

                                                                The no-eq-null rule aims reduce potential bug and unwanted behavior by ensuring that comparisons to null only match null, and not also undefined. As such it will flag comparisons to null when using == and !=.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo == null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux != null) {
                                                                  baz();
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo === null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux !== null) {
                                                                  baz();
                                                                }

                                                                Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (readyState > 1 && !((readyState == 4) && this._complete))
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                    while (element = element[property])
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                    if (display != 'none' && display != null) // Safari bug
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    element.style.opacity = (value == 1 || value === '') ? '' :
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
                                                                Open

                                                                    for (property in methods) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require Guarding for-in (guard-for-in)

                                                                Looping over objects with a for in loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.

                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Note that simply checking foo.hasOwnProperty(key) is likely to cause an error in some cases; see [no-prototype-builtins](no-prototype-builtins.md).

                                                                Rule Details

                                                                This rule is aimed at preventing unexpected behavior that could arise from using a for in loop without filtering the results in the loop. As such, it will warn when for in loops do not filter their results with an if statement.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    if (Object.prototype.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                    if ({}.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                }

                                                                Related Rules

                                                                • [no-prototype-builtins](no-prototype-builtins.md)

                                                                Further Reading

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                          if (child.nodeType == 1 && child.tagName != '!') results.push(child);
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    return object != null && typeof object == "object" &&
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                        if (value != undefined) value = decodeURIComponent(value);
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Use ‘===’ to compare with ‘null’.
                                                                Open

                                                                        if (null == ctx || '' == match[3]) break;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Null Comparisons (no-eq-null)

                                                                Comparing to null without a type-checking operator (== or !=), can have unintended results as the comparison will evaluate to true when comparing to not just a null, but also an undefined value.

                                                                if (foo == null) {
                                                                  bar();
                                                                }

                                                                Rule Details

                                                                The no-eq-null rule aims reduce potential bug and unwanted behavior by ensuring that comparisons to null only match null, and not also undefined. As such it will flag comparisons to null when using == and !=.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo == null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux != null) {
                                                                  baz();
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo === null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux !== null) {
                                                                  baz();
                                                                }

                                                                Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      if (match = source.match(pattern)) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Array prototype is read only, properties should not be added.
                                                                Open

                                                                  Array.prototype._each = Array.prototype.forEach;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Extending of Native Objects (no-extend-native)

                                                                In JavaScript, you can extend any object, including builtin or "native" objects. Sometimes people change the behavior of these native objects in ways that break the assumptions made about them in other parts of the code.

                                                                For example here we are overriding a builtin method that will then affect all Objects, even other builtins.

                                                                // seems harmless
                                                                Object.prototype.extra = 55;
                                                                
                                                                // loop through some userIds
                                                                var users = {
                                                                    "123": "Stan",
                                                                    "456": "David"
                                                                };
                                                                
                                                                // not what you'd expect
                                                                for (var id in users) {
                                                                    console.log(id); // "123", "456", "extra"
                                                                }

                                                                A common suggestion to avoid this problem would be to wrap the inside of the for loop with users.hasOwnProperty(id). However, if this rule is strictly enforced throughout your codebase you won't need to take that step.

                                                                Rule Details

                                                                Disallows directly modifying the prototype of builtin objects.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-extend-native: "error"*/
                                                                
                                                                Object.prototype.a = "a";
                                                                Object.defineProperty(Array.prototype, "times", { value: 999 });

                                                                Options

                                                                This rule accepts an exceptions option, which can be used to specify a list of builtins for which extensions will be allowed.

                                                                exceptions

                                                                Examples of correct code for the sample { "exceptions": ["Object"] } option:

                                                                /*eslint no-extend-native: ["error", { "exceptions": ["Object"] }]*/
                                                                
                                                                Object.prototype.a = "a";

                                                                Known Limitations

                                                                This rule does not report any of the following less obvious approaches to modify the prototype of builtin objects:

                                                                var x = Object;
                                                                x.prototype.thing = a;
                                                                
                                                                eval("Array.prototype.forEach = 'muhahaha'");
                                                                
                                                                with(Array) {
                                                                    prototype.thing = 'thing';
                                                                };
                                                                
                                                                window.Function.prototype.bind = 'tight';

                                                                When Not To Use It

                                                                You may want to disable this rule when working with polyfills that try to patch older versions of JavaScript with the latest spec, such as those that might Function.prototype.bind or Array.prototype.forEach in a future-friendly way.

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (len == 1) return parts[0];
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Number prototype is read only, properties should not be added.
                                                                Open

                                                                  Number.prototype[method] = Math[method].methodize();
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Extending of Native Objects (no-extend-native)

                                                                In JavaScript, you can extend any object, including builtin or "native" objects. Sometimes people change the behavior of these native objects in ways that break the assumptions made about them in other parts of the code.

                                                                For example here we are overriding a builtin method that will then affect all Objects, even other builtins.

                                                                // seems harmless
                                                                Object.prototype.extra = 55;
                                                                
                                                                // loop through some userIds
                                                                var users = {
                                                                    "123": "Stan",
                                                                    "456": "David"
                                                                };
                                                                
                                                                // not what you'd expect
                                                                for (var id in users) {
                                                                    console.log(id); // "123", "456", "extra"
                                                                }

                                                                A common suggestion to avoid this problem would be to wrap the inside of the for loop with users.hasOwnProperty(id). However, if this rule is strictly enforced throughout your codebase you won't need to take that step.

                                                                Rule Details

                                                                Disallows directly modifying the prototype of builtin objects.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-extend-native: "error"*/
                                                                
                                                                Object.prototype.a = "a";
                                                                Object.defineProperty(Array.prototype, "times", { value: 999 });

                                                                Options

                                                                This rule accepts an exceptions option, which can be used to specify a list of builtins for which extensions will be allowed.

                                                                exceptions

                                                                Examples of correct code for the sample { "exceptions": ["Object"] } option:

                                                                /*eslint no-extend-native: ["error", { "exceptions": ["Object"] }]*/
                                                                
                                                                Object.prototype.a = "a";

                                                                Known Limitations

                                                                This rule does not report any of the following less obvious approaches to modify the prototype of builtin objects:

                                                                var x = Object;
                                                                x.prototype.thing = a;
                                                                
                                                                eval("Array.prototype.forEach = 'muhahaha'");
                                                                
                                                                with(Array) {
                                                                    prototype.thing = 'thing';
                                                                };
                                                                
                                                                window.Function.prototype.bind = 'tight';

                                                                When Not To Use It

                                                                You may want to disable this rule when working with polyfills that try to patch older versions of JavaScript with the latest spec, such as those that might Function.prototype.bind or Array.prototype.forEach in a future-friendly way.

                                                                Related Rules

                                                                'length' is already defined.
                                                                Open

                                                                    for (var i = 0, length = arguments.length; i < length; i++) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow variable redeclaration (no-redeclare)

                                                                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                                                                Rule Details

                                                                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                var a = 10;

                                                                Examples of correct code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                // ...
                                                                a = 10;

                                                                Options

                                                                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                                                                builtinGlobals

                                                                Examples of incorrect code for the { "builtinGlobals": true } option:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                
                                                                var Object = 0;

                                                                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                /*eslint-env browser*/
                                                                
                                                                var top = 0;

                                                                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      this.decay = (response.responseText == this.lastText ?
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    return (elementClassName.length > 0 && (elementClassName == className ||
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (pos == 'static' || !pos) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      tagName = ((position == 'before' || position == 'after')
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    return !!(object && object.nodeType == 1);
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (Element.getStyle(element, 'position') == 'absolute') {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (!value || value == 'auto') {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (style == 'opacity') return value ? parseFloat(value) : 1.0;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                    while (e && le != e && (/\S/).test(e)) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    return value == 'auto' ? null : value;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Use ‘===’ to compare with ‘null’.
                                                                Open

                                                                    return object != null && typeof object == "object" &&
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Null Comparisons (no-eq-null)

                                                                Comparing to null without a type-checking operator (== or !=), can have unintended results as the comparison will evaluate to true when comparing to not just a null, but also an undefined value.

                                                                if (foo == null) {
                                                                  bar();
                                                                }

                                                                Rule Details

                                                                The no-eq-null rule aims reduce potential bug and unwanted behavior by ensuring that comparisons to null only match null, and not also undefined. As such it will flag comparisons to null when using == and !=.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo == null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux != null) {
                                                                  baz();
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo === null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux !== null) {
                                                                  baz();
                                                                }

                                                                Source: http://eslint.org/docs/rules/

                                                                Date prototype is read only, properties should not be added.
                                                                Open

                                                                Date.prototype.toJSON = function() {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Extending of Native Objects (no-extend-native)

                                                                In JavaScript, you can extend any object, including builtin or "native" objects. Sometimes people change the behavior of these native objects in ways that break the assumptions made about them in other parts of the code.

                                                                For example here we are overriding a builtin method that will then affect all Objects, even other builtins.

                                                                // seems harmless
                                                                Object.prototype.extra = 55;
                                                                
                                                                // loop through some userIds
                                                                var users = {
                                                                    "123": "Stan",
                                                                    "456": "David"
                                                                };
                                                                
                                                                // not what you'd expect
                                                                for (var id in users) {
                                                                    console.log(id); // "123", "456", "extra"
                                                                }

                                                                A common suggestion to avoid this problem would be to wrap the inside of the for loop with users.hasOwnProperty(id). However, if this rule is strictly enforced throughout your codebase you won't need to take that step.

                                                                Rule Details

                                                                Disallows directly modifying the prototype of builtin objects.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-extend-native: "error"*/
                                                                
                                                                Object.prototype.a = "a";
                                                                Object.defineProperty(Array.prototype, "times", { value: 999 });

                                                                Options

                                                                This rule accepts an exceptions option, which can be used to specify a list of builtins for which extensions will be allowed.

                                                                exceptions

                                                                Examples of correct code for the sample { "exceptions": ["Object"] } option:

                                                                /*eslint no-extend-native: ["error", { "exceptions": ["Object"] }]*/
                                                                
                                                                Object.prototype.a = "a";

                                                                Known Limitations

                                                                This rule does not report any of the following less obvious approaches to modify the prototype of builtin objects:

                                                                var x = Object;
                                                                x.prototype.thing = a;
                                                                
                                                                eval("Array.prototype.forEach = 'muhahaha'");
                                                                
                                                                with(Array) {
                                                                    prototype.thing = 'thing';
                                                                };
                                                                
                                                                window.Function.prototype.bind = 'tight';

                                                                When Not To Use It

                                                                You may want to disable this rule when working with polyfills that try to patch older versions of JavaScript with the latest spec, such as those that might Function.prototype.bind or Array.prototype.forEach in a future-friendly way.

                                                                Related Rules

                                                                The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
                                                                Open

                                                                      for (var i in ps) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require Guarding for-in (guard-for-in)

                                                                Looping over objects with a for in loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.

                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Note that simply checking foo.hasOwnProperty(key) is likely to cause an error in some cases; see [no-prototype-builtins](no-prototype-builtins.md).

                                                                Rule Details

                                                                This rule is aimed at preventing unexpected behavior that could arise from using a for in loop without filtering the results in the loop. As such, it will warn when for in loops do not filter their results with an if statement.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    if (Object.prototype.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                    if ({}.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                }

                                                                Related Rules

                                                                • [no-prototype-builtins](no-prototype-builtins.md)

                                                                Further Reading

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                      if (Element.getStyle(element, 'position') != 'static')
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                RegExp prototype is read only, properties should not be added.
                                                                Open

                                                                RegExp.prototype.match = RegExp.prototype.test;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Extending of Native Objects (no-extend-native)

                                                                In JavaScript, you can extend any object, including builtin or "native" objects. Sometimes people change the behavior of these native objects in ways that break the assumptions made about them in other parts of the code.

                                                                For example here we are overriding a builtin method that will then affect all Objects, even other builtins.

                                                                // seems harmless
                                                                Object.prototype.extra = 55;
                                                                
                                                                // loop through some userIds
                                                                var users = {
                                                                    "123": "Stan",
                                                                    "456": "David"
                                                                };
                                                                
                                                                // not what you'd expect
                                                                for (var id in users) {
                                                                    console.log(id); // "123", "456", "extra"
                                                                }

                                                                A common suggestion to avoid this problem would be to wrap the inside of the for loop with users.hasOwnProperty(id). However, if this rule is strictly enforced throughout your codebase you won't need to take that step.

                                                                Rule Details

                                                                Disallows directly modifying the prototype of builtin objects.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-extend-native: "error"*/
                                                                
                                                                Object.prototype.a = "a";
                                                                Object.defineProperty(Array.prototype, "times", { value: 999 });

                                                                Options

                                                                This rule accepts an exceptions option, which can be used to specify a list of builtins for which extensions will be allowed.

                                                                exceptions

                                                                Examples of correct code for the sample { "exceptions": ["Object"] } option:

                                                                /*eslint no-extend-native: ["error", { "exceptions": ["Object"] }]*/
                                                                
                                                                Object.prototype.a = "a";

                                                                Known Limitations

                                                                This rule does not report any of the following less obvious approaches to modify the prototype of builtin objects:

                                                                var x = Object;
                                                                x.prototype.thing = a;
                                                                
                                                                eval("Array.prototype.forEach = 'muhahaha'");
                                                                
                                                                with(Array) {
                                                                    prototype.thing = 'thing';
                                                                };
                                                                
                                                                window.Function.prototype.bind = 'tight';

                                                                When Not To Use It

                                                                You may want to disable this rule when working with polyfills that try to patch older versions of JavaScript with the latest spec, such as those that might Function.prototype.bind or Array.prototype.forEach in a future-friendly way.

                                                                Related Rules

                                                                'i' is already defined.
                                                                Open

                                                                        for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow variable redeclaration (no-redeclare)

                                                                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                                                                Rule Details

                                                                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                var a = 10;

                                                                Examples of correct code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                // ...
                                                                a = 10;

                                                                Options

                                                                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                                                                builtinGlobals

                                                                Examples of incorrect code for the { "builtinGlobals": true } option:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                
                                                                var Object = 0;

                                                                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                /*eslint-env browser*/
                                                                
                                                                var top = 0;

                                                                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    return typeof object == "string";
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                    } while (element = element.offsetParent);
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      for (var i = 0, results = [], node; node = nodes[i]; i++) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (match == null) return before;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Use ‘===’ to compare with ‘null’.
                                                                Open

                                                                      if (object == null) return '';
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Null Comparisons (no-eq-null)

                                                                Comparing to null without a type-checking operator (== or !=), can have unintended results as the comparison will evaluate to true when comparing to not just a null, but also an undefined value.

                                                                if (foo == null) {
                                                                  bar();
                                                                }

                                                                Rule Details

                                                                The no-eq-null rule aims reduce potential bug and unwanted behavior by ensuring that comparisons to null only match null, and not also undefined. As such it will flag comparisons to null when using == and !=.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo == null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux != null) {
                                                                  baz();
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo === null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux !== null) {
                                                                  baz();
                                                                }

                                                                Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none'))
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                            for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                      while (match != null) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                        if (null == ctx || '' == match[3]) break;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (element.offsetParent == document.body)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
                                                                Open

                                                                      for (var key in this._object) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require Guarding for-in (guard-for-in)

                                                                Looping over objects with a for in loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.

                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Note that simply checking foo.hasOwnProperty(key) is likely to cause an error in some cases; see [no-prototype-builtins](no-prototype-builtins.md).

                                                                Rule Details

                                                                This rule is aimed at preventing unexpected behavior that could arise from using a for in loop without filtering the results in the loop. As such, it will warn when for in loops do not filter their results with an if statement.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    if (Object.prototype.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                    if ({}.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                }

                                                                Related Rules

                                                                • [no-prototype-builtins](no-prototype-builtins.md)

                                                                Further Reading

                                                                Use ‘===’ to compare with ‘null’.
                                                                Open

                                                                      if (result == null || value >= result)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Null Comparisons (no-eq-null)

                                                                Comparing to null without a type-checking operator (== or !=), can have unintended results as the comparison will evaluate to true when comparing to not just a null, but also an undefined value.

                                                                if (foo == null) {
                                                                  bar();
                                                                }

                                                                Rule Details

                                                                The no-eq-null rule aims reduce potential bug and unwanted behavior by ensuring that comparisons to null only match null, and not also undefined. As such it will flag comparisons to null when using == and !=.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo == null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux != null) {
                                                                  baz();
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo === null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux !== null) {
                                                                  baz();
                                                                }

                                                                Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (this.method == 'get')
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                  if (arguments.length == 2) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      this.body = this.method == 'post' ? (this.options.postBody || params) : null;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                'i' is already defined.
                                                                Open

                                                                    for (var i = 0, length = arguments.length; i < length; i++) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow variable redeclaration (no-redeclare)

                                                                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                                                                Rule Details

                                                                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                var a = 10;

                                                                Examples of correct code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                // ...
                                                                a = 10;

                                                                Options

                                                                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                                                                builtinGlobals

                                                                Examples of incorrect code for the { "builtinGlobals": true } option:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                
                                                                var Object = 0;

                                                                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                /*eslint-env browser*/
                                                                
                                                                var top = 0;

                                                                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (typeof this.options.requestHeaders == 'object') {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
                                                                Open

                                                                    for (var attr in attributes) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require Guarding for-in (guard-for-in)

                                                                Looping over objects with a for in loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.

                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Note that simply checking foo.hasOwnProperty(key) is likely to cause an error in some cases; see [no-prototype-builtins](no-prototype-builtins.md).

                                                                Rule Details

                                                                This rule is aimed at preventing unexpected behavior that could arise from using a for in loop without filtering the results in the loop. As such, it will warn when for in loops do not filter their results with an if statement.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    if (Object.prototype.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                    if ({}.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                }

                                                                Related Rules

                                                                • [no-prototype-builtins](no-prototype-builtins.md)

                                                                Further Reading

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                            if (m = e.match(p[i])) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected an assignment or function call and instead saw an expression.
                                                                Open

                                                                        try { element.offsetParent }
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Unused Expressions (no-unused-expressions)

                                                                An unused expression which has no effect on the state of the program indicates a logic error.

                                                                For example, n + 1; is not a syntax error, but it might be a typing mistake where a programmer meant an assignment statement n += 1; instead.

                                                                Rule Details

                                                                This rule aims to eliminate unused expressions which have no effect on the state of the program.

                                                                This rule does not apply to function calls or constructor calls with the new operator, because they could have side effects on the state of the program.

                                                                var i = 0;
                                                                function increment() { i += 1; }
                                                                increment(); // return value is unused, but i changed as a side effect
                                                                
                                                                var nThings = 0;
                                                                function Thing() { nThings += 1; }
                                                                new Thing(); // constructed object is unused, but nThings changed as a side effect

                                                                This rule does not apply to directives (which are in the form of literal string expressions such as "use strict"; at the beginning of a script, module, or function).

                                                                Sequence expressions (those using a comma, such as a = 1, b = 2) are always considered unused unless their return value is assigned or used in a condition evaluation, or a function call is made with the sequence expression value.

                                                                Options

                                                                This rule, in its default state, does not require any arguments. If you would like to enable one or more of the following you may pass an object with the options set as follows:

                                                                • allowShortCircuit set to true will allow you to use short circuit evaluations in your expressions (Default: false).
                                                                • allowTernary set to true will enable you to use ternary operators in your expressions similarly to short circuit evaluations (Default: false).
                                                                • allowTaggedTemplates set to true will enable you to use tagged template literals in your expressions (Default: false).

                                                                These options allow unused expressions only if all of the code paths either directly change the state (for example, assignment statement) or could have side effects (for example, function call).

                                                                Examples of incorrect code for the default { "allowShortCircuit": false, "allowTernary": false } options:

                                                                /*eslint no-unused-expressions: "error"*/
                                                                
                                                                0
                                                                
                                                                if(0) 0
                                                                
                                                                {0}
                                                                
                                                                f(0), {}
                                                                
                                                                a && b()
                                                                
                                                                a, b()
                                                                
                                                                c = a, b;
                                                                
                                                                a() && function namedFunctionInExpressionContext () {f();}
                                                                
                                                                (function anIncompleteIIFE () {});
                                                                
                                                                injectGlobal`body{ color: red; }`

                                                                Note that one or more string expression statements (with or without semi-colons) will only be considered as unused if they are not in the beginning of a script, module, or function (alone and uninterrupted by other statements). Otherwise, they will be treated as part of a "directive prologue", a section potentially usable by JavaScript engines. This includes "strict mode" directives.

                                                                "use strict";
                                                                "use asm"
                                                                "use stricter";
                                                                "use babel"
                                                                "any other strings like this in the prologue";

                                                                Examples of correct code for the default { "allowShortCircuit": false, "allowTernary": false } options:

                                                                /*eslint no-unused-expressions: "error"*/
                                                                
                                                                {} // In this context, this is a block statement, not an object literal
                                                                
                                                                {myLabel: someVar} // In this context, this is a block statement with a label and expression, not an object literal
                                                                
                                                                function namedFunctionDeclaration () {}
                                                                
                                                                (function aGenuineIIFE () {}());
                                                                
                                                                f()
                                                                
                                                                a = 0
                                                                
                                                                new C
                                                                
                                                                delete a.b
                                                                
                                                                void a

                                                                allowShortCircuit

                                                                Examples of incorrect code for the { "allowShortCircuit": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
                                                                
                                                                a || b

                                                                Examples of correct code for the { "allowShortCircuit": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
                                                                
                                                                a && b()
                                                                a() || (b = c)

                                                                allowTernary

                                                                Examples of incorrect code for the { "allowTernary": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
                                                                
                                                                a ? b : 0
                                                                a ? b : c()

                                                                Examples of correct code for the { "allowTernary": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
                                                                
                                                                a ? b() : c()
                                                                a ? (b = c) : d()

                                                                allowShortCircuit and allowTernary

                                                                Examples of correct code for the { "allowShortCircuit": true, "allowTernary": true } options:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true, "allowTernary": true }]*/
                                                                
                                                                a ? b() || (c = d) : e()

                                                                allowTaggedTemplates

                                                                Examples of incorrect code for the { "allowTaggedTemplates": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
                                                                
                                                                `some untagged template string`;

                                                                Examples of correct code for the { "allowTaggedTemplates": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
                                                                
                                                                tag`some tagged template string`;

                                                                Source: http://eslint.org/docs/rules/

                                                                'j' is already defined.
                                                                Open

                                                                        for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow variable redeclaration (no-redeclare)

                                                                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                                                                Rule Details

                                                                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                var a = 10;

                                                                Examples of correct code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                // ...
                                                                a = 10;

                                                                Options

                                                                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                                                                builtinGlobals

                                                                Examples of incorrect code for the { "builtinGlobals": true } option:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                
                                                                var Object = 0;

                                                                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                /*eslint-env browser*/
                                                                
                                                                var top = 0;

                                                                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (style == 'opacity') {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
                                                                Open

                                                                    for (var position in insertions) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require Guarding for-in (guard-for-in)

                                                                Looping over objects with a for in loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.

                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Note that simply checking foo.hasOwnProperty(key) is likely to cause an error in some cases; see [no-prototype-builtins](no-prototype-builtins.md).

                                                                Rule Details

                                                                This rule is aimed at preventing unexpected behavior that could arise from using a for in loop without filtering the results in the loop. As such, it will warn when for in loops do not filter their results with an if statement.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    if (Object.prototype.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                    if ({}.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                }

                                                                Related Rules

                                                                • [no-prototype-builtins](no-prototype-builtins.md)

                                                                Further Reading

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                        for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                'i' is already defined.
                                                                Open

                                                                    for (var i = 0, token; token = this.tokens[i]; i++) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow variable redeclaration (no-redeclare)

                                                                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                                                                Rule Details

                                                                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                var a = 10;

                                                                Examples of correct code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                // ...
                                                                a = 10;

                                                                Options

                                                                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                                                                builtinGlobals

                                                                Examples of incorrect code for the { "builtinGlobals": true } option:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                
                                                                var Object = 0;

                                                                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                /*eslint-env browser*/
                                                                
                                                                var top = 0;

                                                                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (nodes.length == 0) return nodes;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected an assignment or function call and instead saw an expression.
                                                                Open

                                                                      name = token[0], matches = token[1];
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Unused Expressions (no-unused-expressions)

                                                                An unused expression which has no effect on the state of the program indicates a logic error.

                                                                For example, n + 1; is not a syntax error, but it might be a typing mistake where a programmer meant an assignment statement n += 1; instead.

                                                                Rule Details

                                                                This rule aims to eliminate unused expressions which have no effect on the state of the program.

                                                                This rule does not apply to function calls or constructor calls with the new operator, because they could have side effects on the state of the program.

                                                                var i = 0;
                                                                function increment() { i += 1; }
                                                                increment(); // return value is unused, but i changed as a side effect
                                                                
                                                                var nThings = 0;
                                                                function Thing() { nThings += 1; }
                                                                new Thing(); // constructed object is unused, but nThings changed as a side effect

                                                                This rule does not apply to directives (which are in the form of literal string expressions such as "use strict"; at the beginning of a script, module, or function).

                                                                Sequence expressions (those using a comma, such as a = 1, b = 2) are always considered unused unless their return value is assigned or used in a condition evaluation, or a function call is made with the sequence expression value.

                                                                Options

                                                                This rule, in its default state, does not require any arguments. If you would like to enable one or more of the following you may pass an object with the options set as follows:

                                                                • allowShortCircuit set to true will allow you to use short circuit evaluations in your expressions (Default: false).
                                                                • allowTernary set to true will enable you to use ternary operators in your expressions similarly to short circuit evaluations (Default: false).
                                                                • allowTaggedTemplates set to true will enable you to use tagged template literals in your expressions (Default: false).

                                                                These options allow unused expressions only if all of the code paths either directly change the state (for example, assignment statement) or could have side effects (for example, function call).

                                                                Examples of incorrect code for the default { "allowShortCircuit": false, "allowTernary": false } options:

                                                                /*eslint no-unused-expressions: "error"*/
                                                                
                                                                0
                                                                
                                                                if(0) 0
                                                                
                                                                {0}
                                                                
                                                                f(0), {}
                                                                
                                                                a && b()
                                                                
                                                                a, b()
                                                                
                                                                c = a, b;
                                                                
                                                                a() && function namedFunctionInExpressionContext () {f();}
                                                                
                                                                (function anIncompleteIIFE () {});
                                                                
                                                                injectGlobal`body{ color: red; }`

                                                                Note that one or more string expression statements (with or without semi-colons) will only be considered as unused if they are not in the beginning of a script, module, or function (alone and uninterrupted by other statements). Otherwise, they will be treated as part of a "directive prologue", a section potentially usable by JavaScript engines. This includes "strict mode" directives.

                                                                "use strict";
                                                                "use asm"
                                                                "use stricter";
                                                                "use babel"
                                                                "any other strings like this in the prologue";

                                                                Examples of correct code for the default { "allowShortCircuit": false, "allowTernary": false } options:

                                                                /*eslint no-unused-expressions: "error"*/
                                                                
                                                                {} // In this context, this is a block statement, not an object literal
                                                                
                                                                {myLabel: someVar} // In this context, this is a block statement with a label and expression, not an object literal
                                                                
                                                                function namedFunctionDeclaration () {}
                                                                
                                                                (function aGenuineIIFE () {}());
                                                                
                                                                f()
                                                                
                                                                a = 0
                                                                
                                                                new C
                                                                
                                                                delete a.b
                                                                
                                                                void a

                                                                allowShortCircuit

                                                                Examples of incorrect code for the { "allowShortCircuit": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
                                                                
                                                                a || b

                                                                Examples of correct code for the { "allowShortCircuit": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
                                                                
                                                                a && b()
                                                                a() || (b = c)

                                                                allowTernary

                                                                Examples of incorrect code for the { "allowTernary": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
                                                                
                                                                a ? b : 0
                                                                a ? b : c()

                                                                Examples of correct code for the { "allowTernary": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
                                                                
                                                                a ? b() : c()
                                                                a ? (b = c) : d()

                                                                allowShortCircuit and allowTernary

                                                                Examples of correct code for the { "allowShortCircuit": true, "allowTernary": true } options:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true, "allowTernary": true }]*/
                                                                
                                                                a ? b() || (c = d) : e()

                                                                allowTaggedTemplates

                                                                Examples of incorrect code for the { "allowTaggedTemplates": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
                                                                
                                                                `some untagged template string`;

                                                                Examples of correct code for the { "allowTaggedTemplates": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
                                                                
                                                                tag`some tagged template string`;

                                                                Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      while (node = node.nextSibling)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (position == 'top' || position == 'after') childNodes.reverse();
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      for (var i = 0, results = [], node; node = nodes[i]; i++) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                          if (combinator == "descendant") {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                        if (element.tagName.toUpperCase() == 'BODY') break;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                          if (tagName == "*") return nodes;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                          } else if (combinator == 'adjacent') {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                            for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected an assignment or function call and instead saw an expression.
                                                                Open

                                                                      try { element.offsetParent }
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Unused Expressions (no-unused-expressions)

                                                                An unused expression which has no effect on the state of the program indicates a logic error.

                                                                For example, n + 1; is not a syntax error, but it might be a typing mistake where a programmer meant an assignment statement n += 1; instead.

                                                                Rule Details

                                                                This rule aims to eliminate unused expressions which have no effect on the state of the program.

                                                                This rule does not apply to function calls or constructor calls with the new operator, because they could have side effects on the state of the program.

                                                                var i = 0;
                                                                function increment() { i += 1; }
                                                                increment(); // return value is unused, but i changed as a side effect
                                                                
                                                                var nThings = 0;
                                                                function Thing() { nThings += 1; }
                                                                new Thing(); // constructed object is unused, but nThings changed as a side effect

                                                                This rule does not apply to directives (which are in the form of literal string expressions such as "use strict"; at the beginning of a script, module, or function).

                                                                Sequence expressions (those using a comma, such as a = 1, b = 2) are always considered unused unless their return value is assigned or used in a condition evaluation, or a function call is made with the sequence expression value.

                                                                Options

                                                                This rule, in its default state, does not require any arguments. If you would like to enable one or more of the following you may pass an object with the options set as follows:

                                                                • allowShortCircuit set to true will allow you to use short circuit evaluations in your expressions (Default: false).
                                                                • allowTernary set to true will enable you to use ternary operators in your expressions similarly to short circuit evaluations (Default: false).
                                                                • allowTaggedTemplates set to true will enable you to use tagged template literals in your expressions (Default: false).

                                                                These options allow unused expressions only if all of the code paths either directly change the state (for example, assignment statement) or could have side effects (for example, function call).

                                                                Examples of incorrect code for the default { "allowShortCircuit": false, "allowTernary": false } options:

                                                                /*eslint no-unused-expressions: "error"*/
                                                                
                                                                0
                                                                
                                                                if(0) 0
                                                                
                                                                {0}
                                                                
                                                                f(0), {}
                                                                
                                                                a && b()
                                                                
                                                                a, b()
                                                                
                                                                c = a, b;
                                                                
                                                                a() && function namedFunctionInExpressionContext () {f();}
                                                                
                                                                (function anIncompleteIIFE () {});
                                                                
                                                                injectGlobal`body{ color: red; }`

                                                                Note that one or more string expression statements (with or without semi-colons) will only be considered as unused if they are not in the beginning of a script, module, or function (alone and uninterrupted by other statements). Otherwise, they will be treated as part of a "directive prologue", a section potentially usable by JavaScript engines. This includes "strict mode" directives.

                                                                "use strict";
                                                                "use asm"
                                                                "use stricter";
                                                                "use babel"
                                                                "any other strings like this in the prologue";

                                                                Examples of correct code for the default { "allowShortCircuit": false, "allowTernary": false } options:

                                                                /*eslint no-unused-expressions: "error"*/
                                                                
                                                                {} // In this context, this is a block statement, not an object literal
                                                                
                                                                {myLabel: someVar} // In this context, this is a block statement with a label and expression, not an object literal
                                                                
                                                                function namedFunctionDeclaration () {}
                                                                
                                                                (function aGenuineIIFE () {}());
                                                                
                                                                f()
                                                                
                                                                a = 0
                                                                
                                                                new C
                                                                
                                                                delete a.b
                                                                
                                                                void a

                                                                allowShortCircuit

                                                                Examples of incorrect code for the { "allowShortCircuit": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
                                                                
                                                                a || b

                                                                Examples of correct code for the { "allowShortCircuit": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
                                                                
                                                                a && b()
                                                                a() || (b = c)

                                                                allowTernary

                                                                Examples of incorrect code for the { "allowTernary": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
                                                                
                                                                a ? b : 0
                                                                a ? b : c()

                                                                Examples of correct code for the { "allowTernary": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
                                                                
                                                                a ? b() : c()
                                                                a ? (b = c) : d()

                                                                allowShortCircuit and allowTernary

                                                                Examples of correct code for the { "allowShortCircuit": true, "allowTernary": true } options:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true, "allowTernary": true }]*/
                                                                
                                                                a ? b() || (c = d) : e()

                                                                allowTaggedTemplates

                                                                Examples of incorrect code for the { "allowTaggedTemplates": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
                                                                
                                                                `some untagged template string`;

                                                                Examples of correct code for the { "allowTaggedTemplates": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
                                                                
                                                                tag`some tagged template string`;

                                                                Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    element.style.opacity = (value == 1) ? 0.999999 :
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (value == 1)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                          if (combinator == 'child') {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                        if (m[1] == "-") m[1] = -1;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    return c.find(function(wrapper) { return wrapper.handler == handler });
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (element == document && document.createEvent && !element.dispatchEvent)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                        if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle))
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      for (var i = 0, results = [], node; node = nodes[i]; i++) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                        if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i);
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (formula == 'even') formula = '2n+0';
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                    '!=': function(nv, v) { return nv != v; },
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                    for (var i = 0, results = [], element; element = elements[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (mode == 'vertical')
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                'i' is already defined.
                                                                Open

                                                                        for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow variable redeclaration (no-redeclare)

                                                                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                                                                Rule Details

                                                                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                var a = 10;

                                                                Examples of correct code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                // ...
                                                                a = 10;

                                                                Options

                                                                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                                                                builtinGlobals

                                                                Examples of incorrect code for the { "builtinGlobals": true } option:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                
                                                                var Object = 0;

                                                                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                /*eslint-env browser*/
                                                                
                                                                var top = 0;

                                                                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      for (var i = 0, results = [], node; node = nodes[i]; i++) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                          if (node.nodeIndex == formula) results.push(node);
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Duplicate key '$='.
                                                                Open

                                                                    '$=': function(nv, v) { return nv.endsWith(v); },
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow duplicate keys in object literals (no-dupe-keys)

                                                                Multiple properties with the same key in object literals can cause unexpected behavior in your application.

                                                                var foo = {
                                                                    bar: "baz",
                                                                    bar: "qux"
                                                                };

                                                                Rule Details

                                                                This rule disallows duplicate keys in object literals.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-dupe-keys: "error"*/
                                                                
                                                                var foo = {
                                                                    bar: "baz",
                                                                    bar: "qux"
                                                                };
                                                                
                                                                var foo = {
                                                                    "bar": "baz",
                                                                    bar: "qux"
                                                                };
                                                                
                                                                var foo = {
                                                                    0x1: "baz",
                                                                    1: "qux"
                                                                };

                                                                Examples of correct code for this rule:

                                                                /*eslint no-dupe-keys: "error"*/
                                                                
                                                                var foo = {
                                                                    bar: "baz",
                                                                    quxx: "qux"
                                                                };

                                                                Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                      if ((typeName && input.type != typeName) || (name && input.name != name))
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                        case 1: return event.which == 1 && event.metaKey;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Return statement should not contain assignment.
                                                                Open

                                                                    return c[eventName] = c[eventName] || [];
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Assignment in return Statement (no-return-assign)

                                                                One of the interesting, and sometimes confusing, aspects of JavaScript is that assignment can happen at almost any point. Because of this, an errant equals sign can end up causing assignment when the true intent was to do a comparison. This is especially true when using a return statement. For example:

                                                                function doSomething() {
                                                                    return foo = bar + 2;
                                                                }

                                                                It is difficult to tell the intent of the return statement here. It's possible that the function is meant to return the result of bar + 2, but then why is it assigning to foo? It's also possible that the intent was to use a comparison operator such as == and that this code is an error.

                                                                Because of this ambiguity, it's considered a best practice to not use assignment in return statements.

                                                                Rule Details

                                                                This rule aims to eliminate assignments from return statements. As such, it will warn whenever an assignment is found as part of return.

                                                                Options

                                                                The rule takes one option, a string, which must contain one of the following values:

                                                                • except-parens (default): Disallow assignments unless they are enclosed in parentheses.
                                                                • always: Disallow all assignments.

                                                                except-parens

                                                                This is the default option. It disallows assignments unless they are enclosed in parentheses.

                                                                Examples of incorrect code for the default "except-parens" option:

                                                                /*eslint no-return-assign: "error"*/
                                                                
                                                                function doSomething() {
                                                                    return foo = bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return foo += 2;
                                                                }

                                                                Examples of correct code for the default "except-parens" option:

                                                                /*eslint no-return-assign: "error"*/
                                                                
                                                                function doSomething() {
                                                                    return foo == bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return foo === bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return (foo = bar + 2);
                                                                }

                                                                always

                                                                This option disallows all assignments in return statements. All assignments are treated as problems.

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint no-return-assign: ["error", "always"]*/
                                                                
                                                                function doSomething() {
                                                                    return foo = bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return foo += 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return (foo = bar + 2);
                                                                }

                                                                Examples of correct code for the "always" option:

                                                                /*eslint no-return-assign: ["error", "always"]*/
                                                                
                                                                function doSomething() {
                                                                    return foo == bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return foo === bar + 2;
                                                                }

                                                                When Not To Use It

                                                                If you want to allow the use of assignment operators in a return statement, then you can safely disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (mode == 'horizontal')
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Don't make functions within a loop.
                                                                Open

                                                                          (classNames && classNames.all(function(name) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Functions in Loops (no-loop-func)

                                                                Writing functions within loops tends to result in errors due to the way the function creates a closure around the loop. For example:

                                                                for (var i = 0; i < 10; i++) {
                                                                    funcs[i] = function() {
                                                                        return i;
                                                                    };
                                                                }

                                                                In this case, you would expect each function created within the loop to return a different number. In reality, each function returns 10, because that was the last value of i in the scope.

                                                                let or const mitigate this problem.

                                                                /*eslint-env es6*/
                                                                
                                                                for (let i = 0; i < 10; i++) {
                                                                    funcs[i] = function() {
                                                                        return i;
                                                                    };
                                                                }

                                                                In this case, each function created within the loop returns a different number as expected.

                                                                Rule Details

                                                                This error is raised to highlight a piece of code that may not work as you expect it to and could also indicate a misunderstanding of how the language works. Your code may run without any problems if you do not fix this error, but in some situations it could behave unexpectedly.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-loop-func: "error"*/
                                                                /*eslint-env es6*/
                                                                
                                                                for (var i=10; i; i--) {
                                                                    (function() { return i; })();
                                                                }
                                                                
                                                                while(i) {
                                                                    var a = function() { return i; };
                                                                    a();
                                                                }
                                                                
                                                                do {
                                                                    function a() { return i; };
                                                                    a();
                                                                } while (i);
                                                                
                                                                let foo = 0;
                                                                for (let i=10; i; i--) {
                                                                    // Bad, function is referencing block scoped variable in the outer scope.
                                                                    var a = function() { return foo; };
                                                                    a();
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint no-loop-func: "error"*/
                                                                /*eslint-env es6*/
                                                                
                                                                var a = function() {};
                                                                
                                                                for (var i=10; i; i--) {
                                                                    a();
                                                                }
                                                                
                                                                for (var i=10; i; i--) {
                                                                    var a = function() {}; // OK, no references to variables in the outer scopes.
                                                                    a();
                                                                }
                                                                
                                                                for (let i=10; i; i--) {
                                                                    var a = function() { return i; }; // OK, all references are referring to block scoped variables in the loop.
                                                                    a();
                                                                }
                                                                
                                                                var foo = 100;
                                                                for (let i=10; i; i--) {
                                                                    var a = function() { return foo; }; // OK, all references are referring to never modified variables.
                                                                    a();
                                                                }
                                                                //... no modifications of foo after this loop ...

                                                                Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (formula == 'odd')  formula = '2n+1';
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                'node' is already defined.
                                                                Open

                                                                        for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow variable redeclaration (no-redeclare)

                                                                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                                                                Rule Details

                                                                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                var a = 10;

                                                                Examples of correct code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                // ...
                                                                a = 10;

                                                                Options

                                                                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                                                                builtinGlobals

                                                                Examples of incorrect code for the { "builtinGlobals": true } option:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                
                                                                var Object = 0;

                                                                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                /*eslint-env browser*/
                                                                
                                                                var top = 0;

                                                                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      } else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                        for (var i = 0, node, l = indices.length; node = nodes[i]; i++) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      for (var i = 0, results = [], node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected an assignment or function call and instead saw an expression.
                                                                Open

                                                                    form = $(form), options = Object.clone(options || { });
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Unused Expressions (no-unused-expressions)

                                                                An unused expression which has no effect on the state of the program indicates a logic error.

                                                                For example, n + 1; is not a syntax error, but it might be a typing mistake where a programmer meant an assignment statement n += 1; instead.

                                                                Rule Details

                                                                This rule aims to eliminate unused expressions which have no effect on the state of the program.

                                                                This rule does not apply to function calls or constructor calls with the new operator, because they could have side effects on the state of the program.

                                                                var i = 0;
                                                                function increment() { i += 1; }
                                                                increment(); // return value is unused, but i changed as a side effect
                                                                
                                                                var nThings = 0;
                                                                function Thing() { nThings += 1; }
                                                                new Thing(); // constructed object is unused, but nThings changed as a side effect

                                                                This rule does not apply to directives (which are in the form of literal string expressions such as "use strict"; at the beginning of a script, module, or function).

                                                                Sequence expressions (those using a comma, such as a = 1, b = 2) are always considered unused unless their return value is assigned or used in a condition evaluation, or a function call is made with the sequence expression value.

                                                                Options

                                                                This rule, in its default state, does not require any arguments. If you would like to enable one or more of the following you may pass an object with the options set as follows:

                                                                • allowShortCircuit set to true will allow you to use short circuit evaluations in your expressions (Default: false).
                                                                • allowTernary set to true will enable you to use ternary operators in your expressions similarly to short circuit evaluations (Default: false).
                                                                • allowTaggedTemplates set to true will enable you to use tagged template literals in your expressions (Default: false).

                                                                These options allow unused expressions only if all of the code paths either directly change the state (for example, assignment statement) or could have side effects (for example, function call).

                                                                Examples of incorrect code for the default { "allowShortCircuit": false, "allowTernary": false } options:

                                                                /*eslint no-unused-expressions: "error"*/
                                                                
                                                                0
                                                                
                                                                if(0) 0
                                                                
                                                                {0}
                                                                
                                                                f(0), {}
                                                                
                                                                a && b()
                                                                
                                                                a, b()
                                                                
                                                                c = a, b;
                                                                
                                                                a() && function namedFunctionInExpressionContext () {f();}
                                                                
                                                                (function anIncompleteIIFE () {});
                                                                
                                                                injectGlobal`body{ color: red; }`

                                                                Note that one or more string expression statements (with or without semi-colons) will only be considered as unused if they are not in the beginning of a script, module, or function (alone and uninterrupted by other statements). Otherwise, they will be treated as part of a "directive prologue", a section potentially usable by JavaScript engines. This includes "strict mode" directives.

                                                                "use strict";
                                                                "use asm"
                                                                "use stricter";
                                                                "use babel"
                                                                "any other strings like this in the prologue";

                                                                Examples of correct code for the default { "allowShortCircuit": false, "allowTernary": false } options:

                                                                /*eslint no-unused-expressions: "error"*/
                                                                
                                                                {} // In this context, this is a block statement, not an object literal
                                                                
                                                                {myLabel: someVar} // In this context, this is a block statement with a label and expression, not an object literal
                                                                
                                                                function namedFunctionDeclaration () {}
                                                                
                                                                (function aGenuineIIFE () {}());
                                                                
                                                                f()
                                                                
                                                                a = 0
                                                                
                                                                new C
                                                                
                                                                delete a.b
                                                                
                                                                void a

                                                                allowShortCircuit

                                                                Examples of incorrect code for the { "allowShortCircuit": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
                                                                
                                                                a || b

                                                                Examples of correct code for the { "allowShortCircuit": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
                                                                
                                                                a && b()
                                                                a() || (b = c)

                                                                allowTernary

                                                                Examples of incorrect code for the { "allowTernary": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
                                                                
                                                                a ? b : 0
                                                                a ? b : c()

                                                                Examples of correct code for the { "allowTernary": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
                                                                
                                                                a ? b() : c()
                                                                a ? (b = c) : d()

                                                                allowShortCircuit and allowTernary

                                                                Examples of correct code for the { "allowShortCircuit": true, "allowTernary": true } options:

                                                                /*eslint no-unused-expressions: ["error", { "allowShortCircuit": true, "allowTernary": true }]*/
                                                                
                                                                a ? b() || (c = d) : e()

                                                                allowTaggedTemplates

                                                                Examples of incorrect code for the { "allowTaggedTemplates": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
                                                                
                                                                `some untagged template string`;

                                                                Examples of correct code for the { "allowTaggedTemplates": true } option:

                                                                /*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
                                                                
                                                                tag`some tagged template string`;

                                                                Source: http://eslint.org/docs/rules/

                                                                Use ‘===’ to compare with ‘null’.
                                                                Open

                                                                        if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted &&
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Null Comparisons (no-eq-null)

                                                                Comparing to null without a type-checking operator (== or !=), can have unintended results as the comparison will evaluate to true when comparing to not just a null, but also an undefined value.

                                                                if (foo == null) {
                                                                  bar();
                                                                }

                                                                Rule Details

                                                                The no-eq-null rule aims reduce potential bug and unwanted behavior by ensuring that comparisons to null only match null, and not also undefined. As such it will flag comparisons to null when using == and !=.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo == null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux != null) {
                                                                  baz();
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint no-eq-null: "error"*/
                                                                
                                                                if (foo === null) {
                                                                  bar();
                                                                }
                                                                
                                                                while (qux !== null) {
                                                                  baz();
                                                                }

                                                                Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    if (this.element.tagName.toLowerCase() == 'form')
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      for (var i = 0, results = [], node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      for (var i = 0, node; node = b[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                      if (element.select && (element.tagName.toLowerCase() != 'input' ||
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                'values' is already defined.
                                                                Open

                                                                    for (var i = 0, values = []; i < length; i++) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow variable redeclaration (no-redeclare)

                                                                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                                                                Rule Details

                                                                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                var a = 10;

                                                                Examples of correct code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                // ...
                                                                a = 10;

                                                                Options

                                                                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                                                                builtinGlobals

                                                                Examples of incorrect code for the { "builtinGlobals": true } option:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                
                                                                var Object = 0;

                                                                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                /*eslint-env browser*/
                                                                
                                                                var top = 0;

                                                                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                    if (this.lastValue != value) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                      if ((typeName && input.type != typeName) || (name && input.name != name))
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                    return $(element).value != '';
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                        this.lastValue != value : String(this.lastValue) != String(value)) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                              if (Selector.handlers.previousElementSibling(targetNode) == node)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (node.nodeType == Node.TEXT_NODE) node = node.parentNode;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                'node' is already defined.
                                                                Open

                                                                        for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow variable redeclaration (no-redeclare)

                                                                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                                                                Rule Details

                                                                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                var a = 10;

                                                                Examples of correct code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                // ...
                                                                a = 10;

                                                                Options

                                                                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                                                                builtinGlobals

                                                                Examples of incorrect code for the { "builtinGlobals": true } option:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                
                                                                var Object = 0;

                                                                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                /*eslint-env browser*/
                                                                
                                                                var top = 0;

                                                                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (a == 0) return b > 0 ? [b] : [];
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
                                                                Open

                                                                      for (var eventName in cache[id])
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require Guarding for-in (guard-for-in)

                                                                Looping over objects with a for in loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.

                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Note that simply checking foo.hasOwnProperty(key) is likely to cause an error in some cases; see [no-prototype-builtins](no-prototype-builtins.md).

                                                                Rule Details

                                                                This rule is aimed at preventing unexpected behavior that could arise from using a for in loop without filtering the results in the loop. As such, it will warn when for in loops do not filter their results with an if statement.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    if (Object.prototype.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                    if ({}.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                }

                                                                Related Rules

                                                                • [no-prototype-builtins](no-prototype-builtins.md)

                                                                Further Reading

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      for (var i = 0, node; node = nodes[i]; i++) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                        for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                      if (value != undefined) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (this.readyState == "complete") {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Empty block statement.
                                                                Open

                                                                    } catch (e) { }
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow empty block statements (no-empty)

                                                                Empty block statements, while not technically errors, usually occur due to refactoring that wasn't completed. They can cause confusion when reading code.

                                                                Rule Details

                                                                This rule disallows empty block statements. This rule ignores block statements which contain a comment (for example, in an empty catch or finally block of a try statement to indicate that execution should continue regardless of errors).

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-empty: "error"*/
                                                                
                                                                if (foo) {
                                                                }
                                                                
                                                                while (foo) {
                                                                }
                                                                
                                                                switch(foo) {
                                                                }
                                                                
                                                                try {
                                                                    doSomething();
                                                                } catch(ex) {
                                                                
                                                                } finally {
                                                                
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint no-empty: "error"*/
                                                                
                                                                if (foo) {
                                                                    // empty
                                                                }
                                                                
                                                                while (foo) {
                                                                    /* empty */
                                                                }
                                                                
                                                                try {
                                                                    doSomething();
                                                                } catch (ex) {
                                                                    // continue regardless of error
                                                                }
                                                                
                                                                try {
                                                                    doSomething();
                                                                } finally {
                                                                    /* continue regardless of error */
                                                                }

                                                                Options

                                                                This rule has an object option for exceptions:

                                                                • "allowEmptyCatch": true allows empty catch clauses (that is, which do not contain a comment)

                                                                allowEmptyCatch

                                                                Examples of additional correct code for this rule with the { "allowEmptyCatch": true } option:

                                                                /* eslint no-empty: ["error", { "allowEmptyCatch": true }] */
                                                                try {
                                                                    doSomething();
                                                                } catch (ex) {}
                                                                
                                                                try {
                                                                    doSomething();
                                                                }
                                                                catch (ex) {}
                                                                finally {
                                                                    /* continue regardless of error */
                                                                }

                                                                When Not To Use It

                                                                If you intentionally use empty block statements then you can disable this rule.

                                                                Related Rules

                                                                'i' is already defined.
                                                                Open

                                                                        for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow variable redeclaration (no-redeclare)

                                                                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                                                                Rule Details

                                                                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                var a = 10;

                                                                Examples of correct code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                // ...
                                                                a = 10;

                                                                Options

                                                                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                                                                builtinGlobals

                                                                Examples of incorrect code for the { "builtinGlobals": true } option:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                
                                                                var Object = 0;

                                                                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                /*eslint-env browser*/
                                                                
                                                                var top = 0;

                                                                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                        if (node.tagName == '!' || node.firstChild) continue;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      for (var i = 0, results = [], node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                    if (typeof options != 'object') options = { hash: !!options };
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      for (var i = 0, results = [], node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                        if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted &&
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                        if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted &&
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                          if (node == targetNode) return [targetNode];
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                'i' is already defined.
                                                                Open

                                                                        for (var i = 0, node, l = indices.length; node = nodes[i]; i++) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow variable redeclaration (no-redeclare)

                                                                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                                                                Rule Details

                                                                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                var a = 10;

                                                                Examples of correct code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                // ...
                                                                a = 10;

                                                                Options

                                                                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                                                                builtinGlobals

                                                                Examples of incorrect code for the { "builtinGlobals": true } option:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                
                                                                var Object = 0;

                                                                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                /*eslint-env browser*/
                                                                
                                                                var top = 0;

                                                                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                                                                'node' is already defined.
                                                                Open

                                                                        for (var i = 0, node, l = indices.length; node = nodes[i]; i++) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow variable redeclaration (no-redeclare)

                                                                In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

                                                                Rule Details

                                                                This rule is aimed at eliminating variables that have multiple declarations in the same scope.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                var a = 10;

                                                                Examples of correct code for this rule:

                                                                /*eslint no-redeclare: "error"*/
                                                                
                                                                var a = 3;
                                                                // ...
                                                                a = 10;

                                                                Options

                                                                This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

                                                                builtinGlobals

                                                                Examples of incorrect code for the { "builtinGlobals": true } option:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                
                                                                var Object = 0;

                                                                Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

                                                                /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
                                                                /*eslint-env browser*/
                                                                
                                                                var top = 0;

                                                                The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    '^=': function(nv, v) { return nv == v || nv && nv.startsWith(v); },
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
                                                                Open

                                                                    for (var id in cache)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require Guarding for-in (guard-for-in)

                                                                Looping over objects with a for in loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.

                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Note that simply checking foo.hasOwnProperty(key) is likely to cause an error in some cases; see [no-prototype-builtins](no-prototype-builtins.md).

                                                                Rule Details

                                                                This rule is aimed at preventing unexpected behavior that could arise from using a for in loop without filtering the results in the loop. As such, it will warn when for in loops do not filter their results with an if statement.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    doSomething(key);
                                                                }

                                                                Examples of correct code for this rule:

                                                                /*eslint guard-for-in: "error"*/
                                                                
                                                                for (key in foo) {
                                                                    if (Object.prototype.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                    if ({}.hasOwnProperty.call(foo, key)) {
                                                                        doSomething(key);
                                                                    }
                                                                }

                                                                Related Rules

                                                                • [no-prototype-builtins](no-prototype-builtins.md)

                                                                Further Reading

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                    for (var i = 0, child, cn; child = nodes[i]; i++) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      for (var i = 0, results = [], node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Duplicate key '*='.
                                                                Open

                                                                    '*=': function(nv, v) { return nv.include(v); },
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow duplicate keys in object literals (no-dupe-keys)

                                                                Multiple properties with the same key in object literals can cause unexpected behavior in your application.

                                                                var foo = {
                                                                    bar: "baz",
                                                                    bar: "qux"
                                                                };

                                                                Rule Details

                                                                This rule disallows duplicate keys in object literals.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-dupe-keys: "error"*/
                                                                
                                                                var foo = {
                                                                    bar: "baz",
                                                                    bar: "qux"
                                                                };
                                                                
                                                                var foo = {
                                                                    "bar": "baz",
                                                                    bar: "qux"
                                                                };
                                                                
                                                                var foo = {
                                                                    0x1: "baz",
                                                                    1: "qux"
                                                                };

                                                                Examples of correct code for this rule:

                                                                /*eslint no-dupe-keys: "error"*/
                                                                
                                                                var foo = {
                                                                    bar: "baz",
                                                                    quxx: "qux"
                                                                };

                                                                Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                            if (node.nodeIndex == indices[j]) results.push(node);
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Return statement should not contain assignment.
                                                                Open

                                                                    return cache[id] = cache[id] || { };
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Assignment in return Statement (no-return-assign)

                                                                One of the interesting, and sometimes confusing, aspects of JavaScript is that assignment can happen at almost any point. Because of this, an errant equals sign can end up causing assignment when the true intent was to do a comparison. This is especially true when using a return statement. For example:

                                                                function doSomething() {
                                                                    return foo = bar + 2;
                                                                }

                                                                It is difficult to tell the intent of the return statement here. It's possible that the function is meant to return the result of bar + 2, but then why is it assigning to foo? It's also possible that the intent was to use a comparison operator such as == and that this code is an error.

                                                                Because of this ambiguity, it's considered a best practice to not use assignment in return statements.

                                                                Rule Details

                                                                This rule aims to eliminate assignments from return statements. As such, it will warn whenever an assignment is found as part of return.

                                                                Options

                                                                The rule takes one option, a string, which must contain one of the following values:

                                                                • except-parens (default): Disallow assignments unless they are enclosed in parentheses.
                                                                • always: Disallow all assignments.

                                                                except-parens

                                                                This is the default option. It disallows assignments unless they are enclosed in parentheses.

                                                                Examples of incorrect code for the default "except-parens" option:

                                                                /*eslint no-return-assign: "error"*/
                                                                
                                                                function doSomething() {
                                                                    return foo = bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return foo += 2;
                                                                }

                                                                Examples of correct code for the default "except-parens" option:

                                                                /*eslint no-return-assign: "error"*/
                                                                
                                                                function doSomething() {
                                                                    return foo == bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return foo === bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return (foo = bar + 2);
                                                                }

                                                                always

                                                                This option disallows all assignments in return statements. All assignments are treated as problems.

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint no-return-assign: ["error", "always"]*/
                                                                
                                                                function doSomething() {
                                                                    return foo = bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return foo += 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return (foo = bar + 2);
                                                                }

                                                                Examples of correct code for the "always" option:

                                                                /*eslint no-return-assign: ["error", "always"]*/
                                                                
                                                                function doSomething() {
                                                                    return foo == bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return foo === bar + 2;
                                                                }

                                                                When Not To Use It

                                                                If you want to allow the use of assignment operators in a return statement, then you can safely disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    '=':  function(nv, v) { return nv == v; },
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                        this.lastValue != value : String(this.lastValue) != String(value)) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                        case 0: return event.which == 1 && !event.metaKey;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Return statement should not contain assignment.
                                                                Open

                                                                    return element._prototypeEventID = [++arguments.callee.id];
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Assignment in return Statement (no-return-assign)

                                                                One of the interesting, and sometimes confusing, aspects of JavaScript is that assignment can happen at almost any point. Because of this, an errant equals sign can end up causing assignment when the true intent was to do a comparison. This is especially true when using a return statement. For example:

                                                                function doSomething() {
                                                                    return foo = bar + 2;
                                                                }

                                                                It is difficult to tell the intent of the return statement here. It's possible that the function is meant to return the result of bar + 2, but then why is it assigning to foo? It's also possible that the intent was to use a comparison operator such as == and that this code is an error.

                                                                Because of this ambiguity, it's considered a best practice to not use assignment in return statements.

                                                                Rule Details

                                                                This rule aims to eliminate assignments from return statements. As such, it will warn whenever an assignment is found as part of return.

                                                                Options

                                                                The rule takes one option, a string, which must contain one of the following values:

                                                                • except-parens (default): Disallow assignments unless they are enclosed in parentheses.
                                                                • always: Disallow all assignments.

                                                                except-parens

                                                                This is the default option. It disallows assignments unless they are enclosed in parentheses.

                                                                Examples of incorrect code for the default "except-parens" option:

                                                                /*eslint no-return-assign: "error"*/
                                                                
                                                                function doSomething() {
                                                                    return foo = bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return foo += 2;
                                                                }

                                                                Examples of correct code for the default "except-parens" option:

                                                                /*eslint no-return-assign: "error"*/
                                                                
                                                                function doSomething() {
                                                                    return foo == bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return foo === bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return (foo = bar + 2);
                                                                }

                                                                always

                                                                This option disallows all assignments in return statements. All assignments are treated as problems.

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint no-return-assign: ["error", "always"]*/
                                                                
                                                                function doSomething() {
                                                                    return foo = bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return foo += 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return (foo = bar + 2);
                                                                }

                                                                Examples of correct code for the "always" option:

                                                                /*eslint no-return-assign: ["error", "always"]*/
                                                                
                                                                function doSomething() {
                                                                    return foo == bar + 2;
                                                                }
                                                                
                                                                function doSomething() {
                                                                    return foo === bar + 2;
                                                                }

                                                                When Not To Use It

                                                                If you want to allow the use of assignment operators in a return statement, then you can safely disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                        for (var i = 0, node; node = nodes[i]; i++)
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      for (var i = 0, node; node = nodes[i]; i++) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      if (nodes.length == 0) return [];
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                        (event.eventName && event.eventName != eventName))
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected a conditional expression and instead saw an assignment.
                                                                Open

                                                                      for (var i = 0, results = [], node; node = nodes[i]; i++) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                disallow assignment operators in conditional statements (no-cond-assign)

                                                                In conditional statements, it is very easy to mistype a comparison operator (such as ==) as an assignment operator (such as =). For example:

                                                                // Check the user's job title
                                                                if (user.jobTitle = "manager") {
                                                                    // user.jobTitle is now incorrect
                                                                }

                                                                There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.

                                                                Rule Details

                                                                This rule disallows ambiguous assignment operators in test conditions of if, for, while, and do...while statements.

                                                                Options

                                                                This rule has a string option:

                                                                • "except-parens" (default) allows assignments in test conditions only if they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a while or do...while loop)
                                                                • "always" disallows all assignments in test conditions

                                                                except-parens

                                                                Examples of incorrect code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }

                                                                Examples of correct code for this rule with the default "except-parens" option:

                                                                /*eslint no-cond-assign: "error"*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                always

                                                                Examples of incorrect code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Unintentional assignment
                                                                var x;
                                                                if (x = 0) {
                                                                    var b = 1;
                                                                }
                                                                
                                                                // Practical example that is similar to an error
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while (someNode = someNode.parentNode);
                                                                }
                                                                
                                                                // Practical example that wraps the assignment in parentheses
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode));
                                                                }
                                                                
                                                                // Practical example that wraps the assignment and tests for 'null'
                                                                function setHeight(someNode) {
                                                                    "use strict";
                                                                    do {
                                                                        someNode.height = "100px";
                                                                    } while ((someNode = someNode.parentNode) !== null);
                                                                }

                                                                Examples of correct code for this rule with the "always" option:

                                                                /*eslint no-cond-assign: ["error", "always"]*/
                                                                
                                                                // Assignment replaced by comparison
                                                                var x;
                                                                if (x === 0) {
                                                                    var b = 1;
                                                                }

                                                                Related Rules

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    '$=': function(nv, v) { return nv == v || nv && nv.endsWith(v); },
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                    '*=': function(nv, v) { return nv == v || nv && nv.include(v); },
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      return this[element.type == 'select-one' ?
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                          if (currentValue == value) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                        if (nodeClassName.length == 0) continue;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                        if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted &&
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                            submit !== false && (!submit || key == submit) && (submitted = true)))) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '!==' and instead saw '!='.
                                                                Open

                                                                      return 'hidden' != element.type && !element.disabled;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                Expected '===' and instead saw '=='.
                                                                Open

                                                                      return event.button == buttonMap[code];
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require === and !== (eqeqeq)

                                                                It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=.

                                                                The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true:

                                                                • [] == false
                                                                • [] == ![]
                                                                • 3 == "03"

                                                                If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot.

                                                                Rule Details

                                                                This rule is aimed at eliminating the type-unsafe equality operators.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint eqeqeq: "error"*/
                                                                
                                                                if (x == 42) { }
                                                                
                                                                if ("" == text) { }
                                                                
                                                                if (obj.getStuff() != undefined) { }

                                                                The --fix option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a typeof expression, or if both operands are literals with the same type.

                                                                Options

                                                                always

                                                                The "always" option (default) enforces the use of === and !== in every situation (except when you opt-in to more specific handling of null [see below]).

                                                                Examples of incorrect code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a == b
                                                                foo == true
                                                                bananas != 1
                                                                value == undefined
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                Examples of correct code for the "always" option:

                                                                /*eslint eqeqeq: ["error", "always"]*/
                                                                
                                                                a === b
                                                                foo === true
                                                                bananas !== 1
                                                                value === undefined
                                                                typeof foo === 'undefined'
                                                                'hello' !== 'world'
                                                                0 === 0
                                                                true === true
                                                                foo === null

                                                                This rule optionally takes a second argument, which should be an object with the following supported properties:

                                                                • "null": Customize how this rule treats null literals. Possible values:
                                                                  • always (default) - Always use === or !==.
                                                                  • never - Never use === or !== with null.
                                                                  • ignore - Do not apply this rule to null.

                                                                smart

                                                                The "smart" option enforces the use of === and !== except for these cases:

                                                                • Comparing two literal values
                                                                • Evaluating the value of typeof
                                                                • Comparing against null

                                                                Examples of incorrect code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                // comparing two variables requires ===
                                                                a == b
                                                                
                                                                // only one side is a literal
                                                                foo == true
                                                                bananas != 1
                                                                
                                                                // comparing to undefined requires ===
                                                                value == undefined

                                                                Examples of correct code for the "smart" option:

                                                                /*eslint eqeqeq: ["error", "smart"]*/
                                                                
                                                                typeof foo == 'undefined'
                                                                'hello' != 'world'
                                                                0 == 0
                                                                true == true
                                                                foo == null

                                                                allow-null

                                                                Deprecated: Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell eslint to always enforce strict equality except when comparing with the null literal.

                                                                ["error", "always", {"null": "ignore"}]

                                                                When Not To Use It

                                                                If you don't want to enforce a style for using equality operators, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

                                                                The '__proto__' property is deprecated.
                                                                Open

                                                                      document.createElement('div')['__proto__'] !==
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Use of __proto__ (no-proto)

                                                                __proto__ property has been deprecated as of ECMAScript 3.1 and shouldn't be used in the code. Use getPrototypeOf method instead.

                                                                Rule Details

                                                                When an object is created __proto__ is set to the original prototype property of the object’s constructor function. getPrototypeOf is the preferred method of getting "the prototype".

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-proto: "error"*/
                                                                
                                                                var a = obj.__proto__;
                                                                
                                                                var a = obj["__proto__"];

                                                                Examples of correct code for this rule:

                                                                /*eslint no-proto: "error"*/
                                                                
                                                                var a = Object.getPrototypeOf(obj);

                                                                When Not To Use It

                                                                If you need to support legacy browsers, you might want to turn this rule off, since support for getPrototypeOf is not yet universal.

                                                                Further Reading

                                                                The '__proto__' property is deprecated.
                                                                Open

                                                                      document.createElement('div')['__proto__'] &&
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Use of __proto__ (no-proto)

                                                                __proto__ property has been deprecated as of ECMAScript 3.1 and shouldn't be used in the code. Use getPrototypeOf method instead.

                                                                Rule Details

                                                                When an object is created __proto__ is set to the original prototype property of the object’s constructor function. getPrototypeOf is the preferred method of getting "the prototype".

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-proto: "error"*/
                                                                
                                                                var a = obj.__proto__;
                                                                
                                                                var a = obj["__proto__"];

                                                                Examples of correct code for this rule:

                                                                /*eslint no-proto: "error"*/
                                                                
                                                                var a = Object.getPrototypeOf(obj);

                                                                When Not To Use It

                                                                If you need to support legacy browsers, you might want to turn this rule off, since support for getPrototypeOf is not yet universal.

                                                                Further Reading

                                                                The '__proto__' property is deprecated.
                                                                Open

                                                                    window[klass].prototype = document.createElement(tagName)['__proto__'];
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Use of __proto__ (no-proto)

                                                                __proto__ property has been deprecated as of ECMAScript 3.1 and shouldn't be used in the code. Use getPrototypeOf method instead.

                                                                Rule Details

                                                                When an object is created __proto__ is set to the original prototype property of the object’s constructor function. getPrototypeOf is the preferred method of getting "the prototype".

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-proto: "error"*/
                                                                
                                                                var a = obj.__proto__;
                                                                
                                                                var a = obj["__proto__"];

                                                                Examples of correct code for this rule:

                                                                /*eslint no-proto: "error"*/
                                                                
                                                                var a = Object.getPrototypeOf(obj);

                                                                When Not To Use It

                                                                If you need to support legacy browsers, you might want to turn this rule off, since support for getPrototypeOf is not yet universal.

                                                                Further Reading

                                                                Avoid arguments.callee.
                                                                Open

                                                                    replacement = arguments.callee.prepareReplacement(replacement);
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Use of caller/callee (no-caller)

                                                                The use of arguments.caller and arguments.callee make several code optimizations impossible. They have been deprecated in future versions of JavaScript and their use is forbidden in ECMAScript 5 while in strict mode.

                                                                function foo() {
                                                                    var callee = arguments.callee;
                                                                }

                                                                Rule Details

                                                                This rule is aimed at discouraging the use of deprecated and sub-optimal code, but disallowing the use of arguments.caller and arguments.callee. As such, it will warn when arguments.caller and arguments.callee are used.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-caller: "error"*/
                                                                
                                                                function foo(n) {
                                                                    if (n <= 0) {
                                                                        return;
                                                                    }
                                                                
                                                                    arguments.callee(n - 1);
                                                                }
                                                                
                                                                [1,2,3,4,5].map(function(n) {
                                                                    return !(n > 1) ? 1 : arguments.callee(n - 1) * n;
                                                                });

                                                                Examples of correct code for this rule:

                                                                /*eslint no-caller: "error"*/
                                                                
                                                                function foo(n) {
                                                                    if (n <= 0) {
                                                                        return;
                                                                    }
                                                                
                                                                    foo(n - 1);
                                                                }
                                                                
                                                                [1,2,3,4,5].map(function factorial(n) {
                                                                    return !(n > 1) ? 1 : factorial(n - 1) * n;
                                                                });

                                                                Source: http://eslint.org/docs/rules/

                                                                The '__proto__' property is deprecated.
                                                                Open

                                                                        document.createElement('form')['__proto__']
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Use of __proto__ (no-proto)

                                                                __proto__ property has been deprecated as of ECMAScript 3.1 and shouldn't be used in the code. Use getPrototypeOf method instead.

                                                                Rule Details

                                                                When an object is created __proto__ is set to the original prototype property of the object’s constructor function. getPrototypeOf is the preferred method of getting "the prototype".

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-proto: "error"*/
                                                                
                                                                var a = obj.__proto__;
                                                                
                                                                var a = obj["__proto__"];

                                                                Examples of correct code for this rule:

                                                                /*eslint no-proto: "error"*/
                                                                
                                                                var a = Object.getPrototypeOf(obj);

                                                                When Not To Use It

                                                                If you need to support legacy browsers, you might want to turn this rule off, since support for getPrototypeOf is not yet universal.

                                                                Further Reading

                                                                Avoid arguments.callee.
                                                                Open

                                                                    var id = element.readAttribute('id'), self = arguments.callee;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Use of caller/callee (no-caller)

                                                                The use of arguments.caller and arguments.callee make several code optimizations impossible. They have been deprecated in future versions of JavaScript and their use is forbidden in ECMAScript 5 while in strict mode.

                                                                function foo() {
                                                                    var callee = arguments.callee;
                                                                }

                                                                Rule Details

                                                                This rule is aimed at discouraging the use of deprecated and sub-optimal code, but disallowing the use of arguments.caller and arguments.callee. As such, it will warn when arguments.caller and arguments.callee are used.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-caller: "error"*/
                                                                
                                                                function foo(n) {
                                                                    if (n <= 0) {
                                                                        return;
                                                                    }
                                                                
                                                                    arguments.callee(n - 1);
                                                                }
                                                                
                                                                [1,2,3,4,5].map(function(n) {
                                                                    return !(n > 1) ? 1 : arguments.callee(n - 1) * n;
                                                                });

                                                                Examples of correct code for this rule:

                                                                /*eslint no-caller: "error"*/
                                                                
                                                                function foo(n) {
                                                                    if (n <= 0) {
                                                                        return;
                                                                    }
                                                                
                                                                    foo(n - 1);
                                                                }
                                                                
                                                                [1,2,3,4,5].map(function factorial(n) {
                                                                    return !(n > 1) ? 1 : factorial(n - 1) * n;
                                                                });

                                                                Source: http://eslint.org/docs/rules/

                                                                Avoid arguments.callee.
                                                                Open

                                                                    var self = arguments.callee;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Use of caller/callee (no-caller)

                                                                The use of arguments.caller and arguments.callee make several code optimizations impossible. They have been deprecated in future versions of JavaScript and their use is forbidden in ECMAScript 5 while in strict mode.

                                                                function foo() {
                                                                    var callee = arguments.callee;
                                                                }

                                                                Rule Details

                                                                This rule is aimed at discouraging the use of deprecated and sub-optimal code, but disallowing the use of arguments.caller and arguments.callee. As such, it will warn when arguments.caller and arguments.callee are used.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-caller: "error"*/
                                                                
                                                                function foo(n) {
                                                                    if (n <= 0) {
                                                                        return;
                                                                    }
                                                                
                                                                    arguments.callee(n - 1);
                                                                }
                                                                
                                                                [1,2,3,4,5].map(function(n) {
                                                                    return !(n > 1) ? 1 : arguments.callee(n - 1) * n;
                                                                });

                                                                Examples of correct code for this rule:

                                                                /*eslint no-caller: "error"*/
                                                                
                                                                function foo(n) {
                                                                    if (n <= 0) {
                                                                        return;
                                                                    }
                                                                
                                                                    foo(n - 1);
                                                                }
                                                                
                                                                [1,2,3,4,5].map(function factorial(n) {
                                                                    return !(n > 1) ? 1 : factorial(n - 1) * n;
                                                                });

                                                                Source: http://eslint.org/docs/rules/

                                                                The '__proto__' property is deprecated.
                                                                Open

                                                                    document.createElement('div')['__proto__']) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Use of __proto__ (no-proto)

                                                                __proto__ property has been deprecated as of ECMAScript 3.1 and shouldn't be used in the code. Use getPrototypeOf method instead.

                                                                Rule Details

                                                                When an object is created __proto__ is set to the original prototype property of the object’s constructor function. getPrototypeOf is the preferred method of getting "the prototype".

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-proto: "error"*/
                                                                
                                                                var a = obj.__proto__;
                                                                
                                                                var a = obj["__proto__"];

                                                                Examples of correct code for this rule:

                                                                /*eslint no-proto: "error"*/
                                                                
                                                                var a = Object.getPrototypeOf(obj);

                                                                When Not To Use It

                                                                If you need to support legacy browsers, you might want to turn this rule off, since support for getPrototypeOf is not yet universal.

                                                                Further Reading

                                                                The '__proto__' property is deprecated.
                                                                Open

                                                                  window.HTMLElement.prototype = document.createElement('div')['__proto__'];
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Use of __proto__ (no-proto)

                                                                __proto__ property has been deprecated as of ECMAScript 3.1 and shouldn't be used in the code. Use getPrototypeOf method instead.

                                                                Rule Details

                                                                When an object is created __proto__ is set to the original prototype property of the object’s constructor function. getPrototypeOf is the preferred method of getting "the prototype".

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-proto: "error"*/
                                                                
                                                                var a = obj.__proto__;
                                                                
                                                                var a = obj["__proto__"];

                                                                Examples of correct code for this rule:

                                                                /*eslint no-proto: "error"*/
                                                                
                                                                var a = Object.getPrototypeOf(obj);

                                                                When Not To Use It

                                                                If you need to support legacy browsers, you might want to turn this rule off, since support for getPrototypeOf is not yet universal.

                                                                Further Reading

                                                                Avoid arguments.callee.
                                                                Open

                                                                    return element._prototypeEventID = [++arguments.callee.id];
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Use of caller/callee (no-caller)

                                                                The use of arguments.caller and arguments.callee make several code optimizations impossible. They have been deprecated in future versions of JavaScript and their use is forbidden in ECMAScript 5 while in strict mode.

                                                                function foo() {
                                                                    var callee = arguments.callee;
                                                                }

                                                                Rule Details

                                                                This rule is aimed at discouraging the use of deprecated and sub-optimal code, but disallowing the use of arguments.caller and arguments.callee. As such, it will warn when arguments.caller and arguments.callee are used.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-caller: "error"*/
                                                                
                                                                function foo(n) {
                                                                    if (n <= 0) {
                                                                        return;
                                                                    }
                                                                
                                                                    arguments.callee(n - 1);
                                                                }
                                                                
                                                                [1,2,3,4,5].map(function(n) {
                                                                    return !(n > 1) ? 1 : arguments.callee(n - 1) * n;
                                                                });

                                                                Examples of correct code for this rule:

                                                                /*eslint no-caller: "error"*/
                                                                
                                                                function foo(n) {
                                                                    if (n <= 0) {
                                                                        return;
                                                                    }
                                                                
                                                                    foo(n - 1);
                                                                }
                                                                
                                                                [1,2,3,4,5].map(function factorial(n) {
                                                                    return !(n > 1) ? 1 : factorial(n - 1) * n;
                                                                });

                                                                Source: http://eslint.org/docs/rules/

                                                                Avoid arguments.callee.
                                                                Open

                                                                    arguments.callee.id = arguments.callee.id || 1;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Use of caller/callee (no-caller)

                                                                The use of arguments.caller and arguments.callee make several code optimizations impossible. They have been deprecated in future versions of JavaScript and their use is forbidden in ECMAScript 5 while in strict mode.

                                                                function foo() {
                                                                    var callee = arguments.callee;
                                                                }

                                                                Rule Details

                                                                This rule is aimed at discouraging the use of deprecated and sub-optimal code, but disallowing the use of arguments.caller and arguments.callee. As such, it will warn when arguments.caller and arguments.callee are used.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-caller: "error"*/
                                                                
                                                                function foo(n) {
                                                                    if (n <= 0) {
                                                                        return;
                                                                    }
                                                                
                                                                    arguments.callee(n - 1);
                                                                }
                                                                
                                                                [1,2,3,4,5].map(function(n) {
                                                                    return !(n > 1) ? 1 : arguments.callee(n - 1) * n;
                                                                });

                                                                Examples of correct code for this rule:

                                                                /*eslint no-caller: "error"*/
                                                                
                                                                function foo(n) {
                                                                    if (n <= 0) {
                                                                        return;
                                                                    }
                                                                
                                                                    foo(n - 1);
                                                                }
                                                                
                                                                [1,2,3,4,5].map(function factorial(n) {
                                                                    return !(n > 1) ? 1 : factorial(n - 1) * n;
                                                                });

                                                                Source: http://eslint.org/docs/rules/

                                                                The '__proto__' property is deprecated.
                                                                Open

                                                                    Event.prototype = Event.prototype || document.createEvent("HTMLEvents")['__proto__'];
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Use of __proto__ (no-proto)

                                                                __proto__ property has been deprecated as of ECMAScript 3.1 and shouldn't be used in the code. Use getPrototypeOf method instead.

                                                                Rule Details

                                                                When an object is created __proto__ is set to the original prototype property of the object’s constructor function. getPrototypeOf is the preferred method of getting "the prototype".

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-proto: "error"*/
                                                                
                                                                var a = obj.__proto__;
                                                                
                                                                var a = obj["__proto__"];

                                                                Examples of correct code for this rule:

                                                                /*eslint no-proto: "error"*/
                                                                
                                                                var a = Object.getPrototypeOf(obj);

                                                                When Not To Use It

                                                                If you need to support legacy browsers, you might want to turn this rule off, since support for getPrototypeOf is not yet universal.

                                                                Further Reading

                                                                Avoid arguments.callee.
                                                                Open

                                                                    arguments.callee.id = arguments.callee.id || 1;
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Disallow Use of caller/callee (no-caller)

                                                                The use of arguments.caller and arguments.callee make several code optimizations impossible. They have been deprecated in future versions of JavaScript and their use is forbidden in ECMAScript 5 while in strict mode.

                                                                function foo() {
                                                                    var callee = arguments.callee;
                                                                }

                                                                Rule Details

                                                                This rule is aimed at discouraging the use of deprecated and sub-optimal code, but disallowing the use of arguments.caller and arguments.callee. As such, it will warn when arguments.caller and arguments.callee are used.

                                                                Examples of incorrect code for this rule:

                                                                /*eslint no-caller: "error"*/
                                                                
                                                                function foo(n) {
                                                                    if (n <= 0) {
                                                                        return;
                                                                    }
                                                                
                                                                    arguments.callee(n - 1);
                                                                }
                                                                
                                                                [1,2,3,4,5].map(function(n) {
                                                                    return !(n > 1) ? 1 : arguments.callee(n - 1) * n;
                                                                });

                                                                Examples of correct code for this rule:

                                                                /*eslint no-caller: "error"*/
                                                                
                                                                function foo(n) {
                                                                    if (n <= 0) {
                                                                        return;
                                                                    }
                                                                
                                                                    foo(n - 1);
                                                                }
                                                                
                                                                [1,2,3,4,5].map(function factorial(n) {
                                                                    return !(n > 1) ? 1 : factorial(n - 1) * n;
                                                                });

                                                                Source: http://eslint.org/docs/rules/

                                                                Move the invocation into the parens that contain the function.
                                                                Open

                                                                  (function(v) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require IIFEs to be Wrapped (wrap-iife)

                                                                You can immediately invoke function expressions, but not function declarations. A common technique to create an immediately-invoked function expression (IIFE) is to wrap a function declaration in parentheses. The opening parentheses causes the contained function to be parsed as an expression, rather than a declaration.

                                                                // function expression could be unwrapped
                                                                var x = function () { return { y: 1 };}();
                                                                
                                                                // function declaration must be wrapped
                                                                function () { /* side effects */ }(); // SyntaxError

                                                                Rule Details

                                                                This rule requires all immediately-invoked function expressions to be wrapped in parentheses.

                                                                Options

                                                                This rule has two options, a string option and an object option.

                                                                String option:

                                                                • "outside" enforces always wrapping the call expression. The default is "outside".
                                                                • "inside" enforces always wrapping the function expression.
                                                                • "any" enforces always wrapping, but allows either style.

                                                                Object option:

                                                                • "functionPrototypeMethods": true additionally enforces wrapping function expressions invoked using .call and .apply. The default is false.

                                                                outside

                                                                Examples of incorrect code for the default "outside" option:

                                                                /*eslint wrap-iife: ["error", "outside"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                Examples of correct code for the default "outside" option:

                                                                /*eslint wrap-iife: ["error", "outside"]*/
                                                                
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                inside

                                                                Examples of incorrect code for the "inside" option:

                                                                /*eslint wrap-iife: ["error", "inside"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                Examples of correct code for the "inside" option:

                                                                /*eslint wrap-iife: ["error", "inside"]*/
                                                                
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                any

                                                                Examples of incorrect code for the "any" option:

                                                                /*eslint wrap-iife: ["error", "any"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped

                                                                Examples of correct code for the "any" option:

                                                                /*eslint wrap-iife: ["error", "any"]*/
                                                                
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                functionPrototypeMethods

                                                                Examples of incorrect code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                
                                                                var x = function(){ foo(); }()
                                                                var x = (function(){ foo(); }())
                                                                var x = function(){ foo(); }.call(bar)
                                                                var x = (function(){ foo(); }.call(bar))

                                                                Examples of correct code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                
                                                                var x = (function(){ foo(); })()
                                                                var x = (function(){ foo(); }).call(bar)

                                                                Source: http://eslint.org/docs/rules/

                                                                Move the invocation into the parens that contain the function.
                                                                Open

                                                                var Hash = Class.create(Enumerable, (function() {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require IIFEs to be Wrapped (wrap-iife)

                                                                You can immediately invoke function expressions, but not function declarations. A common technique to create an immediately-invoked function expression (IIFE) is to wrap a function declaration in parentheses. The opening parentheses causes the contained function to be parsed as an expression, rather than a declaration.

                                                                // function expression could be unwrapped
                                                                var x = function () { return { y: 1 };}();
                                                                
                                                                // function declaration must be wrapped
                                                                function () { /* side effects */ }(); // SyntaxError

                                                                Rule Details

                                                                This rule requires all immediately-invoked function expressions to be wrapped in parentheses.

                                                                Options

                                                                This rule has two options, a string option and an object option.

                                                                String option:

                                                                • "outside" enforces always wrapping the call expression. The default is "outside".
                                                                • "inside" enforces always wrapping the function expression.
                                                                • "any" enforces always wrapping, but allows either style.

                                                                Object option:

                                                                • "functionPrototypeMethods": true additionally enforces wrapping function expressions invoked using .call and .apply. The default is false.

                                                                outside

                                                                Examples of incorrect code for the default "outside" option:

                                                                /*eslint wrap-iife: ["error", "outside"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                Examples of correct code for the default "outside" option:

                                                                /*eslint wrap-iife: ["error", "outside"]*/
                                                                
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                inside

                                                                Examples of incorrect code for the "inside" option:

                                                                /*eslint wrap-iife: ["error", "inside"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                Examples of correct code for the "inside" option:

                                                                /*eslint wrap-iife: ["error", "inside"]*/
                                                                
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                any

                                                                Examples of incorrect code for the "any" option:

                                                                /*eslint wrap-iife: ["error", "any"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped

                                                                Examples of correct code for the "any" option:

                                                                /*eslint wrap-iife: ["error", "any"]*/
                                                                
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                functionPrototypeMethods

                                                                Examples of incorrect code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                
                                                                var x = function(){ foo(); }()
                                                                var x = (function(){ foo(); }())
                                                                var x = function(){ foo(); }.call(bar)
                                                                var x = (function(){ foo(); }.call(bar))

                                                                Examples of correct code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                
                                                                var x = (function(){ foo(); })()
                                                                var x = (function(){ foo(); }).call(bar)

                                                                Source: http://eslint.org/docs/rules/

                                                                Move the invocation into the parens that contain the function.
                                                                Open

                                                                Element.extend = (function() {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require IIFEs to be Wrapped (wrap-iife)

                                                                You can immediately invoke function expressions, but not function declarations. A common technique to create an immediately-invoked function expression (IIFE) is to wrap a function declaration in parentheses. The opening parentheses causes the contained function to be parsed as an expression, rather than a declaration.

                                                                // function expression could be unwrapped
                                                                var x = function () { return { y: 1 };}();
                                                                
                                                                // function declaration must be wrapped
                                                                function () { /* side effects */ }(); // SyntaxError

                                                                Rule Details

                                                                This rule requires all immediately-invoked function expressions to be wrapped in parentheses.

                                                                Options

                                                                This rule has two options, a string option and an object option.

                                                                String option:

                                                                • "outside" enforces always wrapping the call expression. The default is "outside".
                                                                • "inside" enforces always wrapping the function expression.
                                                                • "any" enforces always wrapping, but allows either style.

                                                                Object option:

                                                                • "functionPrototypeMethods": true additionally enforces wrapping function expressions invoked using .call and .apply. The default is false.

                                                                outside

                                                                Examples of incorrect code for the default "outside" option:

                                                                /*eslint wrap-iife: ["error", "outside"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                Examples of correct code for the default "outside" option:

                                                                /*eslint wrap-iife: ["error", "outside"]*/
                                                                
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                inside

                                                                Examples of incorrect code for the "inside" option:

                                                                /*eslint wrap-iife: ["error", "inside"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                Examples of correct code for the "inside" option:

                                                                /*eslint wrap-iife: ["error", "inside"]*/
                                                                
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                any

                                                                Examples of incorrect code for the "any" option:

                                                                /*eslint wrap-iife: ["error", "any"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped

                                                                Examples of correct code for the "any" option:

                                                                /*eslint wrap-iife: ["error", "any"]*/
                                                                
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                functionPrototypeMethods

                                                                Examples of incorrect code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                
                                                                var x = function(){ foo(); }()
                                                                var x = (function(){ foo(); }())
                                                                var x = function(){ foo(); }.call(bar)
                                                                var x = (function(){ foo(); }.call(bar))

                                                                Examples of correct code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                
                                                                var x = (function(){ foo(); })()
                                                                var x = (function(){ foo(); }).call(bar)

                                                                Source: http://eslint.org/docs/rules/

                                                                Move the invocation into the parens that contain the function.
                                                                Open

                                                                        value = (function(m) {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require IIFEs to be Wrapped (wrap-iife)

                                                                You can immediately invoke function expressions, but not function declarations. A common technique to create an immediately-invoked function expression (IIFE) is to wrap a function declaration in parentheses. The opening parentheses causes the contained function to be parsed as an expression, rather than a declaration.

                                                                // function expression could be unwrapped
                                                                var x = function () { return { y: 1 };}();
                                                                
                                                                // function declaration must be wrapped
                                                                function () { /* side effects */ }(); // SyntaxError

                                                                Rule Details

                                                                This rule requires all immediately-invoked function expressions to be wrapped in parentheses.

                                                                Options

                                                                This rule has two options, a string option and an object option.

                                                                String option:

                                                                • "outside" enforces always wrapping the call expression. The default is "outside".
                                                                • "inside" enforces always wrapping the function expression.
                                                                • "any" enforces always wrapping, but allows either style.

                                                                Object option:

                                                                • "functionPrototypeMethods": true additionally enforces wrapping function expressions invoked using .call and .apply. The default is false.

                                                                outside

                                                                Examples of incorrect code for the default "outside" option:

                                                                /*eslint wrap-iife: ["error", "outside"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                Examples of correct code for the default "outside" option:

                                                                /*eslint wrap-iife: ["error", "outside"]*/
                                                                
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                inside

                                                                Examples of incorrect code for the "inside" option:

                                                                /*eslint wrap-iife: ["error", "inside"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                Examples of correct code for the "inside" option:

                                                                /*eslint wrap-iife: ["error", "inside"]*/
                                                                
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                any

                                                                Examples of incorrect code for the "any" option:

                                                                /*eslint wrap-iife: ["error", "any"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped

                                                                Examples of correct code for the "any" option:

                                                                /*eslint wrap-iife: ["error", "any"]*/
                                                                
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                functionPrototypeMethods

                                                                Examples of incorrect code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                
                                                                var x = function(){ foo(); }()
                                                                var x = (function(){ foo(); }())
                                                                var x = function(){ foo(); }.call(bar)
                                                                var x = (function(){ foo(); }.call(bar))

                                                                Examples of correct code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                
                                                                var x = (function(){ foo(); })()
                                                                var x = (function(){ foo(); }).call(bar)

                                                                Source: http://eslint.org/docs/rules/

                                                                Move the invocation into the parens that contain the function.
                                                                Open

                                                                Event.Methods = (function() {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require IIFEs to be Wrapped (wrap-iife)

                                                                You can immediately invoke function expressions, but not function declarations. A common technique to create an immediately-invoked function expression (IIFE) is to wrap a function declaration in parentheses. The opening parentheses causes the contained function to be parsed as an expression, rather than a declaration.

                                                                // function expression could be unwrapped
                                                                var x = function () { return { y: 1 };}();
                                                                
                                                                // function declaration must be wrapped
                                                                function () { /* side effects */ }(); // SyntaxError

                                                                Rule Details

                                                                This rule requires all immediately-invoked function expressions to be wrapped in parentheses.

                                                                Options

                                                                This rule has two options, a string option and an object option.

                                                                String option:

                                                                • "outside" enforces always wrapping the call expression. The default is "outside".
                                                                • "inside" enforces always wrapping the function expression.
                                                                • "any" enforces always wrapping, but allows either style.

                                                                Object option:

                                                                • "functionPrototypeMethods": true additionally enforces wrapping function expressions invoked using .call and .apply. The default is false.

                                                                outside

                                                                Examples of incorrect code for the default "outside" option:

                                                                /*eslint wrap-iife: ["error", "outside"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                Examples of correct code for the default "outside" option:

                                                                /*eslint wrap-iife: ["error", "outside"]*/
                                                                
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                inside

                                                                Examples of incorrect code for the "inside" option:

                                                                /*eslint wrap-iife: ["error", "inside"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                Examples of correct code for the "inside" option:

                                                                /*eslint wrap-iife: ["error", "inside"]*/
                                                                
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                any

                                                                Examples of incorrect code for the "any" option:

                                                                /*eslint wrap-iife: ["error", "any"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped

                                                                Examples of correct code for the "any" option:

                                                                /*eslint wrap-iife: ["error", "any"]*/
                                                                
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                functionPrototypeMethods

                                                                Examples of incorrect code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                
                                                                var x = function(){ foo(); }()
                                                                var x = (function(){ foo(); }())
                                                                var x = function(){ foo(); }.call(bar)
                                                                var x = (function(){ foo(); }.call(bar))

                                                                Examples of correct code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                
                                                                var x = (function(){ foo(); })()
                                                                var x = (function(){ foo(); }).call(bar)

                                                                Source: http://eslint.org/docs/rules/

                                                                Wrap an immediate function invocation in parentheses.
                                                                Open

                                                                if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require IIFEs to be Wrapped (wrap-iife)

                                                                You can immediately invoke function expressions, but not function declarations. A common technique to create an immediately-invoked function expression (IIFE) is to wrap a function declaration in parentheses. The opening parentheses causes the contained function to be parsed as an expression, rather than a declaration.

                                                                // function expression could be unwrapped
                                                                var x = function () { return { y: 1 };}();
                                                                
                                                                // function declaration must be wrapped
                                                                function () { /* side effects */ }(); // SyntaxError

                                                                Rule Details

                                                                This rule requires all immediately-invoked function expressions to be wrapped in parentheses.

                                                                Options

                                                                This rule has two options, a string option and an object option.

                                                                String option:

                                                                • "outside" enforces always wrapping the call expression. The default is "outside".
                                                                • "inside" enforces always wrapping the function expression.
                                                                • "any" enforces always wrapping, but allows either style.

                                                                Object option:

                                                                • "functionPrototypeMethods": true additionally enforces wrapping function expressions invoked using .call and .apply. The default is false.

                                                                outside

                                                                Examples of incorrect code for the default "outside" option:

                                                                /*eslint wrap-iife: ["error", "outside"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                Examples of correct code for the default "outside" option:

                                                                /*eslint wrap-iife: ["error", "outside"]*/
                                                                
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                inside

                                                                Examples of incorrect code for the "inside" option:

                                                                /*eslint wrap-iife: ["error", "inside"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                Examples of correct code for the "inside" option:

                                                                /*eslint wrap-iife: ["error", "inside"]*/
                                                                
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                any

                                                                Examples of incorrect code for the "any" option:

                                                                /*eslint wrap-iife: ["error", "any"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped

                                                                Examples of correct code for the "any" option:

                                                                /*eslint wrap-iife: ["error", "any"]*/
                                                                
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                functionPrototypeMethods

                                                                Examples of incorrect code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                
                                                                var x = function(){ foo(); }()
                                                                var x = (function(){ foo(); }())
                                                                var x = function(){ foo(); }.call(bar)
                                                                var x = (function(){ foo(); }.call(bar))

                                                                Examples of correct code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                
                                                                var x = (function(){ foo(); })()
                                                                var x = (function(){ foo(); }).call(bar)

                                                                Source: http://eslint.org/docs/rules/

                                                                Move the invocation into the parens that contain the function.
                                                                Open

                                                                Object.extend(Event, (function() {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require IIFEs to be Wrapped (wrap-iife)

                                                                You can immediately invoke function expressions, but not function declarations. A common technique to create an immediately-invoked function expression (IIFE) is to wrap a function declaration in parentheses. The opening parentheses causes the contained function to be parsed as an expression, rather than a declaration.

                                                                // function expression could be unwrapped
                                                                var x = function () { return { y: 1 };}();
                                                                
                                                                // function declaration must be wrapped
                                                                function () { /* side effects */ }(); // SyntaxError

                                                                Rule Details

                                                                This rule requires all immediately-invoked function expressions to be wrapped in parentheses.

                                                                Options

                                                                This rule has two options, a string option and an object option.

                                                                String option:

                                                                • "outside" enforces always wrapping the call expression. The default is "outside".
                                                                • "inside" enforces always wrapping the function expression.
                                                                • "any" enforces always wrapping, but allows either style.

                                                                Object option:

                                                                • "functionPrototypeMethods": true additionally enforces wrapping function expressions invoked using .call and .apply. The default is false.

                                                                outside

                                                                Examples of incorrect code for the default "outside" option:

                                                                /*eslint wrap-iife: ["error", "outside"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                Examples of correct code for the default "outside" option:

                                                                /*eslint wrap-iife: ["error", "outside"]*/
                                                                
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                inside

                                                                Examples of incorrect code for the "inside" option:

                                                                /*eslint wrap-iife: ["error", "inside"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                Examples of correct code for the "inside" option:

                                                                /*eslint wrap-iife: ["error", "inside"]*/
                                                                
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                any

                                                                Examples of incorrect code for the "any" option:

                                                                /*eslint wrap-iife: ["error", "any"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped

                                                                Examples of correct code for the "any" option:

                                                                /*eslint wrap-iife: ["error", "any"]*/
                                                                
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                functionPrototypeMethods

                                                                Examples of incorrect code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                
                                                                var x = function(){ foo(); }()
                                                                var x = (function(){ foo(); }())
                                                                var x = function(){ foo(); }.call(bar)
                                                                var x = (function(){ foo(); }.call(bar))

                                                                Examples of correct code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                
                                                                var x = (function(){ foo(); })()
                                                                var x = (function(){ foo(); }).call(bar)

                                                                Source: http://eslint.org/docs/rules/

                                                                Move the invocation into the parens that contain the function.
                                                                Open

                                                                (function() {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require IIFEs to be Wrapped (wrap-iife)

                                                                You can immediately invoke function expressions, but not function declarations. A common technique to create an immediately-invoked function expression (IIFE) is to wrap a function declaration in parentheses. The opening parentheses causes the contained function to be parsed as an expression, rather than a declaration.

                                                                // function expression could be unwrapped
                                                                var x = function () { return { y: 1 };}();
                                                                
                                                                // function declaration must be wrapped
                                                                function () { /* side effects */ }(); // SyntaxError

                                                                Rule Details

                                                                This rule requires all immediately-invoked function expressions to be wrapped in parentheses.

                                                                Options

                                                                This rule has two options, a string option and an object option.

                                                                String option:

                                                                • "outside" enforces always wrapping the call expression. The default is "outside".
                                                                • "inside" enforces always wrapping the function expression.
                                                                • "any" enforces always wrapping, but allows either style.

                                                                Object option:

                                                                • "functionPrototypeMethods": true additionally enforces wrapping function expressions invoked using .call and .apply. The default is false.

                                                                outside

                                                                Examples of incorrect code for the default "outside" option:

                                                                /*eslint wrap-iife: ["error", "outside"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                Examples of correct code for the default "outside" option:

                                                                /*eslint wrap-iife: ["error", "outside"]*/
                                                                
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                inside

                                                                Examples of incorrect code for the "inside" option:

                                                                /*eslint wrap-iife: ["error", "inside"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                Examples of correct code for the "inside" option:

                                                                /*eslint wrap-iife: ["error", "inside"]*/
                                                                
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                any

                                                                Examples of incorrect code for the "any" option:

                                                                /*eslint wrap-iife: ["error", "any"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped

                                                                Examples of correct code for the "any" option:

                                                                /*eslint wrap-iife: ["error", "any"]*/
                                                                
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                functionPrototypeMethods

                                                                Examples of incorrect code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                
                                                                var x = function(){ foo(); }()
                                                                var x = (function(){ foo(); }())
                                                                var x = function(){ foo(); }.call(bar)
                                                                var x = (function(){ foo(); }.call(bar))

                                                                Examples of correct code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                
                                                                var x = (function(){ foo(); })()
                                                                var x = (function(){ foo(); }).call(bar)

                                                                Source: http://eslint.org/docs/rules/

                                                                Move the invocation into the parens that contain the function.
                                                                Open

                                                                Event.extend = (function() {
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js by eslint

                                                                Require IIFEs to be Wrapped (wrap-iife)

                                                                You can immediately invoke function expressions, but not function declarations. A common technique to create an immediately-invoked function expression (IIFE) is to wrap a function declaration in parentheses. The opening parentheses causes the contained function to be parsed as an expression, rather than a declaration.

                                                                // function expression could be unwrapped
                                                                var x = function () { return { y: 1 };}();
                                                                
                                                                // function declaration must be wrapped
                                                                function () { /* side effects */ }(); // SyntaxError

                                                                Rule Details

                                                                This rule requires all immediately-invoked function expressions to be wrapped in parentheses.

                                                                Options

                                                                This rule has two options, a string option and an object option.

                                                                String option:

                                                                • "outside" enforces always wrapping the call expression. The default is "outside".
                                                                • "inside" enforces always wrapping the function expression.
                                                                • "any" enforces always wrapping, but allows either style.

                                                                Object option:

                                                                • "functionPrototypeMethods": true additionally enforces wrapping function expressions invoked using .call and .apply. The default is false.

                                                                outside

                                                                Examples of incorrect code for the default "outside" option:

                                                                /*eslint wrap-iife: ["error", "outside"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                Examples of correct code for the default "outside" option:

                                                                /*eslint wrap-iife: ["error", "outside"]*/
                                                                
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                inside

                                                                Examples of incorrect code for the "inside" option:

                                                                /*eslint wrap-iife: ["error", "inside"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression

                                                                Examples of correct code for the "inside" option:

                                                                /*eslint wrap-iife: ["error", "inside"]*/
                                                                
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                any

                                                                Examples of incorrect code for the "any" option:

                                                                /*eslint wrap-iife: ["error", "any"]*/
                                                                
                                                                var x = function () { return { y: 1 };}(); // unwrapped

                                                                Examples of correct code for the "any" option:

                                                                /*eslint wrap-iife: ["error", "any"]*/
                                                                
                                                                var x = (function () { return { y: 1 };}()); // wrapped call expression
                                                                var x = (function () { return { y: 1 };})(); // wrapped function expression

                                                                functionPrototypeMethods

                                                                Examples of incorrect code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                
                                                                var x = function(){ foo(); }()
                                                                var x = (function(){ foo(); }())
                                                                var x = function(){ foo(); }.call(bar)
                                                                var x = (function(){ foo(); }.call(bar))

                                                                Examples of correct code for this rule with the "inside", { "functionPrototypeMethods": true } options:

                                                                /* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
                                                                
                                                                var x = (function(){ foo(); })()
                                                                var x = (function(){ foo(); }).call(bar)

                                                                Source: http://eslint.org/docs/rules/

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                  next: function(element, expression, index) {
                                                                    element = $(element);
                                                                    if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element));
                                                                    var nextSiblings = element.nextSiblings();
                                                                    return Object.isNumber(expression) ? nextSiblings[expression] :
                                                                Severity: Major
                                                                Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 3 hrs to fix
                                                                js/prototype/prototype-1.6.0.3.js on lines 1753..1759

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 100.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                  previous: function(element, expression, index) {
                                                                    element = $(element);
                                                                    if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element));
                                                                    var previousSiblings = element.previousSiblings();
                                                                    return Object.isNumber(expression) ? previousSiblings[expression] :
                                                                Severity: Major
                                                                Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 3 hrs to fix
                                                                js/prototype/prototype-1.6.0.3.js on lines 1761..1767

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 100.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                  min: function(iterator, context) {
                                                                    iterator = iterator || Prototype.K;
                                                                    var result;
                                                                    this.each(function(value, index) {
                                                                      value = iterator.call(context, value, index);
                                                                Severity: Major
                                                                Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 2 hrs to fix
                                                                js/prototype/prototype-1.6.0.3.js on lines 717..726

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 93.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                  max: function(iterator, context) {
                                                                    iterator = iterator || Prototype.K;
                                                                    var result;
                                                                    this.each(function(value, index) {
                                                                      value = iterator.call(context, value, index);
                                                                Severity: Major
                                                                Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 2 hrs to fix
                                                                js/prototype/prototype-1.6.0.3.js on lines 728..737

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 93.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                  cumulativeScrollOffset: function(element) {
                                                                    var valueT = 0, valueL = 0;
                                                                    do {
                                                                      valueT += element.scrollTop  || 0;
                                                                      valueL += element.scrollLeft || 0;
                                                                Severity: Major
                                                                Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 2 hrs to fix
                                                                js/prototype/prototype-1.6.0.3.js on lines 2010..2018

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 83.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                  cumulativeOffset: function(element) {
                                                                    var valueT = 0, valueL = 0;
                                                                    do {
                                                                      valueT += element.offsetTop  || 0;
                                                                      valueL += element.offsetLeft || 0;
                                                                Severity: Major
                                                                Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 2 hrs to fix
                                                                js/prototype/prototype-1.6.0.3.js on lines 2075..2083

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 83.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if (m = e.match(p)) {
                                                                          this.matcher.push(Object.isFunction(c[i]) ? c[i](m) :
                                                                            new Template(c[i]).evaluate(m));
                                                                          e = e.replace(m[0], '');
                                                                          break;
                                                                Severity: Major
                                                                Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 2 hrs to fix
                                                                js/prototype/prototype-1.6.0.3.js on lines 2817..2822

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 82.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if (m = e.match(ps[i])) {
                                                                          this.matcher.push(Object.isFunction(x[i]) ? x[i](m) :
                                                                            new Template(x[i]).evaluate(m));
                                                                          e = e.replace(m[0], '');
                                                                          break;
                                                                Severity: Major
                                                                Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 2 hrs to fix
                                                                js/prototype/prototype-1.6.0.3.js on lines 2791..2796

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 82.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    'last-child': function(nodes, value, root) {
                                                                      for (var i = 0, results = [], node; node = nodes[i]; i++) {
                                                                        if (Selector.handlers.nextElementSibling(node)) continue;
                                                                          results.push(node);
                                                                      }
                                                                Severity: Major
                                                                Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 2 hrs to fix
                                                                js/prototype/prototype-1.6.0.3.js on lines 3252..3258

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 80.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    'first-child': function(nodes, value, root) {
                                                                      for (var i = 0, results = [], node; node = nodes[i]; i++) {
                                                                        if (Selector.handlers.previousElementSibling(node)) continue;
                                                                          results.push(node);
                                                                      }
                                                                Severity: Major
                                                                Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 2 hrs to fix
                                                                js/prototype/prototype-1.6.0.3.js on lines 3259..3265

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 80.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    'checked': function(nodes, value, root) {
                                                                      for (var i = 0, results = [], node; node = nodes[i]; i++)
                                                                        if (node.checked) results.push(node);
                                                                      return results;
                                                                    }
                                                                Severity: Major
                                                                Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 1 hr to fix
                                                                js/prototype/prototype-1.6.0.3.js on lines 3363..3367

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 68.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    'disabled': function(nodes, value, root) {
                                                                      for (var i = 0, results = [], node; node = nodes[i]; i++)
                                                                        if (node.disabled) results.push(node);
                                                                      return results;
                                                                    },
                                                                Severity: Major
                                                                Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 1 hr to fix
                                                                js/prototype/prototype-1.6.0.3.js on lines 3369..3373

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 68.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                Form.Element.Observer = Class.create(Abstract.TimedObserver, {
                                                                  getValue: function() {
                                                                    return Form.Element.getValue(this.element);
                                                                  }
                                                                });
                                                                Severity: Major
                                                                Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 1 hr to fix
                                                                js/prototype/prototype-1.6.0.3.js on lines 3774..3778

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 58.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                Form.Element.EventObserver = Class.create(Abstract.EventObserver, {
                                                                  getValue: function() {
                                                                    return Form.Element.getValue(this.element);
                                                                  }
                                                                });
                                                                Severity: Major
                                                                Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 1 hr to fix
                                                                js/prototype/prototype-1.6.0.3.js on lines 3721..3725

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 58.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                Form.EventObserver = Class.create(Abstract.EventObserver, {
                                                                  getValue: function() {
                                                                    return Form.serialize(this.element);
                                                                  }
                                                                });
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 40 mins to fix
                                                                js/prototype/prototype-1.6.0.3.js on lines 3727..3731

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 49.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                Form.Observer = Class.create(Abstract.TimedObserver, {
                                                                  getValue: function() {
                                                                    return Form.serialize(this.element);
                                                                  }
                                                                });
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 40 mins to fix
                                                                js/prototype/prototype-1.6.0.3.js on lines 3780..3784

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 49.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        x: event.pageX || (event.clientX +
                                                                          (docElement.scrollLeft || body.scrollLeft) -
                                                                          (docElement.clientLeft || 0)),
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 30 mins to fix
                                                                js/prototype/prototype-1.6.0.3.js on lines 3879..3881

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 45.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        y: event.pageY || (event.clientY +
                                                                          (docElement.scrollTop || body.scrollTop) -
                                                                          (docElement.clientTop || 0))
                                                                Severity: Minor
                                                                Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 30 mins to fix
                                                                js/prototype/prototype-1.6.0.3.js on lines 3876..3878

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 45.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                There are no issues that match your filters.

                                                                Category
                                                                Status