JSLint and the popular alternatives JSHint and ESLint are brilliant tools that make your code more consistent. But sometimes it's hard to understand exactly what they're asking you to change. JSLint goes so far as to be proud of the fact that it will "hurt your feelings".

JSLint Error Explanations is designed to help you improve your JavaScript by understanding the sometimes cryptic error messages produced by JSLint, JSHint and ESLint, and teaching you how to avoid such errors.

  • JSLint   JSHint   ESLint   {a} is already defined

    The "{a} is already defined" error is thrown when JSLint or JSHint encounters a declaration with an identifier that has been used in a previous declaration. This applies to both variab…

    Also known as

    • {a} is already defined
    • W004

  • JSLint   JSHint   ESLint   Avoid arguments.{a}

    The "Avoid arguments.{a}" error is thrown when JSLint, JSHint or ESLint encounters a reference to the callee or caller property of an arguments object. The text of this warning can the…

    Also known as

    • Avoid arguments.{a}
    • W059

  • JSLint   JSHint   Bad constructor

    The "Bad constructor" error is thrown when JSLint or JSHint encounters the new operator followed by a literal value. In the following example we are attempting to apply the new operato…

    Also known as

    • Bad constructor
    • W056

  • JSLint   JSHint   ESLint   Bad for-in variable '{a}'

    This warning has existed in several forms across the three main linters. It was introduced in the original version of JSLint and has remained in all three tools ever since. In JSLint and JSHint prior to version…

    Also known as

    • Bad for-in variable '{a}'
    • Creating global 'for' variable
    • Invalid left-hand side in for-in
    • W088

  • JSLint   JSHint   Combine this with the previous 'var' statement

    This warning has existed in two forms in JSLint and JSHint. It was introduced in JSLint in June 2011 and has remained in both tools ever since. In JSLint the warning given is "Combine this with the previous…

    Also known as

    • Combine this with the previous 'var' statement
    • Too many var statements
    • W081

  • JSLint   JSHint   Confusing pluses

    This warning has existed in a few forms in both JSLint and JSHint. It was introduced in the original version of JSLint and has remained in both tools ever since. In JSHint prior to version 1.0.0 the warning give…

    Also known as

    • Confusing pluses
    • Confusing plusses
    • W007

  • JSLint   JSHint   ESLint   Unexpected dangling '_' in '{a}'

    The "Unexpected dangling '_' in '{a}'" error is thrown when JSLint, JSHint or ESLint encounters an identifier that begins or ends with the underscore character. JSHint…

    Also known as

    • Unexpected dangling '_' in '{a}'
    • W105

  • JSLint   JSHint   ESLint   ['{a}'] is better written in dot notation

    The "['{a}'] is better written in dot notation" error is thrown when JSLint, JSHint or ESLint encounters an attempt to access a property using a string literal within a pair of…

    Also known as

    • ['{a}'] is better written in dot notation
    • W069

  • JSLint   JSHint   ESLint   Empty class

    The "Empty class" error is thrown when JSLint, JSHint (only versions before 1.0.0) or ESLint encounters a regular expression literal containing an empty character class. The following…

  • JSHint   ES5 option is now set per default

    The "ES5 option is now set per default" error is thrown when JSHint (version 2.0.0 and above only) encounters the es5 option with a value of true. Here's an example in which we set…

    Also known as

    • ES5 option is now set per default
    • I003

  • JSLint   JSHint   ESLint   eval is evil

    This warning has existed in two forms in JSLint, JSHint and ESLint. It was introduced in the original version of JSLint and has remained in all three tools ever since. In JSLint the warning given is "eval i…

    Also known as

    • eval is evil
    • eval can be harmful
    • W061

  • JSLint   Expected exactly one space between '{a}' and '{b}'

    The "Expected exactly one space between '{a}' and '{b}'" error is thrown when JSLint encounters a number of spaces that is not equal to one in the following situations…

  • JSLint   Expected parameter (value) in set '{a}' function

    The "Expected parameter (value) in set '{a}' function" error is thrown when JSLint encounters property setter function in which the first parameter is not named value. In the f…

  • JSLint   JSHint   ESLint   Extra comma. (it breaks older versions of IE)

    This warning has existed in various forms across the three main linters. It was introduced in the original version of JSLint and has remained in all three tools ever since. In JSLint the warning given is the gen…

    Also known as

    • Extra comma. (it breaks older versions of IE)
    • Trailing comma
    • Unexpected ','
    • W070

  • JSLint   JSHint   ESLint   The Function constructor is eval

    This warning has existed in two forms in JSLint, JSHint and ESLint. It was introduced in the original version of JSLint and has remained in all three linters ever since. In JSLint and JSHint prior to version 1.0…

    Also known as

    • The Function constructor is eval
    • The Function constructor is a form of eval
    • W054

  • JSLint   JSHint   ESLint   Don't make functions within a loop

    The "Don't make functions within a loop" error is thrown when JSLint, JSHint and ESLint encounter a function expression in a for, while or do statement body. In the following examp…

    Also known as

    • Don't make functions within a loop
    • W083

  • JSLint   JSHint   get/set are ES5 features

    This warning has existed in two forms across JSLint and JSHint. It was introduced in May 2011 version of JSLint and remained in both tools for a period of time. In JSLint between May 2011 and August 2013 the mes…

    Also known as

    • get/set are ES5 features
    • E034

  • JSHint   'hasOwnProperty' is a really bad name

    The "'hasOwnProperty' is a really bad name" error is thrown when JSHint encounters an assignment to an object property with the identifier hasOwnProperty. This applies to both…

    Also known as

    • 'hasOwnProperty' is a really bad name
    • W001

  • JSLint   JSHint   ESLint   It is not necessary to initialize '{a}' to 'undefined'

    The "It is not necessary to initialize '{a}' to 'undefined'" error is thrown when JSLint, JSHint or ESLint encounters a variable statement in which the variable is expl…

    Also known as

    • It is not necessary to initialize '{a}' to 'undefined'
    • It's not necessary to initialize '{a}' to 'undefined'
    • W080

  • JSLint   JSHint   Function statements are not invocable. Wrap the whole function invocation in parens

    The "Function statements are not invocable. Wrap the whole function invocation in parens" error (and the alternative "Function declarations are not invocable" error) is throw…

    Also known as

    • Function statements are not invocable. Wrap the whole function invocation in parens
    • Function declarations are not invocable. Wrap the whole function invocation in parens
    • E039

  • JSLint   JSHint   ESLint   Do not use {a} as a constructor

    The "Do not use {a} as a constructor" error is thrown when JSLint, JSHint or ESLint encounters a call to String, Number, Boolean, Math or JSON preceded by the new operator. In the foll…

    Also known as

    • Do not use {a} as a constructor
    • W053

  • JSLint   JSHint   ESLint   Missing radix parameter

    The "Missing radix parameter" error is thrown when JSLint, JSHint or ESLint encounters a call to the parseInt function that only has one argument. As of JSHint 2.3.0 the warning will o…

    Also known as

    • Missing radix parameter
    • W065

  • JSHint   Mixed double and single quotes

    The "Mixed double and single quotes" error is thrown when JSHint encounters string literal delimited by double or single quote characters when a string literal delimited by the other h…

    Also known as

    • Mixed double and single quotes
    • W110

  • JSLint   Move 'var' declarations to the top of the function

    The "Move 'var' declarations to the top of the function" error is thrown when JSLint encounters a variable declaration in a for or for-in statement initialiser. Here's an e…

  • JSLint   JSHint   ESLint   Do not use 'new' for side effects

    The "Do not use 'new' for side effects" error is thrown when JSLint, JSHint or ESLint encounters a function invocation preceded by the new operator when not part of an assignme…

    Also known as

    • Do not use 'new' for side effects
    • W031

  • JSLint   JSHint   ESLint   '{a}' is not a label

    This warning has existed in three forms across the three main linters. It was introduced in the original version of JSLint and has remained (in a way) in all three tools ever since. In JSLint the warning given i…

    Also known as

    • '{a}' is not a label
    • '{a}' is not a statement label
    • Undefined label '{a}'
    • W090

  • JSLint   JSHint   ESLint   The object literal notation {} is preferrable

    This warning has existed in various forms across the three main linters. It was introduced in the original version of JSLint and has remained in all three tools ever since. In JSLint versions dated May 2013 onwa…

    Also known as

    • The object literal notation {} is preferrable
    • The object literal notation {} is preferable
    • Use the object literal notation {}
    • Use the object literal notation {} or Object.create(null)
    • W010

  • JSLint   JSHint   ESLint   {a} used out of scope

    This warning has existed in two forms across the three main linters. It was introduced in the original version of JSLint and has remained in all three tools ever since. In all versions of JSLint and JSHint the w…

    Also known as

    • {a} used out of scope
    • {a} used outside of binding context
    • W038

  • JSLint   JSHint   ESLint   Read only

    This warning has existed in two forms across the three main linters. It was introduced in the original version of JSLint and has remained (in a way) in all three tools ever since. In JSLint and JSHint the warnin…

    Also known as

    • Read only
    • {a} is a read-only native object
    • W020

  • JSLint   JSHint   ESLint   A regular expression literal can be confused with '/='

    This warning was introduced in the original version of JSLint and existed in the same form in JSHint until version 1.0.0 when it was removed. ESLint has always issued the same warning. T…

    Also known as

    • A regular expression literal can be confused with '/='
    • E014

  • JSLint   JSHint   Expected an identifier and instead saw '{a}' (a reserved word)

    The "Expected an identifier and instead saw '{a}' (a reserved word)" error is thrown when JSLint or JSHint encounters a reference to what should be an identifier but is actuall…

    Also known as

    • Expected an identifier and instead saw '{a}' (a reserved word)
    • W024

  • JSLint   JSHint   ESLint   {a} is a statement label

    This warning has existed in two forms across the three main linters. It was introduced in the original version of JSLint and has remained in all three tools ever since. In all versions of JSLint and JSHint the w…

    Also known as

    • {a} is a statement label
    • Found identifier with the same name as label
    • W037

  • JSLint   The '&&' subexpression should be wrapped in parens

    The "The '&&' subexpressions should be wrapped in parens" error is thrown when JSLint encounters an expression containing both logical 'or' and logical 'and…

  • JSHint   ESLint   This function has too many parameters. ({a})

    This warning has existed in two forms in JSHint and ESLint. It has never existing in JSLint. It was introduced in the r11 version of JSHint and has remained both JSHint and ESLint ever since. In JSHint prior to…

    Also known as

    • This function has too many parameters. ({a})
    • Too many parameters per function ({a})
    • This function has too many parameters ({a}). Maximum allowed is {b}
    • W072

  • JSLint   Type confusion: {a} and {b}

    The "Type confusion: {a} and {b}" error is thrown when JSLint (versions dated between June 2011 and July 2011) encounters an attempt to change the type of data assigned to a variable.…

  • JSLint   JSHint   Unclosed regular expression

    The "Unclosed regular expression" error is thrown when JSLint or JSHint encounters a regular expression literal with no closing / character. Here's an example: var regex = /^unclos…

    Also known as

    • Unclosed regular expression
    • E015

  • JSLint   JSHint   ESLint   Unexpected assignment expression

    This warning has existed in two forms across the three main linters. It was introduced in the original version of JSLint and has remained in all three tools ever since. In JSLint, up until July 2013, the warning…

    Also known as

    • Unexpected assignment expression
    • Expected a conditional expression and instead saw an assignment
    • W084

  • JSLint   JSHint   ESLint   Unexpected parameter '{a}' in get {b} function

    This warning has existed in two forms across the three main linters. It was introduced in the original version of JSLint and has remained (in a way) in all three tools ever since. In JSLint and JSHint the warnin…

    Also known as

    • Unexpected parameter '{a}' in get {b} function
    • W076

  • JSLint   Unexpected sync method: '{a}'

    The "Unexpected sync method: '{a}'" error is thrown when JSLint (versions from March 2012 onwards) encounters an attempt to access a property whose identifier ends with the cha…

  • JSLint   JSHint   Missing name in function statement

    This warning has existed in three forms across the three main linters. It was introduced in the original version of JSLint and has remained (in a way) in all three tools ever since. In JSLint the warning given i…

    Also known as

    • Missing name in function statement
    • Missing name in function declaration
    • W025

  • JSLint   Unnecessary escapement

    This warning has existed in two forms in JSLint. It was introduced in the original version and has remained ever since. It is not present in JSHint or ESLint. In JSLint versions dated December 2010 and earlier t…

    Also known as

    • Unnecessary escapement
    • Unexpected '\'

  • JSHint   ESLint   Unnecessary semicolon

    The "Unnecessary semicolon" error is thrown when JSHint or ESLint encounters a semicolon following a block statement or function declaration. In the following example we mistakenly inc…

    Also known as

    • Unnecessary semicolon
    • W032

  • JSLint   JSHint   ESLint   Expected an assignment or function call and instead saw an expression

    The "Expected an assignment or function call and instead saw an expression" error is thrown when JSLint, JSHint or ESLint encounters an expression with no effect. In the following exam…

    Also known as

    • Expected an assignment or function call and instead saw an expression
    • W030

  • JSLint   JSHint   ESLint   A constructor name should start with an uppercase letter

    The "A constructor name should start with an uppercase letter" error is thrown when JSLint, JSHint or ESLint encounters an identifier, preceded by the new operator, whose first charact…

    Also known as

    • A constructor name should start with an uppercase letter
    • A constructor name '{a}' should start with an uppercase letter
    • W055

  • JSLint   Use a named parameter

    The "Use a named parameter" error is thrown when JSLint encounters a access a property of the arguments object by numerical index. The following example adds two numbers. Since the fun…

  • JSHint   ESLint   Strings must use {a}quote

    The "Strings must use singlequote" and "Strings must use doublequote" errors are thrown when JSHint or ESLint encounters string literal delimited by double quote characters w…

    Also known as

    • Strings must use {a}quote
    • W108
    • W109

  • JSLint   JSHint   ESLint   Only properties should be deleted

    This warning has existed in two forms in JSLint, JSHint and ESLint. It was introduced in the original version of JSLint and has remained in all three tools ever since. In JSLint the warning given is "Only p…

    Also known as

    • Only properties should be deleted
    • Variables should not be deleted
    • W051

  • JSLint   ESLint   Weird relation

    This warning has existed in two forms in JSLint and ESLint. It was introduced in the original version of JSLint and has remained in both tools since. It is not present in JSHint. In JSLint the warning given is &…

    Also known as

    • Weird relation
    • Comparing to itself is potentially pointless

  • JSLint   JSHint   ESLint   Wrap an immediate function invocation in parentheses

    The "Wrap an immediate function invocation in parentheses" error is thrown when JSLint, JSHint and ESLint encounter an immediately invoked function expression that is not wrapped in pa…

    Also known as

    • Wrap an immediate function invocation in parentheses
    • W062

  • JSLint   JSHint   ESLint   The array literal notation [] is preferrable

    This warning has existed in two forms across the three main linters. It was introduced in the original version of JSLint and has remained in all three tools ever since. In JSLint and JSHint prior to version 1.0.…

    Also known as

    • The array literal notation [] is preferrable
    • Use the array literal notation []
    • W009

  • JSLint   JSHint   ESLint   Bad assignment

    This warning has existed in two forms across the three main linters. It was introduced in the original version of JSLint and has remained in all three tools ever since. In JSLint and JSHint the warning given has…

    Also known as

    • Bad assignment
    • Invalid left-hand side in assignment
    • E031

  • JSLint   JSHint   Variable {a} was not declared correctly

    This warning has existed in two forms across the three main linters. It was introduced in the original version of JSLint and has remained in all three tools ever since. In JSLint and JSHint prior to version 2.1.…

    Also known as

    • Variable {a} was not declared correctly
    • You might be leaking a variable ({a}) here
    • W120

  • JSHint   ESLint   Value of '{a}' may be overwritten in IE8 and earlier

    The "Value of '{a}' may be overwritten in IE8 and earlier" error is thrown when JSHint or ESLint encounters a try...catch statement in which the catch identifier is the same as…

    Also known as

    • Value of '{a}' may be overwritten in IE8 and earlier
    • W002

  • JSLint   JSHint   Confusing minuses

    This warning has existed in a few forms in both JSLint and JSHint. It was introduced in the original version of JSLint and has remained in both tools ever since. In JSHint prior to version 1.0.0 the warning give…

    Also known as

    • Confusing minuses
    • W006

  • JSHint   const '{a}' has already been declared

    The "const '{a}' has already been declared" error is thrown when JSHint encounters a constant declaration with an identifier that has already been used in a previous constant d…

    Also known as

    • const '{a}' has already been declared
    • E011

  • JSLint   JSHint   ESLint   All 'debugger' statements should be removed

    This warning has existed in various forms in JSLint, JSHint and ESLint. It was introduced in the original version of JSLint and has remained in all three linters ever since. In JSLint the warning given is "…

    Also known as

    • All 'debugger' statements should be removed
    • Forgotten 'debugger' statement?
    • Unexpected 'debugger'
    • Unexpected 'debugger' statement
    • W087

  • JSLint   JSHint   ESLint   Duplicate key '{a}'

    This warning has existed in three forms in JSLint, JSHint and ESLint. It was introduced in the original version of JSLint and has remained in all three linters ever since. In JSLint the warning given is the gene…

    Also known as

    • Duplicate key '{a}'
    • Duplicate member '{a}'
    • W075

  • JSLint   This is an ES5 feature

    This is one of many generic error messages uses by JSLint in a number of situations. Most of these cases are covered in detail by dedicated articles. Following is a list of situations that will…

  • JSLint   JSHint   ESLint   Bad escapement of EOL. Use option multistr if needed

    This warning has existed in various forms across the three main linters. It was introduced in the original version of JSHint and has remained (in a way) in all three tools from some point since. In JSLint the wa…

    Also known as

    • Bad escapement of EOL. Use option multistr if needed
    • Multiline support is limited to browsers supporting ES5 only
    • W043

  • JSLint   JSHint   ESLint   Do not assign to the exception parameter

    The "Do not assign to the exception parameter" error is thrown when JSLint, JSHint or ESLint encounters an assignment inside a catch block to the identifer associated with that block.…

    Also known as

    • Do not assign to the exception parameter
    • W022

  • JSLint   Expected a string and instead saw '{a}'

    The "Expected a string and instead saw '{a}'" error is thrown when JSLint encounters a comparison operator in which one of the operands is a typeof expression and the other ope…

  • JSHint   ESLint   Extending prototype of native object: '{a}'

    The "Extending prototype of native object: '{a}'" error, and the alternative "{a} prototype is read only, properties should not be added" error, is thrown when JSHint…

    Also known as

    • Extending prototype of native object: '{a}'
    • {a} prototype is read only, properties should not be added
    • W121

  • JSLint   JSHint   ESLint   The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype

    The "The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype" error is thrown when JSLint encounters a for-in statement in which the…

    Also known as

    • The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype
    • W089

  • JSLint   JSHint   Function statements should not be placed in blocks

    The "Function statements should not be placed in blocks" error (and the alternative "Function declarations should not be placed in blocks" error) is thrown when JSLint or JSH…

    Also known as

    • Function statements should not be placed in blocks
    • Function declarations should not be placed in blocks
    • W082

  • JSLint   JSHint   ESLint   Use the function form of 'use strict'

    The "Use the function form of 'use strict'" error is thrown when JSLint, JSHint or ESLint encounters a strict mode directive in the outermost scope of the code. In the followin…

    Also known as

    • Use the function form of 'use strict'
    • W097

  • JSHint   Option 'validthis' can't be used in a global scope

    The "Option 'validthis' can't be used in a global scope" error is thrown when JSHint encounters the validthis option in a global scope. Here's a silly example in which…

    Also known as

    • Option 'validthis' can't be used in a global scope
    • E009

  • JSLint   JSHint   ESLint   Implied eval is evil. Pass a function instead of a string

    This warning has existed in two forms across the three main linters. It was introduced in the original version of JSLint and has remained in all three tools ever since. In JSLint and JSHint prior to version 1.0.…

    Also known as

    • Implied eval is evil. Pass a function instead of a string
    • Implied eval. Consider passing a function instead of a string
    • W066

  • JSHint   Invalid typeof value '{a}'

    The "Invalid typeof value '{a}'" error is thrown when JSHint encounters a comparison with a typeof expression on one side and an invalid string literal on the other. In the fol…

    Also known as

    • Invalid typeof value '{a}'
    • W122

  • JSLint   JSHint   ESLint   A leading decimal point can be confused with a dot: '{a}'

    This warning has existed in two forms across the three main linters. It was introduced in the original version of JSLint and has remained in all three tools ever since. In JSLint versions dated before May 2013 t…

    Also known as

    • A leading decimal point can be confused with a dot: '{a}'
    • A leading decimal point can be confused with a dot
    • W008

  • JSLint   JSHint   ESLint   Missing '()' invoking a constructor

    This warning has existed in two forms across the three main linters. It was introduced in the original version of JSLint and has remained in all three tools ever since. In JSLint the warning given is the generic…

    Also known as

    • Missing '()' invoking a constructor
    • W058

  • JSLint   JSHint   ESLint   Missing 'use strict' statement

    The "Missing 'use strict' statement" error is thrown when JSLint, JSHint and ESLint encounter a function that does not contain the strict mode directive, and none of whose ance…

    Also known as

    • Missing 'use strict' statement
    • E007

  • JSLint   ESLint   Move the invocation into the parens that contain the function

    The "Move the invocation into the parens that contain the function" error is thrown when JSLint and ESLint encounter an immediately invoked function expression in which the invoking pa…

  • JSLint   Nested comment

    The "Nested comment" error is thrown when JSLint encounters the character sequence /* inside a multiline comment. Here's an example: /* This is a multiline comment. /* It's…

  • JSLint   JSHint   ESLint   '{a}' is not a function

    The "'{a}' is not a function" error is thrown when JSLint, JSHint or ESLint encounters an attempt to invoke the Math object as a function. JSLint and ESLint (but not JSHint) wi…

    Also known as

    • '{a}' is not a function
    • W063

  • JSLint   JSHint   ESLint   '{a}' was used before it was defined

    This warning has existed in two forms across the three main linters. It was introduced in the original version of JSLint and has remained in all three tools ever since. In JSLint the warning given is "'…

    Also known as

    • '{a}' was used before it was defined
    • '{a}' is not defined
    • W117
    • W003

  • JSLint   JSHint   ESLint   Don't use octal: '{a}'. Use '\u...' instead

    This warning has existed in three forms across the three main linters. It was introduced in the original version of JSLint and has remained (in a way) in all three tools ever since. In JSLint the warning given i…

    Also known as

    • Don't use octal: '{a}'. Use '\u...' instead
    • Octal literals are not allowed in strict mode
    • W115

  • JSHint   Attempting to override '{a}' which is a constant

    The "Attempting to override '{a}' which is a constant" error is thrown when JSHint encounters an assignment expression with an identifer that has been declared in a constant va…

    Also known as

    • Attempting to override '{a}' which is a constant
    • E013

  • JSHint   ESLint   Redefinition of '{a}'

    The "Redefinition of '{a}'" error is thrown when JSHint or ESLint encounters a variable declaration with an identifier that is the same as that of a built-in native object. In…

    Also known as

    • Redefinition of '{a}'
    • W079

  • JSLint   JSHint   ESLint   Spaces are hard to count. Use {a}

    The "Spaces are hard to count. Use {a}" error is thrown when JSLint, ESLint or JSHint (prior to version 1.0.0) encounters a regular expression literal containing two or more consecutiv…

  • JSHint   ESLint   Did you mean to return a conditional instead of an assignment?

    The "Did you mean to return a conditional instead of an assignment?" error, and the alternative "Return statement should not contain assignment", is thrown when JSHint or ESL…

    Also known as

    • Did you mean to return a conditional instead of an assignment?
    • Return statement should not contain assignment
    • W093

  • JSLint   JSHint   Stopping. ({a}% scanned)

    The "Stopping. ({a}% scanned)" error is thrown when JSLint or JSHint encounters a JavaScript syntax error and cannot continue to reliably parse the program. JSHint will only raise this…

    Also known as

    • Stopping. ({a}% scanned)
    • E042

  • JSLint   Unexpected TODO comment

    The "Unexpected TODO comment" error is thrown when JSLint encounters an attempt to a comment in which the first word is TODO. The regular expression used by JSLint to determine whether…

  • JSLint   JSHint   ESLint   A trailing decimal point can be confused with a dot: '{a}'

    This warning has existed in two forms across the three main linters. It was introduced in the original version of JSLint and has remained in all three tools ever since. In JSLint versions dated before May 2013 t…

    Also known as

    • A trailing decimal point can be confused with a dot: '{a}'
    • A trailing decimal point can be confused with a dot
    • W047

  • JSLint   JSHint   Unclosed comment

    The "Unclosed comment" error is thrown when JSLint or JSHint encounters a multiline comment that does not end with the character sequence */. Here's an example: /* This is a commen…

    Also known as

    • Unclosed comment
    • E017

  • JSLint   JSHint   Unclosed string

    The "Unclosed string" error is thrown when JSLint or JSHint encounters a a string that is not closed before the next line break or the end of the program. There are numerous situations…

    Also known as

    • Unclosed string
    • E029

  • JSLint   Unexpected comment

    The "Unexpected comment" error is thrown when JSLint encounters a single-line or multi-line comment in a JSON string. It will only generate this error when in JSON mode (it enters JSON…

  • JSLint   ESLint   Unexpected '++'

    This warning has existed in two forms in JSLint and ESLint. It was introduced in the original version of JSLint and has remained in both tools since. It is not present in JSHint. In JSLint the warning given is &…

    Also known as

    • Unexpected '++'
    • Unexpected '--'
    • Unary operator '++' used
    • Unary operator '--' used

  • JSLint   JSHint   ESLint   Unexpected 'with'

    This warning has existed in two forms in JSLint, JSHint and ESLint. It was introduced in the original version of JSLint and has remained in all three linters ever since. In JSLint versions dated July 2013 and la…

    Also known as

    • Unexpected 'with'
    • Don't use 'with'
    • Expected an identifier and instead saw 'with'
    • Unexpected use of 'with' statement
    • W085

  • JSLint   ESLint   Unnecessary 'else' after disruption

    This warning has existed in two forms in JSLint and ESLint. It was introduced in the original version of JSLint and has remained in both tools ever since. It is not present in JSHint. In JSLint versions dated la…

    Also known as

    • Unnecessary 'else' after disruption
    • Unexpected 'else' after 'return'

  • JSLint   JSHint   ESLint   Do not wrap function literals in parens unless they are to be immediately invoked

    This warning has existed in two forms across the three main linters. It was introduced in a very early version of JSLint and has remained in all three tools ever since. In JSLint and JSHint prior to version 1.0.…

    Also known as

    • Do not wrap function literals in parens unless they are to be immediately invoked
    • Wrapping non-IIFE function literals in parens is unnecessary
    • W068

  • JSLint   JSHint   ESLint   Unnecessary 'use strict'

    The "Unnecessary 'use strict'" error (and the alternative "Unnecessary directive '{a}'" error) is thrown when JSLint, JSHint or ESLint encounters a "use…

    Also known as

    • Unnecessary 'use strict'
    • Unnecessary directive "{a}"
    • W034

  • JSLint   JSHint   ESLint   Unused '{a}'

    This warning has existed in two forms in JSLint, JSHint and ESLint. It was introduced in the original version of JSLint and has remained in all three linters ever since. In JSLint the warning given is "Unus…

    Also known as

    • Unused '{a}'
    • '{a}' is defined but never used
    • W098

  • JSLint   JSHint   ESLint   Use the isNaN function to compare with NaN

    The "Use the isNaN function to compare with NaN" error is thrown when JSLint, JSHint and ESLint encounter a comparison in which one side is NaN. In the following example we attempt to…

    Also known as

    • Use the isNaN function to compare with NaN
    • W019

  • JSLint   Use the || operator

    The "Use the || operator" error is thrown when JSLint encounters a conditional operator in which the logical expression and first assignment expression are identical. In the following…

  • JSHint   A dot following a number can be confused with a decimal point

    The "A dot following a number can be confused with a decimal point" error is thrown when JSHint encounters a numeric literal containing a decimal point as the left-hand-side of a membe…

    Also known as

    • A dot following a number can be confused with a decimal point
    • W005

  • JSLint   Weird assignment

    The "Weird assignment" error is thrown when JSLint encounters an assignment expression in which the left hand side and right hand side expressions are the same. In the following exampl…

  • JSHint   ESLint   'with' is not allowed in strict mode

    This warning has existed in two forms in JSHint and ESLint. It was introduced in the original version of JSLHnt and has remained in both tools since. It does not feature in JSLint. In JSHint the message used is…

    Also known as

    • 'with' is not allowed in strict mode
    • Strict mode code may not include a with statement
    • E010