Highlights
This is a summary of some of the notable changes in this version of ESLint.
New Rules
One new rule was added:
Autofixing
Autofix support was added to the following rules:
Features
- 27424cb New:
prefer-destructuring
rule (fixes #6053) (#7741) (Alex LaFroscia)
Enhancements
- cd4c025 Update: add fixer for no-extra-label (#7840) (Teddy Katz)
- c9ba40a Update: add fixer for
no-unneeded-ternary
(#7540) (Teddy Katz) - dd56d87 Update: add object-shorthand option for arrow functions (fixes #7564) (#7746) (Teddy Katz)
- d80d994 Update: add fixer for object-property-newline (fixes #7740) (#7808) (Teddy Katz)
- 1beecec Update: add fixer for
operator-linebreak
(#7702) (Teddy Katz) - ebcae1f Update: no-return-await with with complex
return
argument (fixes #7594) (#7595) (Dalton Santos) - 7d1dc7e Update: Make default-case comment case-insensitive (fixes #7673) (#7742) (Robert Rossmann)
Bug Fixes
- aa75c92 Fix: Ensure prefer-const fixes destructuring assignments (fixes #7852) (#7859) (Teddy Katz)
- ca1f841 Fix: no-useless-return stack overflow on loops after throw (fixes #7855) (#7856) (Teddy Katz)
- bf3ea3a Fix: capitalized-comments: Ignore consec. comments if first is invalid (#7835) (Kevin Partington)
- 0fc24f7 Fix: adapt new-paren rule so it handles TypeScript (fixes #7817) (#7820) (Philipp A)
- df0b06b Fix: no-multiple-empty-lines perf issue on large files (fixes #7803) (#7843) (Teddy Katz)
- 2322733 Fix: Throw error if ruletester is missing required test scenarios (#7388) (Teddy Katz)
- c5c3b21 Fix: no-implied-eval false positive on ‘setTimeoutFoo’ (fixes #7821) (#7836) (Teddy Katz)
- fd4cd3b Fix: Disable no-var autofixer in some incorrect cases in loops (#7811) (Alan Pierce)
- f20b9e9 Fix: Relax no-useless-escape’s handling of ‘]’ in regexes (fixes #7789) (#7793) (Teddy Katz)
- 3004c1e Fix: consistent-return shouldn’t report class constructors (fixes #7790) (#7797) (Teddy Katz)
- 428fbdf Fix: func-call-spacing “never” doesn’t fix w/ line breaks (fixes #7787) (#7788) (Kevin Partington)
- 6e61070 Fix:
semi
false positive before regex/template literals (fixes #7782) (#7783) (Teddy Katz) - ff0c050 Fix: remove internal property from config generation (fixes #7758) (#7761) (alberto)
- 8c3a962 Fix: syntax errors from object-shorthand autofix (fixes #7744) (#7745) (Teddy Katz)
Documentation
- fbafdc0 Docs:
padded-blocks
never
case (fixes #7868) (#7878) (alberto) - bf45893 Docs: Clarify that we only support Stage 4 proposals (#7845) (Kevin Partington)
- 7122205 Docs: Array destructuring example for no-unused-vars (fixes #7838) (#7839) (Remco Haszing)
- 1f25834 Docs: update outdated info in Architecture page (#7816) (Teddy Katz)
- b938f1f Docs: Add an example for the spread operator to prefer-spread.md (#7802) (#7804) (butlermd)
- b8ce2dc Docs: Remove .html extensions from links in developer-guide (#7805) (Kevin Partington)
- aafebb2 Docs: Wrap placeholder sample in raw (#7798) (Daniel Lo Nigro)
- bb648ce Docs: fix unclear example for no-useless-escape (#7781) (Teddy Katz)
- 8b296a2 Docs: fix in semi.md: correct instead of incorrect (#7779) (German Prostakov)
Dependency Upgrades
- 3493241 Upgrade: strip-json-comments ~v2.0.1 (Janus Troelsen)
Chores
- 4008022 Chore: Refactor to use ES6 Classes (Part 3)(refs #7849) (#7865) (Gyandeep Singh)
- 616611a Chore: Refactor to use ES6 Classes (Part 2)(refs #7849) (#7847) (Gyandeep Singh)
- 856084b Chore: Refactor to use ES6 Classes (Part 1)(refs #7849) (#7846) (Gyandeep Singh)
- 18fa521 Chore: use ast-utils helper functions in no-multiple-empty-lines (#7842) (Teddy Katz)
- e21b36b Chore: add integration tests for cache files (refs #7748) (#7794) (Teddy Katz)
- 00dd96c Chore: enable array-bracket-spacing on ESLint codebase (#7830) (Teddy Katz)
- bb6b73b Chore: replace unnecessary function callbacks with arrow functions (#7795) (Teddy Katz)
- 75b7ba4 Chore: enable object-curly-spacing on ESLint codebase (refs #7725) (#7770) (Teddy Katz)
- f1bf5ec Chore: convert remaining old-style context.report() calls to the new API (#7763) (Teddy Katz)