Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Orion/ESLint
Orion 5.0 will replace our current JSLint validator with ESLint. This page captures ongoing issues.
Rules
Here's a table showing the equivalent validation rules in JSLint and ESLint. If a rule has no "JSLint option", then JSLint always enforces it and it cannot be disabled.
ESLint rule | JSLint option | JSLint message | Details |
---|---|---|---|
block-scoped-var | - | '{variable}' is already defined. | Occurs when a function-scoped variable is treated as if it was block scoped. ESLint calls this error '{variable} used outside of binding context.' |
brace-style | |||
camelcase | |||
complexity | |||
consistent-this | |||
curly | |||
dot-notation | sub | {a} is better written in dot notation. | |
eqeqeq | eqeqeq eqeq |
Expected '===' and saw '=='. Expected '!==' and saw '!='. |
eqeq only appears in old versions of JSLint (like Orion's), has opposite on/off state to eqeqeq. |
guard-for-in | forin | The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype. | |
max-depth | |||
max-len | |||
max-params | |||
max-statements | |||
new-cap | - | A constructor name should start with an uppercase letter. | |
new-parens | |||
no-alert | |||
no-bitwise | |||
no-caller | |||
no-catch-shadow | |||
no-comma-dangle | - | Unexpected comma. | Flags trailing commas in object literals. |
no-cond-assign | |||
no-console | |||
no-control-regex | |||
no-debugger | |||
no-delete-var | |||
no-div-regex | |||
no-dupe-keys | |||
no-else-return | |||
no-empty-class | |||
no-empty-label | |||
no-empty | |||
no-eq-null | |||
no-eval | |||
no-ex-assign | |||
no-extra-semi | |||
no-fallthrough | |||
no-floating-decimal | |||
no-func-assign | |||
no-global-strict | |||
no-implied-eval | |||
no-iterator | |||
no-label-var | |||
no-loop-func | |||
no-mixed-requires | |||
no-multi-str | |||
no-native-reassign | |||
no-negated-in-lhs | |||
no-new-array | |||
no-new-func | |||
no-new-object | |||
no-new-wrappers | |||
no-new | |||
no-obj-calls | |||
no-octal-escape | |||
no-octal | |||
no-plusplus | |||
no-proto | |||
no-redeclare | - | "'{a}' is already defined." | Usually results from having two for loops in the same function that share a loop variable declaration like var i=... .
|
no-return-assign | |||
no-script-url | |||
no-self-compare | |||
no-shadow | |||
no-spaced-func | |||
no-sync | |||
no-ternary | |||
no-undef-init | |||
no-undef | - | '{variable}' is not defined. | Any global variables must be listed in a /*global*/ or /*globals*/ block. Predefined environments (eg. node, browser, require) can be set in /*jslint */ options. |
no-underscore-dangle | |||
no-unreachable | |||
no-unused-expressions | |||
no-unused-vars | |||
no-use-before-define | - | '{a}' was used before it was defined. | |
no-with | - | Expected an identifier and instead saw 'with'. | Treated as fatal parse error in JSLint. |
no-wrap-func | |||
one-var | |||
quote-props | |||
quotes | Strings must use doublequote. | Only if "jsonmode" | |
radix | - | Missing radix parameter. | Affects parseInt() |
regex-spaces | |||
semi | - | Missing semicolon. | |
strict | strict | Requires "use strict" pragma.
| |
unnecessary-strict | |||
use-isnan | - | Use the isNaN function to compare with NaN. | |
wrap-iife | immed | Wrap the entire immediate function invocation in parens. Do not wrap function literals in parens unless they are to be immediately invoked. Move the invocation into the parens that contain the function. |
|
wrap-regex | - | Wrap the /regexp/ literal in parens to disambiguate the slash operator. |
Rule priority
Here are the rules we want, in order of priority:
- no-undef