Details

    • Story Points:
      40

      Description

      Id Description Details JSLint Option JSHint Option
      a_label '{a}' is a statement label. Looks for references to label identifiers in code (not as break/continue jumps).    
      a_not_allowed '{a}' is not allowed. Appears to be unused.    
      a_not_defined '{a}' is not defined. Appears to be unused.    
      a_scope '{a}' used out of scope. Unable to trigger, even with example at http://stackoverflow.com/questions/2485171/jslint-out-of-scope-error   funscope
      already_defined '{a}' is already defined. Looks for variables defined multiple times (not in global scope).   shadow
      and The '&&' subexpression should be wrapped in parens. Looks for && inside || expression. Warning.
      assign_exception Do not assign to the exception parameter. Looks for assignment to errors in catch blocks. Warning.
      assignment_function_expression Expected an assignment or function call and instead saw an expression. Looks for statements without any assignment or function call - which indicates unused code. (say 1+2   expr
      avoid_a Avoid '{a}'. Looks for calls to 'arguments.callee' and 'arguments.caller'. Warning.   noarg
      bad_assignment Bad assignment. Checks for assignments to non-identifiers, or to arguments array/object. Warning.
      bad_constructor Bad constructor. Looks for construction where an expression is used in place of identifier (like a ternary to choose the function)    
      bad_in_a Bad for in variable '{a}'. Looks for non-local vars in for in loops.    
      bad_invocation Bad invocation. Looks for '()' calls with a non-identifer left-hand side (and not '.', '[', '(', '&&', '||', or '?') like "/regexp/(7);'. See https://github.com/douglascrockford/JSLint/blob/master/jslint.js#L3599    
      bad_new Do not use 'new' for side effects. Looks for new Foo() without assignment.    
      bad_number Bad number '{a}'. Looks for numbers outside the allowable range of -1.7976931348623157e+308 to 1.7976931348623157e+308 (Number.MAX_VALUE). Warning.
      bad_operand Bad operand. Looks for ++ and – operands with non-identifier first tokens (i.e. '!foo++') plusplus plusplus
      bad_wrap Do not wrap function literals in parens unless they are to be immediately invoked. Checks for functions wrapped in parens that are not immediately invoked (followed by paren pair).   immed
      combine_var Combine this with the previous 'var' statement. Looks for variable declarations on separate lines/statements that can be combined.   vars
      conditional_assignment Expected a conditional expression and instead saw an assignment. Looks for assignments inside if/switch/while/do-while/for(second statement)/left-side of ternary/either side of || and &&   boss
      confusing_a Confusing use of '{a}'. Looks for use of '+++', '---' and specific cases of '!' negation.    
      confusing_regexp Confusing regular expression. Looks for '/' or '*' at end of regexp. (i.e. '/regexp//')    
      constructor_name_a A constructor name '{a}' should start with an uppercase letter. Looks for calls to 'new something()' where 'something' is just a lowercase identifier. Warning. newcap newcap
      control_a Unexpected control character '{a}'. checks for control characters in strings (checks if character is less than ' ')
      dangling_a Unexpected dangling '_' in '{a}'. if 'nomen' option is false (default is true) and identifier starts or ends with '_' character   proto
      dangerous_comment Dangerous comment. Looks for comments with content matching /@cc|<\/?|script|]\s*]|<\s*!|&lt/i safe  
      deleted Only properties should be deleted. Looks for delete keyword before identifiers to ensure it's a property using '.' or '[' access. Warning.
      duplicate_a Duplicate '{a}'. Looks for duplicate case, duplicate ES5 getter/setter, duplicate JSON property string.    
      empty_block Empty block. Looks for blocks with no code (for/if/else/catch/function/etc)   noempty
      empty_case Empty case. Looks for empty case blocks in switch statements. Warning.    
      empty_class Empty class. Looks for an empty '[]' inside a regexp. Warning.    
      es5 This is an ES5 feature. Looks for ES5 getters, or line continuations inside strings (\ before EOL in middle of string). es5 es5
      evil eval is evil. Looks for calls to 'eval' or 'execScript' (globally, on object, on object using [] notation) if 'evil' option is false. Warning. evil evil
      expected_a Expected '{a}'. If in JSON mode and string doesn't use double quotes (expects '"'). ? Also relates to unexpected spaces white/es5 trailing
      expected_identifier_a Expected an identifier and instead saw '{a}'. Looks for missing identifiers (say in var decls)    
      expected_identifier_a_reserved Expected an identifier and instead saw '{a}' (a reserved word). Looks for use of a reserved word in place of an identifier (say in var names or function names) es5 esnext
      expected_number_a Expected a number and instead saw '{a}'. Looks for digits 0-9 inside {} counts in regexps.    
      expected_operator_a Expected an operator and instead saw '{a}'. Unable to reproduce.    
      for_if The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype. Looks for for (x in foo) with an if statement in the block. Basically looking for checking properties in objects. forin forin
      function_block Function statements should not be placed in blocks . Use a function expression or move the statement to the top of the outer function. Looks for functions declared in blocks (for/while/do/else/if/etc).    
      function_eval The Function constructor is eval. Looks for calls to Function() constructor if 'evil' option is false. Warning. evil evil
      function_loop Don't make functions within a loop. Looks for functions or get/setters defined inside loops. (function_block is checked first, so to trigger you need to assign function to something so we get "prefix" function rule rather than "statement" function rule).   loopfunc
      function_statement Function statements are not invocable . Wrap the whole function invocation in parens. Looks for parens after function declaration. (self-invoking, but no assignment)    
      function_strict Use the function form of 'use strict'. Looks of ruse of "use strict"; in top-level/global scope, or as part of multiple statements on same line (not the first statement in that list.)    
      html_confusion_a HTML confusion in regular expression '<{a}'. Looks for '</' or '<!' in regexps when JS is inside a script tag.    
      implied_evil Implied eval is evil. Pass a function instead of a string. Looks for calls to 'setTimeout' or 'setInterval' with string as first arg. Warning. evil evil
      infix_in Unexpected 'in'. Compare with undefined, or use the hasOwnProperty method instead. Looks for use of 'x in y' outside of forin loops. (i.e. "if (x in y) {}")    
      insecure_a Insecure '{a}'. Looks for use of '.' or '[^' in regexps. regexp regexp
      isNaN Use the isNaN function to compare with NaN. Checks left and right hand side of comparators ('==','===','!=','!==','<','>','<=','>=') for 'NaN'. Warning.
      label_a_b Label '{a}' on '{b}' statement. Unused.    
      leading_decimal_a A leading decimal point can be confused with a dot: '.{a}'. Looks for numbers with leading '.'. Warning.
      missing_use_strict Missing 'use strict' statement. Looks for "use strict"; at top of function/try bodies.   sloppy
      move_invocation Move the invocation into the parens that contain the function. Looks for self-invoking function where invocation parens are outside the set of parents wrapping the function declaration.    
      move_var Move 'var' declarations to the top of the function. Looks for var declarations inside 'for' first segment.    
      name_function Missing name in function statement. Looks for 'function ()' (function with no name). Error.
      nested_comment Nested comment. Looks for nested '/*' inside multiline comments.    
      not_a_constructor Do not use {a} as a constructor. Don't call constructor for 'Number', 'String', 'Boolean', 'Math', 'JSON'    
      not_a_defined '{a}' has not been fully defined yet. Appears to be unused.    
      not_a_function '{a}' is not a function. Looks for calls to Math/JSON as a function.    
      not_a_label '{a}' is not a label. Looks for break/continue jumps to labels that don't exist.    
      not_a_scope '{a}' is out of scope. Unable to reproduce.   funscope
      not_greater '{a}' should not be greater than '{b}'. Looks for use of {} counting in regexps with first number greater than second.
      octal_a Don't use octal: '{a}'. Use '\u....' instead. Looks for escaped 0-6 digit in string (i.e. \0).    
      parameter_a_get_b Unexpected parameter '{a}' in get {b} function. Looks for ES5 getter with parameters (should have none).    
      parameter_arguments_a Do not mutate parameter '{a}' when using 'arguments'. Looks for assignment to any function's params when body refers to arguments array.    
      parameter_set_a Expected parameter (value) in set {a} function. Looks for ES5 setter function, ensures it has one parameter with name 'value'.
      radix Missing radix parameter. Calls to parseInt with one arg. Warning.
      read_only Read only. Looks for assignment to predefined objects like Array or Object.    
      redefinition_a Redefinition of '{a}'. Appears to be unused    
      reserved_a Reserved name '{a}'. checks if an identifier token is '__iterator__' or '__proto__'. Error.   iterator/proto
      slash_equal A regular expression literal can be confused with '/='. Looks for '/='.    
      strange_loop Strange loop. Checks do, for, while loops for break/return/continue/throw (at top-level of block, not inside condition). Warning.   curly
      strict Strict violation. Looks for access to this inside function after "use strict"; or access to arguments in global scope after "use strict";. strict strict
      subscript ['\{a\}'] is better written in dot notation. Checks for [''] notation property access when 'sub' option is false. String must be an identifier and not reserved. Warning.   sub
      sync_a Unexpected sync method: '{a}'. Looks for method calls containing 'Sync' in their name if 'stupid' option is false. Warning. stupid  
      trailing_decimal_a A trailing decimal point can be confused with a dot: '.{a}'. Checks for numbers ending in '.' character. Warning.
      unescaped_a Unescaped '{a}'. Looks for unescaped '/', '^', [', ']', ')', '(', '+', '-', '*' in regexps   regexp
      unexpected_a Unexpected '{a}'. if a hex character is

      i >= 32 && i <= 126 && i !== 34 && i !== 92 && i !== 39

      . Also, looks for use of ++ and – if 'plusplus' option is false. Is this definition complete? Seems to relate to a number of things

      bitwise/plusplus/debug bitwise/plusplus/debug
      unexpected_property_a Unexpected /*property*/ '{a}'. Looks for assignment/use of a property (in code) that is declared in special properties directive in comments.    
      unnecessary_initialize It is not necessary to initialize '{a}' to 'undefined'. Looks for 'var foo = undefined;' statements.    
      unnecessary_use Unnecessary 'use strict'. Looks for multiple "use strict"; in scope.    
      unreachable_a_b Unreachable '{a}' after '{b}'. Looks for unreachable statements (after break/continue/return)    
      unsafe Unsafe character. Looks for any control character in the source with a match against:

      /[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/

      url JavaScript URL. Checks string or range tokens, label names, combined 'primitive' strings from '+' concat against regexp:

      jx = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i

        scripturl
      use_array Use the array literal notation []. Checks for 'new Array();', 'new Array', and 'string.split(1)'. Warning.
      use_braces Spaces are hard to count. Use a. Checks regexps for continuous spaces and asks user to replace with explicit count of spaces using {2} notation. Warning.   curly
      use_charAt Use the charAt method. Appears to be unused/unchecked
      use_object Use the object literal notation {}. Checks for 'new Object()' or 'var foo = Object()'. Warning.
      use_or Use the || operator. If a ternary's first and second objects (before and after '?') are 'similar'*. Warning.
      use_param Use a named parameter. Checks for access to 'arguments' array with a number. Warning.
      used_before_a '{a}' was used before it was defined. If 'undef' option is false and if the variable is not in scope, and is not predefined, and if we are not in the global scope, then we have an undefined variable error. Or if a function is called inside another function and has not yet been defined. Warning. undef latedef/undef
      var_a_not Variable {a} was not declared correctly. Checks for broken var assignment (here 'foo') of form

      var bar = foo = 'something';

      . Error.

      weird_assignment Weird assignment. Checks if left and right of '=' assigment are 'similar*. Warning
      weird_condition Weird condition. Checks if left and right of '||' or '&&' are 'similar*. Also checks if condition keyword is followed by a non-infix '-'. Lastly checks if condition keyword is followed by '{' or '(.<number>'. Warning.
      weird_new Weird construction. Delete 'new'. Checks for 'new function'? Warning.   supernew
      weird_program Weird program. Checks if we've hit a 'disrupting' statement (return/break/continue/throw) at the top-level? Warning.
      weird_relation Weird relation. Checks if left and right of comparators are 'similar'*, or both are either numbers or strings. Checks '==', '===', '===','Unable to render embedded object: File (=', ') not found.==', '!==', '<', '>', '<=', '>='. Warning.
      weird_ternary Weird ternary. If the two values we're choosing between are 'similar'*. Warning.
      wrap_immediate Wrap an immediate function invocation in parentheses to assist the reader in understanding that the expression is the result of a function, and not the function itself. Checks if function is declared and then immediately invoked for it's return value. See http://stackoverflow.com/questions/939386/immediate-function-invocation-syntax. Warning.   immed
      wrap_regexp Wrap the /regexp/ literal in parens to disambiguate the slash operator. Checks for regexp following a 'return' keyword. Warning
      write_is_wrong document.write can be a form of eval. If 'evil' option is false and there's a call to 'document.write' or 'document.writeln'. Warning.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cwilliams Christopher Williams
                Reporter:
                cwilliams Christopher Williams
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Git Integration