Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Orion/ESLint"
< Orion
(→Rules) |
(→Rules) |
||
Line 42: | Line 42: | ||
| dot-notation | | dot-notation | ||
− | | | + | | '''sub''' |
− | | | + | | {a} is better written in dot notation. |
|- | |- | ||
Line 49: | Line 49: | ||
| '''eqeqeq'''<br>'''eqeq''' | | '''eqeqeq'''<br>'''eqeq''' | ||
| Expected '===' and saw '=='.<br>Expected '!==' and saw '!='. | | Expected '===' and saw '=='.<br>Expected '!==' and saw '!='. | ||
− | | '''eqeq''' only appears in old versions of JSLint (like Orion's) | + | | '''eqeq''' only appears in old versions of JSLint (like Orion's), has opposite on/off state to '''eqeqeq'''. |
|- | |- | ||
| guard-for-in | | guard-for-in | ||
− | | | + | | '''forin''' |
− | | | + | | The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype. |
|- | |- | ||
Revision as of 11:53, 15 November 2013
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.
ESLint rule | JSLint option | JSLint message | Details |
---|---|---|---|
block-scoped-var | |||
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 | |||
new-parens | |||
no-alert | |||
no-bitwise | |||
no-caller | |||
no-catch-shadow | |||
no-comma-dangle | |||
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 | |||
no-return-assign | |||
no-script-url | |||
no-self-compare | |||
no-shadow | |||
no-spaced-func | |||
no-sync | |||
no-ternary | |||
no-undef-init | |||
no-undef | node, browser, require | ||
no-underscore-dangle | |||
no-unreachable | |||
no-unused-expressions | |||
no-unused-vars | |||
no-use-before-define | |||
no-with | |||
no-wrap-func | |||
one-var | |||
quote-props | |||
quotes | |||
radix | |||
regex-spaces | |||
semi | - | Missing semicolon. | |
strict | |||
unnecessary-strict | |||
use-isnan | |||
wrap-iife | - | 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 |
Rule priority
Here are the rules we want, in order of priority:
- no-undef