Rule | Description | KPI | URL |
---|---|---|---|
allDebuggerStatementsShouldBeRemoved | The “All ‘debugger’ statements should be removed” error, and the alternatives “Forgotten ‘debugger’ statement” and “Unexpected ‘debugger'”, is thrown when JSLint, JSHint or ESLint encounters a debugger statement. | Maintainability | http://linterrors.com/js/all-debugger-statements-should-be-removed |
badEscapementOfEol | The “Bad escapement of EOL. Use option multistr if needed” error, and the alternative “Multiline support is limited to browsers supporting ES5 only”, is thrown when JSHint or ESLint encounters a multiline string. JSHint will only issue this warning the the multistr option is not set to true. | Maintainability | http://linterrors.com/js/bad-escapement-of-eol-use-option-multistr-if-needed |
useTheFunctionFormOfUseStrict | The “Use the function form of ‘use strict'” error is thrown when JSLint encounters a strict mode directive in the outermost scope of the code. | Maintainability | http://linterrors.com/js/use-the-function-form-of-use-strict |
useIsnanFunctionToCompareWithNan | 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. | Maintainability | http://linterrors.com/js/use-the-isnan-function-to-compare-with-nan |
alreadyDefined | 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 variable and function declarations. However it only applies when the declarations appear within the scope of a function rather than the global scope. | Maintainability | http://linterrors.com/js/a-is-already-defined |
betterWrittenInDotNotation | 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 square brackets when the property name is not a reserved word. | Maintainability | http://linterrors.com/js/a-is-better-written-in-dot-notation |
bodyOfForInShouldBeWrapped | 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 first statement is not an if statement containing a call to the hasOwnProperty method. JSHint and ESLint are a little more leniant and do not enable this feature by default. They will only warn when they encounter a for-in statement in which the first statement is not an if statement, regardless of the condition of that if statement. | Maintainability | http://linterrors.com/js/the-body-of-a-for-in-should-be-wrapped-in-an-if-statement |
combineWithPreviousVarStatement | SLint will throw the “Combine this with the previous ‘var’ statement” error when it encounters multiple variable statements within a function. | Maintainability | http://linterrors.com/js/combine-this-with-the-previous-var-statement |
confusingMinuses | The “Confusing minuses” error is thrown when JSHint encounters an addition operator in which the right-hand-side expression is preceded by the unary – operator. | Maintainability | http://linterrors.com/js/confusing-minuses |
confusingPluses | The “Confusing pluses” error is thrown when JSHint encounters an addition operator in which the right-hand-side expression is preceded by the unary + operator. | Maintainability | http://linterrors.com/js/confusing-pluses |
constructorNameShouldStartWithAnUppercaseLetter | 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 character is a lowercase letter. JSHint will only raise this warning when the newcap option is set to true. | Maintainability | http://linterrors.com/js/a-constructor-name-should-start-with-an-uppercase-letter |
doNotUseAsAConstructor | 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 provided example we attempt to assign some values to variables by invoking these functions as constructors. | Maintainability | http://linterrors.com/js/do-not-use-a-as-a-constructor |
doNotUseNewForSideEffects | 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 assignment or comparison expression. JSHint will only issue this warning if the nonew option is set to true. In the provided example we call the built-in Date function as a constructor but don’t assign the returned instance to anything. | Maintainability | http://linterrors.com/js/do-not-use-new-for-side-effects |
doNotUseOctal | The “Don’t use octal: ‘{a}’. Use ‘u…’ instead” error, and the alternative “Octal literals are not allowed in strict mode”, is thrown when JSLint, JSHint or ESLint encounters a string literal that contains the escape character followed by a digit between 0 and 7. JSHint and ESLint will only raise this warning when the relevant code is running in strict mode. In the provided example we attempt to assign a string containing an octal escape to a variable x. | Maintainability | http://linterrors.com/js/dont-use-octal-a-use-instead |
doNotWrapFunctionLiteralsInParens | The “Do not wrap function literals in parens unless they are to be immediately invoked” error (and the alternative “Wrapping non-IIFE function literals in parens is unnecessary” error) are thrown when JSLint, JSHint or ESLint encounters a function expression wrapped in parentheses with no following invoking parentheses. JSHint will throw this error in the same situation, but only if the immed option is set to true. In the provided example we assign a function expression to a variable x. | Maintainability | http://linterrors.com/js/do-not-wrap-function-literals-in-parens |
emptyClass | 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 example defines a regular expression including an empty character class. | Maintainability | http://linterrors.com/js/empty-class |
ES5OptionIsSetPerDefault | 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 the es5 option so we can use reserved words as property identifers (which was not allowed in ES3). | Understandability | http://linterrors.com/js/es5-option-is-now-set-per-default |
evalIsEvil | The “eval is evil” error (and the alternative “eval can be harmful” error) is thrown when JSLint, JSHint or ESLint encounters a call to the eval function. Here’s an example in which we use eval to access an object property by a computed name. | Efficiency | http://linterrors.com/js/eval-is-evil |
expectedAnAssignmentOrFunctionCall | 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 provided example we have a conditional expression that will evaluate to true but has no other effect on the program. | Maintainability | http://linterrors.com/js/expected-an-assignment-or-function-call |
extendingPrototypeOfNativeObject | 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 (only versions 2.3.0 and above) or ESLint encounters *a assignment to a property of the prototype of a native object. JSHint will only raise this warning if the freeze option is set to true. The following example defines a reverse method on the native String prototype. | Maintainability | http://linterrors.com/js/extending-prototype-of-native-object |
extraComma | The “Extra comma. (it breaks older versions of IE)” error (and the alternative “Trailing comma” and “Unexpected ‘,’ errors”) are thrown when JSLint, JSHint and ESLint encounter a comma following the final element of an array literal or a comma following the final value in an object literal. Since version 2.0.0 JSHint will only raise this warning if the es3 option is set to true. Here’s an example. | Maintainability | http://linterrors.com/js/extra-comma |
fnStatementsShouldNotBePlacedInBlocks | 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 JSHint encounters a function declaration inside a block statement. In the provided example we attempt to declare the example function only if some condition is true. | Maintainability | http://linterrors.com/js/function-statements-should-not-be-placed-in-blocks |
getOrSetAreEs5Features | The “get/set are ES5 features” error, and the alternative “This is an ES5 feature”, is thrown when JSHint or JSLint encounters an object property getter or setter. In the provided example we create an object x with a getter and setter. The getter is intended to always return half of the set value. | Understandability | http://linterrors.com/js/get-set-are-es5-features |
hasOwnProperty | 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 object literals and to normal assignment statements. In the provided example we define an object with a property called hasOwnProperty. | Maintainability | http://linterrors.com/js/hasownproperty-is-a-really-bad-name |
impliedEvalIsEvil | The “Implied eval is evil. Pass a function instead of a string” error (and the alternative “Implied eval. Consider passing a function instead of a string” error) is thrown when JSLint, JSHint and ESLint encounter a call to setTimeout or setInterval in which the first argument is a string. Here’s an example that should pop up a browser alert after one second. | Efficiency | http://linterrors.com/js/implied-eval-is-evil-pass-a-function-instead-of-a-string |
InvalidTypeOfValue | 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 provided example we have a function that will return true if the argument is of type “bool”. | Maintainability | http://linterrors.com/js/invalid-typeof-value-a |
leadingDecimalPointCanBeConfused | The “A leading decimal point can be confused with a dot” error is thrown when JSLint, JSHint and ESLint encounter a numeric literal preceded by a . token which itself is not preceded by a decimal integer literal. Here’s an example in which we attempt to assign the value 0.5 to the variable x. | Maintainability | http://linterrors.com/js/a-leading-decimal-point-can-be-confused-with-a-dot-a |
missingNameInFunctionStatement | The “Missing name in function statement” error, and the alternative “Missing name in function declaration” error, is thrown when JSLint or JSHint encounters the function keyword, where it would normally be parsed as a statement, followed immediately by an opening parenthesis. In the provided example we attempt to define a function but forget to give it an identifier. | Maintainability | http://linterrors.com/js/missing-name-in-function-statement |
missingRadixParameter | 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 only be issued if the es3 option is set to true. Here’s an example. | Maintainability | http://linterrors.com/js/missing-radix-parameter |
missingUseStrictStatement | 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 ancestor scopes contain the strict mode directive. JSHint will only raise this warning if the strict option is set to true. Here’s an example of a function that does not run in strict mode. | Maintainability | http://linterrors.com/js/missing-use-strict-statement |
mixedDoubleSingleQuotes | 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 has already been found. It will only raise this warning if the quotmark option is set to true. In the provided example we attempt to assign string literals to the variables x and y. | Conceptual Integrity | http://linterrors.com/js/mixed-double-and-single-quotes |
notALabel | The “‘{a}’ is not a label” error, and the alternatives “‘{a}’ is not a statement label” and “Undefined label ‘{a}'”, is thrown when JSLint, JSHint or ESLint encounters a break or continue statement referencing a label that does not exist. In the provided example we try to break out of a for loop to the non-existent example label. | Maintainability | http://linterrors.com/js/a-is-not-a-label |
notNecessaryToInitializeAsUndefined | 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 explicitly initialised to undefined. Here’s an example in which we attempt to declare a variable x and assign undefined to it. | Maintainability | http://linterrors.com/js/it-is-not-necessary-to-initialize-a-to-undefined |
onlyPropertiesShouldBeDeleted | The “Only properties should be deleted” error, and the alternative “Variables should not be deleted” error, is thrown when JSLint, JSHint or ESLint encounters the delete operator followed by a single identifier. In the provided example we declare a variable x and then attempt to delete it. | Maintainability | http://linterrors.com/js/only-properties-should-be-deleted |
outOfScope | The “{a} used out of scope” error (and the alternative “{a} used outside of binding context” error) are thrown when JSLint, JSHint or ESLint encounters a reference to a variable declared in an inner block. In the provided example we declare the variable x in the body of an if statement and then attempt to return it from the enclosing function. | Understandability | http://linterrors.com/js/a-used-out-of-scope |
readOnly | The “Read only” error, and the alternative “{a} is a read-only native object”, is thrown when JSLint, JSHint or ESLint encounters assign a value to built-in native object. In the provided example we attempt to overwrite the native global String constructor function. | Maintainability | http://linterrors.com/js/read-only |
regularExpressionLiteralCanBeConfused | The “A regular expression literal can be confused with ‘/='” error is thrown when JSLint, JSHint (prior to version 1.0.0) or ESLint encounters a regular expression literal that begins with the = character. In the provided example we attempt to assign a regular expression literal to match the string “=1” to the variable x. | Maintainability | http://linterrors.com/js/a-regular-expression-literal-can-be-confused-with |
returnStatementShouldNotContainAssignment | 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 ESLint encounters a return statement containing an assignment expression. In the provided example we attempt to assign the result of an operation to result and also return the result of that assignment. | Maintainability | http://linterrors.com/js/did-you-mean-to-return-a-conditional |
spacesAreHardToCount | 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 consecutive space characters. In the provided example we define a regular expression that will match the string “three spaces” (there are three spaces between the two words). | Maintainability | http://linterrors.com/js/spaces-are-hard-to-count-use-a |
statementLabel | The “{a} is a statement label” error (and the alternative “Found identifier with the same name as label” error) are thrown when JSLint, JSHint or ESLint encounters a reference that shares an identifier with a label defined in the same scope. In the provided example there is a variable declared in the global execution context with the identifier x. Inside the test function, there is a for statement with a label that also has the identifier x. JSLint and JSHint throw this error when we attempt to refer to the x variable. | Maintainability | http://linterrors.com/js/a-is-a-statement-label |
stringsMustUseSingleQuote | 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 when the quotmark option is set to single or a string literal delimited by single quote characters when the quotmark option is set to double. In the provided example we attempt to assign a string literal to the variable x. | Maintainability | http://linterrors.com/js/strings-must-use-singlequote |
theArrayLiteralNotationIsPreferrable | The “The array literal notation [] is preferrable” error (and the alternative “Use the array literal notation []” error) are thrown when JSLint or JSHint encounter a call to the Array constructor preceded by the new operator with no arguments or more than one argument or a single argument that is not a number. Here’s an example. | Maintainability | http://linterrors.com/js/the-array-literal-notation-is-preferrable |
theFunctionConstructorIsEval | The “The Function constructor is eval” error (and the alternative “The Function constructor is a form of eval” error) is thrown when JSLint, JSHint or ESLint encounters a call to the Function constructor preceded by the new operator. Here’s a simple example which defines a function to add two numbers. | Efficiency | http://linterrors.com/js/the-function-constructor-is-eval |
theObjectLiteralNotationIsPreferrable | The “The object literal notation {} is preferrable” error (and the alternative “Use the object literal notation {}” and “Use the object literal notation {} or Object.create(null)” error) are thrown when JSLint, JSHint and ESLint encounter a call to the Object constructor preceded by the new operator. | Maintainability | http://linterrors.com/js/the-object-literal-notation-is-preferrable |
unexpectedDanglingOfUnderscoreCharacter | 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 will only raise this warning when the nomen option is set to true. ESLint only raises this warning for variable and function identifiers and not for object property identifiers. In the provided example we use several such identifiers. | Maintainability | http://linterrors.com/js/unexpected-dangling-_-in-a |
unexpectedUseOfIncrementOrDecrementOperators. | The “Unexpected ‘++'” error, and the alternative “Unary operator ‘++’ used”, is thrown when JSLint or ESLint encounters a use of the increment or decrement operators. In ESLint the warning is only raised if the no-plusplus option is set to 1. | Maintainability | http://linterrors.com/js/unexpected-plus-plus |
unexpectedWith | The “Unexpected ‘with'” error, and the alternatives “Don’t use ‘with'” and “Unexpected use of ‘with’ statement”, is thrown when JSLint, JSHint or ESLint encounters the with statement in code that is not running in strict mode. | Maintainability | http://linterrors.com/js/unexpected-with |
unnecessarySemicolon | The “Unnecessary semicolon” error is thrown when JSHint or ESLint encounters a semicolon following a block statement or function declaration. In the provided example we mistakenly include a semicolon after an if statement body (which is a block statement), and another after a function declaration. | Maintainability | http://linterrors.com/js/unnecessary-semicolon |
unnecessaryUseStrict | The “Unnecessary ‘use strict'” error (and the alternative “Unnecessary directive ‘{a}'” error) is thrown when JSLint, JSHint or ESLint encounters a “use strict” directive in code that is already running in strict mode. The following example features a factory function that runs in strict mode and returns another function that has its own strict mode directive. | Maintainability | http://linterrors.com/js/unnecessary-use-strict |
unregisteredPropertyName | The “Unregistered property name ‘{a}'” error (and the alternatives, “Unexpected /*property*/ ‘{a}'” and “Unexpected /*member ‘{a}'”) is thrown when JSLint or JSHint encounters a non-whitelisted property identifier. In the provided example we are attempting to create an object literal with a property named x. | Maintainability | http://linterrors.com/js/unregistered-property-name |
unused | The “Unused ‘{a}'” error, and the alternative “‘{a}’ is defined but never used”, is thrown when JSLint, JSHint or ESLint encounters an environment record binding with an identifier that is not referenced aside from its declaration. In JSHint the warning is only raised if the unused option is set to true. In the provided example there are various unused identifiers. | Maintainability | http://linterrors.com/js/unused-a |
aIsNotDefined | {a}’ is not defined. | Maintainability | https://github.com/jamesallardice/jslint-error-explanations/blob/master/message-articles/not-defined.md |
valueMayBeOverwrittenInIE8 | 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 a variable or function identifer. The error is only raised when the identifer in question is declared in the same scope as the catch. In the provided example we declare a variable, a, and then use a as the identifier in the catch block. | Maintainability | http://linterrors.com/js/value-of-a-may-be-overwritten-in-ie8 |
badOption | Bad option: ‘{a}’. | Maintainability | |
badOptionValue | Bad option value. | Maintainability | |
jsonExpected | Expected a JSON value. | Maintainability | |
neitherStringNorStringArray | Input is neither a string nor an array of strings. | Maintainability | |
emptyInput | Input is empty. | Maintainability | |
strictViolation | Strict violation. | Maintainability | |
unbegunComment | “The “”Unbegun comment”” error is thrown when JSLint or JSHint encounters a multiline comment that does not start with the character sequence /*. Here’s an example: This is a comment * but I forgot to * close it.*/ Why do I get this error? This error is raised to highlight a fatal JavaScript syntax error. Your code will not run unless you fix this issue. The ECMAScript 5 specification lists the following grammar for multiline comments (ES5 §7.4): MultiLineComment :: /* MultiLineCommentCharsopt */ We can see from the above quote that multiline comments must start with the /* characters. If you have an unbegun multiline comment a syntax error will be thrown when the interpreter reaches the end of the file. Here’s the above snippet once more, except we’ve closed the comment this time. “ | Understandability | |
unmatchedVariable | Unmatched ‘{a}’. | Maintainability | |
missingPropertyName | The “missing property name ‘{a}'” error (and the alternatives, “Unexpected /*property*/ ‘{a}'” and “Unexpected /*member ‘{a}'”) is thrown when we encounters a non-whitelisted property identifier. | Understandability | |
expectedStatement | Expected to see a statement and instead saw a block. | Maintainability | |
eachValueOwnCaseLabel | Each value should have its own case label. | Maintainability | |
UnrecoverableSyntaxError | Unrecoverable syntax error. | Accuracy | |
tooManyErrors | Too many errors. | Accuracy | |
yieldExpressionParenthesized | Mozilla requires the yield expression to be parenthesized here. | Maintainability | |
classPropertyExpected | Class properties must be methods. Expected ‘(‘ but instead saw ‘{a}’. | Maintainability | |
cannotSetAfterExecutable | The ‘{a}’ option cannot be set after any executable code. | Maintainability | |
missingSemiColon | “When do I get this error? The “”Missing semicolon”” error is thrown when JSHint or ESLint encounters a statement not immedietly followed by a semicolon. In the provided example we mistakenly not given a semicolon after variable declaration: function example() { return true } Why do I get this error? This error is raised to highlight a lack of convention. Your code will work without error if you do not resolve this issue but you may be contravening coding styles and best practices.” | Understandability | |
incompatibleValues | Incompatible values for the ‘{a}’ and ‘{b}’ linting options. | Understandability | |
dotFollowingNumber | 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 member expression. In the provided example we attempt to assign the string representation of a number to a variable. | Maintainability | http://linterrors.com/js/a-dot-following-a-number-can-be-confused-with-a-decimal-point |
lineBreakBeforeA | Misleading line break before ‘{a}’; readers may interpret this as an expression boundary. | Understandability | |
unexpectedUseOfA | unexpected use of a identifer token or keyword | Maintainability | |
confusingUseOfA | make use of operator more clearly to get rid. | Maintainability | |
innerFunctionAtTopOfOuterFunction | Inner functions should be listed at the top of the outer function.(function hoisting) | Maintainability | |
unreachableAfterB | avoid early returns, no statement will excute after return. | Maintainability | |
labelAOnB | If a loop contains no nested loops or switches, labeling the loop is unnecessary | Maintainability | |
missingSemiColonWarning | All javascript statement should be terminated with semicolon(general rule) | Understandability | |
aIsNotAllowed | using a object without declaring is not allowed | Maintainability | |
thisWillBeUndefined | value of this in strict mode will be undefined | Maintainability | |
avoidEolEscaping | JS didn’t support end-of-line escaping with until ES5 | Maintainability | |
badEscaping | backslash character is used both for escaping special characters in string lierals and its used in escaping special characters in regular expressions | Maintainability | |
dontUseExtraZero | number begin with zero and octal are disallowed in strict mode | Maintainability | |
unexpectedControlCharacter | Unexpected control character in regular expression. | Maintainability | |
unexpectedEscapedCharacter | Unexpected escaped character ‘{a}’ in regular expression. | Maintainability | |
javascriptUrl | properly form href | Maintainability | |
unexpectedA | There is a unexpected token keyword or variable. | Maintainability | |
weiredConstruction | new keyword should be used when you need to have constructor function. | Maintainability | |
documentWriteCanFormEval | document.write writes a DOM after it is considered to be complete | Maintainability | |
missingNewPrefixForConstructor | function starting with capital letter should be constructor therefore to be called with new keyword | Understandability | |
blocksAreNested | Blocks are nested too deeply. ({a}) | Maintainability | |
setterDefinedWithoutGetter | Setter should be defined when there is a getter | Maintainability | |
unexpectedComma | The “Extra comma. (it breaks older versions of IE)” error (and the alternative “Trailing comma” and “Unexpected ‘,’ errors”) are thrown. A comma following the final element of an array literal or a comma following the final value in an object literal. | Understandability | |
expectedString | The “Expected a string and instead saw ‘{a}'” error is thrown when we encounters a comparison operator in which one of the operands is a typeof expression and the other operand is not a string literal. | Maintainability | |
keyMayProduceUnexpectedResult | This error is raised to highlight code that may not work as you expect and could possibly cause a fatal JavaScript syntax error. In strict mode, your code will raise a syntax error. Otherwise, it will run without error but you will most likely get unexpected results. | Maintainability | |
characterMayGetDeleted | This character may get silently deleted by one or more browsers. JSHint warns about unsafe characters when we include unicode characters, such as the “smart” quotes. | Maintainability | |
lineTooLong | Line is too long. | Maintainability | |
propertyDeprecated | When an object is created __proto__ is set to the original prototype property of the object’s constructor function. getPrototypeOf is the preferred method of getting “the prototype”. | Maintainability | |
availableInEs | {a}’ is available in ES{b} (use ‘esversion: {b}’) or Mozilla JS extensions (use moz). It is available is ES6 and not in ES5. | Maintainability | |
identifierNotCamleCase | Identifier ‘{a}’ is not in camel case. | Understandability | |
scriptUrl | Using javascript: URLs is considered by some as a form of eval. Code passed in javascript: URLs has to be parsed and evaluated by the browser in the same way that eval is processed. | Understandability | |
stringsMustUseDoublequote | Strings must use doublequote. | Maintainability | |
controlCharacterInString | 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. | Maintainability | |
avoidA | ECMAScript 6 allows programmers to create variables with block scope instead of function scope using the let and const keywords. Block scope is common in many other programming languages and helps programmers avoid mistakes | Maintainability | |
expectedASawB | With this message, we are reporting that is has encountered one expression when it expected to see another.
One common cause of this message is when we encounters the equality operator ( ‘==’), and reports that it expects an identity operator (‘===’) |
Maintainability | |
availableOnlyInMozilla | There are some expressions and statements which are only available with Mozilla JavaScript extensions (use moz option), for example ‘function closure expressions’, ‘let block’ etc. | Maintainability | |
availableOnlyInEs | This expression is available in only ES6 and above. Use ES6 and above. For example ‘arrow’ functions. | Maintainability | |
alreadyDefinedInOuterScope | In ECMAScript 2015, let will hoist the variable to the top of the block. However, referencing the variable in the block before the variable declaration results in a ReferenceError. The variable is in a “temporal dead zone” from the start of the block until the declaration is processed. | Maintainability | |
nonBreakingSpaces | Multiple spaces in a row that are not used for indentation are typically mistakes. | Understandability | |
unnecessaryGroupingOperator | Unnecessary grouping operator. | Understandability | |
unexpectedUseOfCommaOperator | The comma operator includes multiple expressions where only one is expected. It evaluates each operand from left to right and returns the value of the last operand. However, this frequently obscures side effects, and its use is often an accident. | Maintainability | |
emptyArrayElements | Arrays may contain empty slots, most frequently due to multiple commas being used in an array literal. | Maintainability | |
definedInFutureVersion | {a}’ is defined in a future version of JavaScript. Use a different variable name to avoid migration issues. | Maintainability | |
invalidElementAfterRestElement | It is good practice to have rest parameter at the end of parameter list. The rest parameters gather all remaining arguments, so the following has no sense. The …rest must always be last. | Maintainability | |
invalidParameterAfterRestParameter | Rest parameter passed to function should end correctly, since a trailing comma after a spread rest property is a SyntaxError. | Maintainability | |
declarationsAreForbidden | In ES6 use of`var` declarations are forbidden. Use `let` or `const` instead. | Maintainability | |
invalidForLoop | For loop should be ran against non empty array or object. | Maintainability | |
optionOnlyAvailableWhenLinting | The ‘{a}’ option is only available when linting ECMAScript {b} code. | Maintainability | |
mayNotBeSupported | {a} may not be supported by non-browser environments. | Maintainability | |
mustBeInFunctionScope | Variable used should be function scope | Maintainability | |
emptyDestructing | Empty destructuring: this is unnecessary and can be removed. | Maintainability | |
regularParametersPosition | Regular parameters should not come after default parameters. It is recommended to put default parameter as a last parameter. | Maintainability | |
functionExpressionShouldNotBeSecondOperand | Function expressions should not be used as the second operand to instanceof. | Maintainability | |
emptyACanBeRemoved | Empty block statements, while not technically errors, usually occur due to refactoring that wasn’t completed. They can cause confusion when reading code. | Understandability | |
emptyAReplacingWithImportB | Empty {a}: consider replacing with `import ‘{b}’;`. Consider replacing empty with relevant block/expresssion. | Maintainability | |
commaWarnings | Always put comma at the end of statement | Understandability |