public/assets/js/core/jqtree/tree.jquery.js

Summary

Maintainability
F
1 wk
Test Coverage

File tree.jquery.js has 2363 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Generated by CoffeeScript 1.6.3
/*
Copyright 2013 Marco Braak

Licensed under the Apache License, Version 2.0 (the "License");
Severity: Major
Found in public/assets/js/core/jqtree/tree.jquery.js - About 6 days to fix

    Function has too many statements (62). Maximum allowed is 30.
    Open

      JqTreeWidget = (function(_super) {

    enforce a maximum number of statements allowed in function blocks (max-statements)

    The max-statements rule allows you to specify the maximum number of statements allowed in a function.

    function foo() {
      var bar = 1; // one statement
      var baz = 2; // two statements
      var qux = 3; // three statements
    }

    Rule Details

    This rule enforces a maximum number of statements allowed in function blocks.

    Options

    This rule has a number or object option:

    • "max" (default 10) enforces a maximum number of statements allows in function blocks

    Deprecated: The object property maximum is deprecated; please use the object property max instead.

    This rule has an object option:

    • "ignoreTopLevelFunctions": true ignores top-level functions

    max

    Examples of incorrect code for this rule with the default { "max": 10 } option:

    /*eslint max-statements: ["error", 10]*/
    /*eslint-env es6*/
    
    function foo() {
      var foo1 = 1;
      var foo2 = 2;
      var foo3 = 3;
      var foo4 = 4;
      var foo5 = 5;
      var foo6 = 6;
      var foo7 = 7;
      var foo8 = 8;
      var foo9 = 9;
      var foo10 = 10;
    
      var foo11 = 11; // Too many.
    }
    
    let foo = () => {
      var foo1 = 1;
      var foo2 = 2;
      var foo3 = 3;
      var foo4 = 4;
      var foo5 = 5;
      var foo6 = 6;
      var foo7 = 7;
      var foo8 = 8;
      var foo9 = 9;
      var foo10 = 10;
    
      var foo11 = 11; // Too many.
    };

    Examples of correct code for this rule with the default { "max": 10 } option:

    /*eslint max-statements: ["error", 10]*/
    /*eslint-env es6*/
    
    function foo() {
      var foo1 = 1;
      var foo2 = 2;
      var foo3 = 3;
      var foo4 = 4;
      var foo5 = 5;
      var foo6 = 6;
      var foo7 = 7;
      var foo8 = 8;
      var foo9 = 9;
      var foo10 = 10;
      return function () {
    
        // The number of statements in the inner function does not count toward the
        // statement maximum.
    
        return 42;
      };
    }
    
    let foo = () => {
      var foo1 = 1;
      var foo2 = 2;
      var foo3 = 3;
      var foo4 = 4;
      var foo5 = 5;
      var foo6 = 6;
      var foo7 = 7;
      var foo8 = 8;
      var foo9 = 9;
      var foo10 = 10;
      return function () {
    
        // The number of statements in the inner function does not count toward the
        // statement maximum.
    
        return 42;
      };
    }

    ignoreTopLevelFunctions

    Examples of additional correct code for this rule with the { "max": 10 }, { "ignoreTopLevelFunctions": true } options:

    /*eslint max-statements: ["error", 10, { "ignoreTopLevelFunctions": true }]*/
    
    function foo() {
      var foo1 = 1;
      var foo2 = 2;
      var foo3 = 3;
      var foo4 = 4;
      var foo5 = 5;
      var foo6 = 6;
      var foo7 = 7;
      var foo8 = 8;
      var foo9 = 9;
      var foo10 = 10;
      var foo11 = 11;
    }

    Related Rules

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

    Function _refreshElements has 103 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        JqTreeWidget.prototype._refreshElements = function(from_node) {
          var $element, createFolderLi, createLi, createNodeLi, createUl, doCreateDomElements, escapeIfNecessary, is_root_node, node_element,
            _this = this;
          if (from_node == null) {
            from_node = null;
    Severity: Major
    Found in public/assets/js/core/jqtree/tree.jquery.js - About 4 hrs to fix

      Function 'call' has too many statements (43). Maximum allowed is 30.
      Open

      (function() {

      enforce a maximum number of statements allowed in function blocks (max-statements)

      The max-statements rule allows you to specify the maximum number of statements allowed in a function.

      function foo() {
        var bar = 1; // one statement
        var baz = 2; // two statements
        var qux = 3; // three statements
      }

      Rule Details

      This rule enforces a maximum number of statements allowed in function blocks.

      Options

      This rule has a number or object option:

      • "max" (default 10) enforces a maximum number of statements allows in function blocks

      Deprecated: The object property maximum is deprecated; please use the object property max instead.

      This rule has an object option:

      • "ignoreTopLevelFunctions": true ignores top-level functions

      max

      Examples of incorrect code for this rule with the default { "max": 10 } option:

      /*eslint max-statements: ["error", 10]*/
      /*eslint-env es6*/
      
      function foo() {
        var foo1 = 1;
        var foo2 = 2;
        var foo3 = 3;
        var foo4 = 4;
        var foo5 = 5;
        var foo6 = 6;
        var foo7 = 7;
        var foo8 = 8;
        var foo9 = 9;
        var foo10 = 10;
      
        var foo11 = 11; // Too many.
      }
      
      let foo = () => {
        var foo1 = 1;
        var foo2 = 2;
        var foo3 = 3;
        var foo4 = 4;
        var foo5 = 5;
        var foo6 = 6;
        var foo7 = 7;
        var foo8 = 8;
        var foo9 = 9;
        var foo10 = 10;
      
        var foo11 = 11; // Too many.
      };

      Examples of correct code for this rule with the default { "max": 10 } option:

      /*eslint max-statements: ["error", 10]*/
      /*eslint-env es6*/
      
      function foo() {
        var foo1 = 1;
        var foo2 = 2;
        var foo3 = 3;
        var foo4 = 4;
        var foo5 = 5;
        var foo6 = 6;
        var foo7 = 7;
        var foo8 = 8;
        var foo9 = 9;
        var foo10 = 10;
        return function () {
      
          // The number of statements in the inner function does not count toward the
          // statement maximum.
      
          return 42;
        };
      }
      
      let foo = () => {
        var foo1 = 1;
        var foo2 = 2;
        var foo3 = 3;
        var foo4 = 4;
        var foo5 = 5;
        var foo6 = 6;
        var foo7 = 7;
        var foo8 = 8;
        var foo9 = 9;
        var foo10 = 10;
        return function () {
      
          // The number of statements in the inner function does not count toward the
          // statement maximum.
      
          return 42;
        };
      }

      ignoreTopLevelFunctions

      Examples of additional correct code for this rule with the { "max": 10 }, { "ignoreTopLevelFunctions": true } options:

      /*eslint max-statements: ["error", 10, { "ignoreTopLevelFunctions": true }]*/
      
      function foo() {
        var foo1 = 1;
        var foo2 = 2;
        var foo3 = 3;
        var foo4 = 4;
        var foo5 = 5;
        var foo6 = 6;
        var foo7 = 7;
        var foo8 = 8;
        var foo9 = 9;
        var foo10 = 10;
        var foo11 = 11;
      }

      Related Rules

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

      Function has a complexity of 16.
      Open

          json_str = function(key, holder) {

      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 register has 62 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          SimpleWidget.register = function(widget_class, widget_name) {
            var callFunction, createWidget, destroyWidget, getDataKey;
            getDataKey = function() {
              return "simple_widget_" + widget_name;
            };
      Severity: Major
      Found in public/assets/js/core/jqtree/tree.jquery.js - About 2 hrs to fix

        Function _loadDataFromUrl has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            JqTreeWidget.prototype._loadDataFromUrl = function(url_info, parent_node, on_finished) {
              var $el, addLoadingClass, parseUrlInfo, removeLoadingClass,
                _this = this;
              $el = null;
              addLoadingClass = function() {
        Severity: Major
        Found in public/assets/js/core/jqtree/tree.jquery.js - About 2 hrs to fix

          Function has a complexity of 12.
          Open

                _iterateNode = function(node, next_node) {

          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 handleKeyDown has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              KeyHandler.prototype.handleKeyDown = function(e) {
                var current_node, key, moveDown, moveLeft, moveRight, moveUp, selectNode,
                  _this = this;
                if ($(document.activeElement).is('textarea,input')) {
                  return true;
          Severity: Major
          Found in public/assets/js/core/jqtree/tree.jquery.js - About 2 hrs to fix

            Function _selectNode has 54 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                JqTreeWidget.prototype._selectNode = function(node, must_toggle) {
                  var canSelect, deselected_node, openParents, saveState,
                    _this = this;
                  if (must_toggle == null) {
                    must_toggle = false;
            Severity: Major
            Found in public/assets/js/core/jqtree/tree.jquery.js - About 2 hrs to fix

              Function has a complexity of 8.
              Open

                  DragAndDropHandler.prototype.findHoveredArea = function(x, y) {

              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

                  KeyHandler.prototype.handleKeyDown = function(e) {

              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

                  JqTreeWidget.prototype._selectNode = function(node, must_toggle) {

              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 too many statements (31). Maximum allowed is 30.
              Open

                Node = (function() {

              enforce a maximum number of statements allowed in function blocks (max-statements)

              The max-statements rule allows you to specify the maximum number of statements allowed in a function.

              function foo() {
                var bar = 1; // one statement
                var baz = 2; // two statements
                var qux = 3; // three statements
              }

              Rule Details

              This rule enforces a maximum number of statements allowed in function blocks.

              Options

              This rule has a number or object option:

              • "max" (default 10) enforces a maximum number of statements allows in function blocks

              Deprecated: The object property maximum is deprecated; please use the object property max instead.

              This rule has an object option:

              • "ignoreTopLevelFunctions": true ignores top-level functions

              max

              Examples of incorrect code for this rule with the default { "max": 10 } option:

              /*eslint max-statements: ["error", 10]*/
              /*eslint-env es6*/
              
              function foo() {
                var foo1 = 1;
                var foo2 = 2;
                var foo3 = 3;
                var foo4 = 4;
                var foo5 = 5;
                var foo6 = 6;
                var foo7 = 7;
                var foo8 = 8;
                var foo9 = 9;
                var foo10 = 10;
              
                var foo11 = 11; // Too many.
              }
              
              let foo = () => {
                var foo1 = 1;
                var foo2 = 2;
                var foo3 = 3;
                var foo4 = 4;
                var foo5 = 5;
                var foo6 = 6;
                var foo7 = 7;
                var foo8 = 8;
                var foo9 = 9;
                var foo10 = 10;
              
                var foo11 = 11; // Too many.
              };

              Examples of correct code for this rule with the default { "max": 10 } option:

              /*eslint max-statements: ["error", 10]*/
              /*eslint-env es6*/
              
              function foo() {
                var foo1 = 1;
                var foo2 = 2;
                var foo3 = 3;
                var foo4 = 4;
                var foo5 = 5;
                var foo6 = 6;
                var foo7 = 7;
                var foo8 = 8;
                var foo9 = 9;
                var foo10 = 10;
                return function () {
              
                  // The number of statements in the inner function does not count toward the
                  // statement maximum.
              
                  return 42;
                };
              }
              
              let foo = () => {
                var foo1 = 1;
                var foo2 = 2;
                var foo3 = 3;
                var foo4 = 4;
                var foo5 = 5;
                var foo6 = 6;
                var foo7 = 7;
                var foo8 = 8;
                var foo9 = 9;
                var foo10 = 10;
                return function () {
              
                  // The number of statements in the inner function does not count toward the
                  // statement maximum.
              
                  return 42;
                };
              }

              ignoreTopLevelFunctions

              Examples of additional correct code for this rule with the { "max": 10 }, { "ignoreTopLevelFunctions": true } options:

              /*eslint max-statements: ["error", 10, { "ignoreTopLevelFunctions": true }]*/
              
              function foo() {
                var foo1 = 1;
                var foo2 = 2;
                var foo3 = 3;
                var foo4 = 4;
                var foo5 = 5;
                var foo6 = 6;
                var foo7 = 7;
                var foo8 = 8;
                var foo9 = 9;
                var foo10 = 10;
                var foo11 = 11;
              }

              Related Rules

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

              Function has a complexity of 7.
              Open

                  JqTreeWidget.prototype._init = function() {

              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 iterate has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  VisibleNodeIterator.prototype.iterate = function() {
                    var is_first_node, _iterateNode,
                      _this = this;
                    is_first_node = true;
                    _iterateNode = function(node, next_node) {
              Severity: Minor
              Found in public/assets/js/core/jqtree/tree.jquery.js - About 1 hr to fix

                Function _initScrollParent has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    ScrollHandler.prototype._initScrollParent = function() {
                      var $scroll_parent, getParentWithOverflow, setDocumentAsScrollParent,
                        _this = this;
                      getParentWithOverflow = function() {
                        var css_value, css_values, parent, scroll_parent, _i, _j, _len, _len1, _ref3, _ref4;
                Severity: Minor
                Found in public/assets/js/core/jqtree/tree.jquery.js - About 1 hr to fix

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

                      JqTreeWidget.prototype._getDataUrlInfo = function(node) {
                        var data_url, getUrlFromString,
                          _this = this;
                        data_url = this.options.dataUrl || this.element.data('url');
                        getUrlFromString = function() {
                  Severity: Minor
                  Found in public/assets/js/core/jqtree/tree.jquery.js - About 1 hr to fix

                    Function _init has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        JqTreeWidget.prototype._init = function() {
                          JqTreeWidget.__super__._init.call(this);
                          this.element = this.$el;
                          this.mouse_delay = 300;
                          this.is_initialized = false;
                    Severity: Minor
                    Found in public/assets/js/core/jqtree/tree.jquery.js - About 1 hr to fix

                      Function moveItem has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          DragAndDropHandler.prototype.moveItem = function(position_info) {
                            var doMove, event, moved_node, position, previous_parent, target_node,
                              _this = this;
                            if (this.hovered_area && this.hovered_area.position !== Position.NONE && this.canMoveToArea(this.hovered_area)) {
                              moved_node = this.current_item.node;
                      Severity: Minor
                      Found in public/assets/js/core/jqtree/tree.jquery.js - About 1 hr to fix

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

                            FolderElement.prototype.open = function(on_finished, slide) {
                              var $button, doOpen,
                                _this = this;
                              if (slide == null) {
                                slide = true;
                        Severity: Minor
                        Found in public/assets/js/core/jqtree/tree.jquery.js - About 1 hr to fix

                          Avoid deeply nested control flow statements.
                          Open

                                        if (v) {
                                          partial.push(json_quote(k) + ':' + v);
                                        }
                          Severity: Major
                          Found in public/assets/js/core/jqtree/tree.jquery.js - About 45 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        return null;
                            Severity: Major
                            Found in public/assets/js/core/jqtree/tree.jquery.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                        return (partial.length === 0 ? '{}' : '{' + partial.join(',') + '}');
                              Severity: Major
                              Found in public/assets/js/core/jqtree/tree.jquery.js - About 30 mins to fix

                                The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
                                Open

                                          for (k in node) {

                                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 (!((this.JSON != null) && (this.JSON.stringify != null) && typeof this.JSON.stringify === 'function')) {

                                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.JSON != null) && (this.JSON.stringify != null) && typeof this.JSON.stringify === 'function')) {

                                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.selected_nodes[node.id] = true;

                                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/

                                Return statement should not contain assignment.
                                Open

                                        return this.open_folder_timer = null;

                                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 (is_root == null) {

                                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.name = o;

                                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 (slide == null) {

                                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 (slide == null) {

                                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 (include_children == null) {

                                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

                                        argument1 = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];

                                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 (node_class == null) {

                                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 return with your callback function.
                                Open

                                            result = callback(child, level);

                                Enforce Return After Callback (callback-return)

                                The callback pattern is at the heart of most I/O and event-driven programming in JavaScript.

                                function doSomething(err, callback) {
                                    if (err) {
                                        return callback(err);
                                    }
                                    callback();
                                }

                                To prevent calling the callback multiple times it is important to return anytime the callback is triggered outside of the main function body. Neglecting this technique often leads to issues where you do something more than once. For example, in the case of an HTTP request, you may try to send HTTP headers more than once leading Node.js to throw a Can't render headers after they are sent to the client. error.

                                Rule Details

                                This rule is aimed at ensuring that callbacks used outside of the main function block are always part-of or immediately preceding a return statement. This rule decides what is a callback based on the name of the function being called.

                                Options

                                The rule takes a single option - an array of possible callback names - which may include object methods. The default callback names are callback, cb, next.

                                Default callback names

                                Examples of incorrect code for this rule with the default ["callback", "cb", "next"] option:

                                /*eslint callback-return: "error"*/
                                
                                function foo(err, callback) {
                                    if (err) {
                                        callback(err);
                                    }
                                    callback();
                                }

                                Examples of correct code for this rule with the default ["callback", "cb", "next"] option:

                                /*eslint callback-return: "error"*/
                                
                                function foo(err, callback) {
                                    if (err) {
                                        return callback(err);
                                    }
                                    callback();
                                }

                                Supplied callback names

                                Examples of incorrect code for this rule with the option ["done", "send.error", "send.success"]:

                                /*eslint callback-return: ["error", ["done", "send.error", "send.success"]]*/
                                
                                function foo(err, done) {
                                    if (err) {
                                        done(err);
                                    }
                                    done();
                                }
                                
                                function bar(err, send) {
                                    if (err) {
                                        send.error(err);
                                    }
                                    send.success();
                                }

                                Examples of correct code for this rule with the option ["done", "send.error", "send.success"]:

                                /*eslint callback-return: ["error", ["done", "send.error", "send.success"]]*/
                                
                                function foo(err, done) {
                                    if (err) {
                                        return done(err);
                                    }
                                    done();
                                }
                                
                                function bar(err, send) {
                                    if (err) {
                                        return send.error(err);
                                    }
                                    send.success();
                                }

                                Known Limitations

                                Because it is difficult to understand the meaning of a program through static analysis, this rule has limitations:

                                • false negatives when this rule reports correct code, but the program calls the callback more than one time (which is incorrect behavior)
                                • false positives when this rule reports incorrect code, but the program calls the callback only one time (which is correct behavior)

                                Passing the callback by reference

                                The static analysis of this rule does not detect that the program calls the callback if it is an argument of a function (for example, setTimeout).

                                Example of a false negative when this rule reports correct code:

                                /*eslint callback-return: "error"*/
                                
                                function foo(err, callback) {
                                    if (err) {
                                        setTimeout(callback, 0); // this is bad, but WILL NOT warn
                                    }
                                    callback();
                                }

                                Triggering the callback within a nested function

                                The static analysis of this rule does not detect that the program calls the callback from within a nested function or an immediately-invoked function expression (IIFE).

                                Example of a false negative when this rule reports correct code:

                                /*eslint callback-return: "error"*/
                                
                                function foo(err, callback) {
                                    if (err) {
                                        process.nextTick(function() {
                                            return callback(); // this is bad, but WILL NOT warn
                                        });
                                    }
                                    callback();
                                }

                                If/else statements

                                The static analysis of this rule does not detect that the program calls the callback only one time in each branch of an if statement.

                                Example of a false positive when this rule reports incorrect code:

                                /*eslint callback-return: "error"*/
                                
                                function foo(err, callback) {
                                    if (err) {
                                        callback(err); // this is fine, but WILL warn
                                    } else {
                                        callback();    // this is fine, but WILL warn
                                    }
                                }

                                When Not To Use It

                                There are some cases where you might want to call a callback function more than once. In those cases this rule may lead to incorrect behavior. In those cases you may want to reserve a special name for those callbacks and not include that in the list of callbacks that trigger warnings.

                                Further Reading

                                Related Rules

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

                                      if (node.id != null) {

                                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._supportsLocalStorage == null) {

                                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.drag_element = null;

                                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/

                                The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
                                Open

                                        for (key in o) {

                                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

                                Return statement should not contain assignment.
                                Open

                                      return this.$element = $(node.element);

                                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/

                                Use ‘===’ to compare with ‘null’.
                                Open

                                  if (!((this.JSON != null) && (this.JSON.stringify != null) && typeof this.JSON.stringify === 'function')) {

                                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/

                                Return statement should not contain assignment.
                                Open

                                      return $.fn[widget_name] = function() {

                                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/

                                Return statement should not contain assignment.
                                Open

                                      return this._is_mouse_delay_met = false;

                                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/

                                Return statement should not contain assignment.
                                Open

                                        return this.id_mapping[node.id] = node;

                                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 (must_toggle == null) {

                                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 url_info.method = 'get';

                                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/

                                Use ‘===’ to compare with ‘null’.
                                Open

                                      if (slide == null) {

                                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

                                  if (!((this.JSON != null) && (this.JSON.stringify != null) && typeof this.JSON.stringify === 'function')) {

                                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/

                                Return statement should not contain assignment.
                                Open

                                        return this.parent = null;

                                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/

                                Use ‘===’ to compare with ‘null’.
                                Open

                                      if (slide == null) {

                                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 (from_node == null) {

                                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.selected_single_node = null;

                                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/

                                Return statement should not contain assignment.
                                Open

                                      return this.hit_areas = hit_areas_generator.generate();

                                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/

                                Return statement should not contain assignment.
                                Open

                                        return this.previous_top = -1;

                                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 (slide == null) {

                                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 (include_children == null) {

                                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 (is_root == null) {

                                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 (slide == null) {

                                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 (slide == null) {

                                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/

                                Return statement should not contain assignment.
                                Open

                                      return this.previous_ghost = node_element.addDropHint(this.hovered_area.position);

                                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/

                                Return statement should not contain assignment.
                                Open

                                      return this.open_folder_timer = setTimeout(openFolder, 500);

                                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/

                                Return statement should not contain assignment.
                                Open

                                        return _this.$scroll_parent = null;

                                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/

                                Return statement should not contain assignment.
                                Open

                                        return this.previous_top = -1;

                                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/

                                Return statement should not contain assignment.
                                Open

                                      return this.mouse_delay = mouse_delay;

                                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 (slide == null) {

                                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 (from_node == null) {

                                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

                                      if (slide == null) {

                                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

                                      if (this._supportsLocalStorage == null) {

                                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

                                      if (include_children == null) {

                                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 (slide == null) {

                                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/

                                Missing radix parameter.
                                Open

                                        max_level = parseInt(this.options.autoOpen);

                                Require Radix Parameter (radix)

                                When using the parseInt() function it is common to omit the second argument, the radix, and let the function try to determine from the first argument what type of number it is. By default, parseInt() will autodetect decimal and hexadecimal (via 0x prefix). Prior to ECMAScript 5, parseInt() also autodetected octal literals, which caused problems because many developers assumed a leading 0 would be ignored.

                                This confusion led to the suggestion that you always use the radix parameter to parseInt() to eliminate unintended consequences. So instead of doing this:

                                var num = parseInt("071");      // 57

                                Do this:

                                var num = parseInt("071", 10);  // 71

                                ECMAScript 5 changed the behavior of parseInt() so that it no longer autodetects octal literals and instead treats them as decimal literals. However, the differences between hexadecimal and decimal interpretation of the first parameter causes many developers to continue using the radix parameter to ensure the string is interpreted in the intended way.

                                On the other hand, if the code is targeting only ES5-compliant environments passing the radix 10 may be redundant. In such a case you might want to disallow using such a radix.

                                Rule Details

                                This rule is aimed at preventing the unintended conversion of a string to a number of a different base than intended or at preventing the redundant 10 radix if targeting modern environments only.

                                Options

                                There are two options for this rule:

                                • "always" enforces providing a radix (default)
                                • "as-needed" disallows providing the 10 radix

                                always

                                Examples of incorrect code for the default "always" option:

                                /*eslint radix: "error"*/
                                
                                var num = parseInt("071");
                                
                                var num = parseInt(someValue);
                                
                                var num = parseInt("071", "abc");
                                
                                var num = parseInt();

                                Examples of correct code for the default "always" option:

                                /*eslint radix: "error"*/
                                
                                var num = parseInt("071", 10);
                                
                                var num = parseInt("071", 8);
                                
                                var num = parseFloat(someValue);

                                as-needed

                                Examples of incorrect code for the "as-needed" option:

                                /*eslint radix: ["error", "as-needed"]*/
                                
                                var num = parseInt("071", 10);
                                
                                var num = parseInt("071", "abc");
                                
                                var num = parseInt();

                                Examples of correct code for the "as-needed" option:

                                /*eslint radix: ["error", "as-needed"]*/
                                
                                var num = parseInt("071");
                                
                                var num = parseInt("071", 8);
                                
                                var num = parseFloat(someValue);

                                When Not To Use It

                                If you don't want to enforce either presence or omission of the 10 radix value you can turn this rule off.

                                Further Reading

                                Unexpected control character(s) in regular expression: \x00, \x1f, \x7f-, \x9f, \u00ad, \u0600-, \u0604, \u070f, \u17b4, \u17b5, \u200c-, \u200f, \u2028-, \u202f, \u2060-, \u206f, \ufeff, \ufff0-, \uffff]/.
                                Open

                                    json_escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;

                                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

                                Return statement should not contain assignment.
                                Open

                                        return _this._is_mouse_delay_met = true;

                                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.JSON == null) {

                                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 (slide == null) {

                                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

                                      if (must_toggle == null) {

                                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

                                    if (this.JSON == null) {

                                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/

                                Return statement should not contain assignment.
                                Open

                                          return this.selected_single_node = null;

                                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/

                                Return statement should not contain assignment.
                                Open

                                        return this.selected_single_node = node;

                                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/

                                Return statement should not contain assignment.
                                Open

                                      return this.hit_areas = [];

                                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/

                                Return statement should not contain assignment.
                                Open

                                      return this.hovered_area = null;

                                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 (node.id != null) {

                                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 (slide == null) {

                                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/

                                The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
                                Open

                                        for (id in this.selected_nodes) {

                                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

                                Return statement should not contain assignment.
                                Open

                                      return this.last_top = top;

                                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/

                                Use ‘===’ to compare with ‘null’.
                                Open

                                      if (node.id != null) {

                                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

                                      if (node.id != null) {

                                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/

                                Return statement should not contain assignment.
                                Open

                                      return this.children = [];

                                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/

                                Return statement should not contain assignment.
                                Open

                                      return this.mouse_down_info = null;

                                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 (node_class == null) {

                                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 (slide == null) {

                                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 (slide == null) {

                                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 (include_children == null) {

                                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/

                                Return statement should not contain assignment.
                                Open

                                        return this.scroll_parent_top = this.$scroll_parent.offset().top;

                                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/

                                Return statement should not contain assignment.
                                Open

                                        return this.$scroll_parent[0].scrollTop = top;

                                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/

                                Move the invocation into the parens that contain the function.
                                Open

                                  NodeElement = (function() {

                                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

                                  SelectNodeHandler = (function() {

                                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

                                  SimpleWidget = (function() {

                                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

                                  FolderElement = (function(_super) {

                                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

                                  VisibleNodeIterator = (function() {

                                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

                                  BorderDropHint = (function() {

                                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

                                  KeyHandler = (function() {

                                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

                                  Node = (function() {

                                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

                                  HitAreasGenerator = (function(_super) {

                                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

                                  DragElement = (function() {

                                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

                                  GhostDropHint = (function() {

                                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

                                  DragAndDropHandler = (function() {

                                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

                                  JqTreeWidget = (function(_super) {

                                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

                                  MouseWidget = (function(_super) {

                                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

                                  SaveStateHandler = (function() {

                                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

                                  ScrollHandler = (function() {

                                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/

                                Expected 'undefined' and instead saw 'void'.
                                Open

                                        if (argument1 === void 0 || typeof argument1 === 'object') {

                                Disallow use of the void operator. (no-void)

                                The void operator takes an operand and returns undefined: void expression will evaluate expression and return undefined. It can be used to ignore any side effects expression may produce:

                                The common case of using void operator is to get a "pure" undefined value as prior to ES5 the undefined variable was mutable:

                                // will always return undefined
                                (function(){
                                    return void 0;
                                })();
                                
                                // will return 1 in ES3 and undefined in ES5+
                                (function(){
                                    undefined = 1;
                                    return undefined;
                                })();
                                
                                // will throw TypeError in ES5+
                                (function(){
                                    'use strict';
                                    undefined = 1;
                                })();

                                Another common case is to minify code as void 0 is shorter than undefined:

                                foo = void 0;
                                foo = undefined;

                                When used with IIFE (immediately-invoked function expression), void can be used to force the function keyword to be treated as an expression instead of a declaration:

                                var foo = 1;
                                void function(){ foo = 1; }() // will assign foo a value of 1
                                +function(){ foo = 1; }() // same as above
                                function(){ foo = 1; }() // will throw SyntaxError

                                Some code styles prohibit void operator, marking it as non-obvious and hard to read.

                                Rule Details

                                This rule aims to eliminate use of void operator.

                                Examples of incorrect code for this rule:

                                /*eslint no-void: "error"*/
                                
                                void foo
                                
                                var foo = void bar();

                                When Not To Use It

                                If you intentionally use the void operator then you can disable this rule.

                                Further Reading

                                Related Rules

                                Identical blocks of code found in 3 locations. Consider refactoring.
                                Open

                                    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
                                Severity: Major
                                Found in public/assets/js/core/jqtree/tree.jquery.js and 2 other locations - About 4 hrs to fix
                                public/assets/js/core/chosen/chosen.jquery.js on lines 16..16
                                public/assets/js/core/chosen/chosen.proto.js on lines 16..16

                                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 119.

                                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

                                    MouseWidget.prototype._touchMove = function(e) {
                                      var touch;
                                      if (e.originalEvent.touches.length > 1) {
                                        return;
                                      }
                                Severity: Major
                                Found in public/assets/js/core/jqtree/tree.jquery.js and 1 other location - About 2 hrs to fix
                                public/assets/js/core/jqtree/tree.jquery.js on lines 270..277

                                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 89.

                                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

                                    MouseWidget.prototype._touchStart = function(e) {
                                      var touch;
                                      if (e.originalEvent.touches.length > 1) {
                                        return;
                                      }
                                Severity: Major
                                Found in public/assets/js/core/jqtree/tree.jquery.js and 1 other location - About 2 hrs to fix
                                public/assets/js/core/jqtree/tree.jquery.js on lines 279..286

                                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 89.

                                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 3 locations. Consider refactoring.
                                Open

                                    JqTreeWidget.prototype.addNodeBefore = function(new_node_info, existing_node) {
                                      var new_node;
                                      new_node = existing_node.addBefore(new_node_info);
                                      this._refreshElements(existing_node.parent);
                                      return new_node;
                                Severity: Major
                                Found in public/assets/js/core/jqtree/tree.jquery.js and 2 other locations - About 1 hr to fix
                                public/assets/js/core/jqtree/tree.jquery.js on lines 1061..1066
                                public/assets/js/core/jqtree/tree.jquery.js on lines 1075..1080

                                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 60.

                                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 3 locations. Consider refactoring.
                                Open

                                    JqTreeWidget.prototype.addParentNode = function(new_node_info, existing_node) {
                                      var new_node;
                                      new_node = existing_node.addParent(new_node_info);
                                      this._refreshElements(new_node.parent);
                                      return new_node;
                                Severity: Major
                                Found in public/assets/js/core/jqtree/tree.jquery.js and 2 other locations - About 1 hr to fix
                                public/assets/js/core/jqtree/tree.jquery.js on lines 1061..1066
                                public/assets/js/core/jqtree/tree.jquery.js on lines 1068..1073

                                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 60.

                                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 3 locations. Consider refactoring.
                                Open

                                    JqTreeWidget.prototype.addNodeAfter = function(new_node_info, existing_node) {
                                      var new_node;
                                      new_node = existing_node.addAfter(new_node_info);
                                      this._refreshElements(existing_node.parent);
                                      return new_node;
                                Severity: Major
                                Found in public/assets/js/core/jqtree/tree.jquery.js and 2 other locations - About 1 hr to fix
                                public/assets/js/core/jqtree/tree.jquery.js on lines 1068..1073
                                public/assets/js/core/jqtree/tree.jquery.js on lines 1075..1080

                                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 60.

                                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 3 locations. Consider refactoring.
                                Open

                                    JqTreeWidget.prototype._mouseStop = function(position_info) {
                                      if (this.options.dragAndDrop) {
                                        return this.dnd_handler.mouseStop(position_info);
                                      } else {
                                        return false;
                                Severity: Major
                                Found in public/assets/js/core/jqtree/tree.jquery.js and 2 other locations - About 1 hr to fix
                                public/assets/js/core/jqtree/tree.jquery.js on lines 1516..1522
                                public/assets/js/core/jqtree/tree.jquery.js on lines 1524..1530

                                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 3 locations. Consider refactoring.
                                Open

                                    JqTreeWidget.prototype._mouseCapture = function(position_info) {
                                      if (this.options.dragAndDrop) {
                                        return this.dnd_handler.mouseCapture(position_info);
                                      } else {
                                        return false;
                                Severity: Major
                                Found in public/assets/js/core/jqtree/tree.jquery.js and 2 other locations - About 1 hr to fix
                                public/assets/js/core/jqtree/tree.jquery.js on lines 1524..1530
                                public/assets/js/core/jqtree/tree.jquery.js on lines 1545..1551

                                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 3 locations. Consider refactoring.
                                Open

                                    JqTreeWidget.prototype._mouseStart = function(position_info) {
                                      if (this.options.dragAndDrop) {
                                        return this.dnd_handler.mouseStart(position_info);
                                      } else {
                                        return false;
                                Severity: Major
                                Found in public/assets/js/core/jqtree/tree.jquery.js and 2 other locations - About 1 hr to fix
                                public/assets/js/core/jqtree/tree.jquery.js on lines 1516..1522
                                public/assets/js/core/jqtree/tree.jquery.js on lines 1545..1551

                                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

                                      if (typeof DragAndDropHandler !== "undefined" && DragAndDropHandler !== null) {
                                        this.dnd_handler = new DragAndDropHandler(this);
                                      } else {
                                        this.options.dragAndDrop = false;
                                      }
                                Severity: Major
                                Found in public/assets/js/core/jqtree/tree.jquery.js and 1 other location - About 1 hr to fix
                                public/assets/js/core/jqtree/tree.jquery.js on lines 1181..1185

                                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 55.

                                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 (typeof SaveStateHandler !== "undefined" && SaveStateHandler !== null) {
                                        this.save_state_handler = new SaveStateHandler(this);
                                      } else {
                                        this.options.saveState = false;
                                      }
                                Severity: Major
                                Found in public/assets/js/core/jqtree/tree.jquery.js and 1 other location - About 1 hr to fix
                                public/assets/js/core/jqtree/tree.jquery.js on lines 1189..1193

                                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 55.

                                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

                                    JqTreeWidget.prototype.removeFromSelection = function(node) {
                                      this.select_node_handler.removeFromSelection(node);
                                      return this._getNodeElementForNode(node).deselect();
                                    };
                                Severity: Minor
                                Found in public/assets/js/core/jqtree/tree.jquery.js and 1 other location - About 55 mins to fix
                                public/assets/js/core/jqtree/tree.jquery.js on lines 1142..1145

                                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 54.

                                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

                                    JqTreeWidget.prototype.addToSelection = function(node) {
                                      this.select_node_handler.addToSelection(node);
                                      return this._getNodeElementForNode(node).select();
                                    };
                                Severity: Minor
                                Found in public/assets/js/core/jqtree/tree.jquery.js and 1 other location - About 55 mins to fix
                                public/assets/js/core/jqtree/tree.jquery.js on lines 1155..1158

                                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 54.

                                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 (slide) {
                                          return this.getUl().slideDown('fast', doOpen);
                                        } else {
                                          this.getUl().show();
                                          return doOpen();
                                Severity: Minor
                                Found in public/assets/js/core/jqtree/tree.jquery.js and 1 other location - About 55 mins to fix
                                public/assets/js/core/jqtree/tree.jquery.js on lines 1689..1694

                                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 53.

                                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 (slide) {
                                          return this.getUl().slideUp('fast', doClose);
                                        } else {
                                          this.getUl().hide();
                                          return doClose();
                                Severity: Minor
                                Found in public/assets/js/core/jqtree/tree.jquery.js and 1 other location - About 55 mins to fix
                                public/assets/js/core/jqtree/tree.jquery.js on lines 1663..1668

                                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 53.

                                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 (distance_bottom < 20) {
                                        this.$scroll_parent[0].scrollTop += 20;
                                        this.tree_widget.refreshHitAreas();
                                        return this.previous_top = -1;
                                      } else if ((area.top - this.scroll_parent_top) < 20) {
                                Severity: Minor
                                Found in public/assets/js/core/jqtree/tree.jquery.js and 1 other location - About 45 mins to fix
                                public/assets/js/core/jqtree/tree.jquery.js on lines 2577..2581

                                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 50.

                                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

                                      } else if ((area.top - this.scroll_parent_top) < 20) {
                                        this.$scroll_parent[0].scrollTop -= 20;
                                        this.tree_widget.refreshHitAreas();
                                        return this.previous_top = -1;
                                      }
                                Severity: Minor
                                Found in public/assets/js/core/jqtree/tree.jquery.js and 1 other location - About 45 mins to fix
                                public/assets/js/core/jqtree/tree.jquery.js on lines 2573..2581

                                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 50.

                                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