
Highlights
There are several breaking changes in 7.0.0. We’ve created a migration guide to explain the breaking changes and describe how to upgrade.
Dropping support for Node.js v8
Node.js 8 reached EOL in December 2019, and we are officially dropping support for it in this release.
Core rule changes
- The ten Node.js/CommonJS rules in core have been deprecated and moved to the eslint-plugin-node plugin.
- Several rules have been updated to recognize bigint literals and warn on more cases by default.
eslint:recommendedhas been updated with a few new rules:no-dupe-else-if,no-import-assign, andno-setter-return.
Improved developer experience
- The default ignore patterns have been updated. ESLint will no longer ignore
.eslintrc.jsandbower_components/*by default. Additionally, it will now ignore nestednode_modulesdirectories by default. - ESLint will now lint files with extensions other than
.jsif they are explicitly defined inoverrides[].files- no need to use the--extflag! - ESLint now supports descriptions in directive comments, so things like disable comments can now be clearly documented!
- Additional validation has been added to the
RuleTesterclass to improve testing custom rules in plugins. - ESLint will now resolve plugins relative to the entry configuration file. This means that shared configuration files that are located outside the project can now be colocated with the plugins they require.
- Starting in ESLint v7, configuration files and ignore files passed to ESLint using the --config path/to/a-config and --ignore-path path/to/a-ignore CLI flags, respectively, will resolve from the current working directory rather than the file location. This allows for users to utilize shared plugins without having to install them directly in their project.
New ESLint class
- The
CLIEngineclass provides a synchronous API that is blocking the implementation of features such as parallel linting, supporting ES modules in shareable configs/parsers/plugins/formatters, and adding the ability to visually display the progress of linting runs. The newESLintclass provides an asynchronous API that ESLint core will now using going forward.CLIEnginewill remain in core for the foreseeable future but may be removed in a future major version.
Breaking Changes
4ef6158Breaking: espree@7.0.0 (#13270) (Kai Cataldo)78c8cdaBreaking: RuleTester Improvements (refs eslint/rfcs#25) (#12955) (Milos Djermanovic)185982dBreaking: improve plugin resolving (refs eslint/rfcs#47) (#12922) (Toru Nagashima)48b122fBreaking: change relative paths with --config (refs eslint/rfcs#37) (#12887) (Toru Nagashima)4af06fcBreaking: Test with an unknown error property should fail in RuleTester (#12096) (Milos Djermanovic)afa9aacBreaking: class defaulttruecomputed-property-spacing (fixes #12812) (#12915) (Milos Djermanovic)7d52151Breaking: classes defaulttruein accessor-pairs (fixes #12811) (#12919) (Milos Djermanovic)78182e4Breaking: Add new rules to eslint:recommended (fixes #12911) (#12920) (Milos Djermanovic)6423e11Breaking: check unnamed default export in func-names (fixes #12194) (#12195) (Chiawen Chen)4293229Breaking: use-isnan enforceForSwitchCase defaulttrue(fixes #12810) (#12913) (Milos Djermanovic)cf38d0dBreaking: change default ignore pattern (refs eslint/rfcs#51) (#12888) (Toru Nagashima)bfe1dc4Breaking: no-dupe-class-members checks some computed keys (fixes #12808) (#12837) (Milos Djermanovic)c2217c0Breaking: makeradixrule stricter (#12608) (fisker Cheung)1aa021dBreaking: lintoverridesfiles (fixes #10828, refs eslint/rfcs#20) (#12677) (Toru Nagashima)b50179dBreaking: Check assignment targets in no-extra-parens (#12490) (Milos Djermanovic)d86a5bbBreaking: Check flatMap in array-callback-return (fixes #12235) (#12765) (Milos Djermanovic)cf46df7Breaking: description in directive comments (refs eslint/rfcs#33) (#12699) (Toru Nagashima)7350589Breaking: some rules recognize bigint literals (fixes #11803) (#12701) (Toru Nagashima)1118fceBreaking: runtime-deprecation on ‘~/.eslintrc’ (refs eslint/rfcs#32) (#12678) (Toru Nagashima)2c28fbbBreaking: drop Node.js 8 support (refs eslint/rfcs#44) (#12700) (Toru Nagashima)
Features
f9774ecNew: Add default-case-last rule (fixes #12665) (#12668) (Milos Djermanovic)a1d999cNew: Add no-useless-backreference rule (fixes #12673) (#12690) (Milos Djermanovic)985dac3New: Add no-restricted-exports rule (fixes #10428) (#12546) (Milos Djermanovic)
Enhancements
0b1d65aUpdate: Improve report location for array-callback-return (refs #12334) (#13109) (Milos Djermanovic)d3aac53Update: report backtick loc in no-unexpected-multiline (refs #12334) (#13142) (Milos Djermanovic)bcafd0fUpdate: Add ESLint API (refs eslint/rfcs#40) (#12939) (Kai Cataldo)5c1bdebUpdate: Improve report location for getter-return (refs #12334) (#13164) (Milos Djermanovic)e7c1d4bUpdate: deprecate Node.js & CommonJS rules (#12898) (Kai Cataldo)af4472fUpdate: Improve report location for new-cap (refs #12334) (#13136) (Milos Djermanovic)a784dacUpdate: Improve report location newline-per-chained-call (refs #12334) (#13116) (Milos Djermanovic)5e07574Update: Improve report location for space-before-function-paren (#13128) (Chiawen Chen)17e2fe4Update: Improve error message for fatal fixer errors (#13120) (Brad Zacher)438dcbbUpdate: Improve report location for comma-style (refs #12334) (#13111) (Chiawen Chen)85b7254Update: no-inner-declarations false negative in non-block (fixes #12222) (#13062) (Anix)6631ef1Update: Improve report location for no-empty-function (refs #12334) (#13121) (Milos Djermanovic)e0f1b6cUpdate: stricter array index check in no-magic-numbers (fixes #12845) (#12851) (Milos Djermanovic)362713cUpdate: Improve report location for template-curly-spacing (#12813) (Milos Djermanovic)105384cUpdate: report operator location in operator-linebreak (refs #12334) (#13102) (Milos Djermanovic)081e240Update: support globalThis in no-implied-eval (fixes #12670) (#13105) (YeonJuan)a1370abUpdate: Report constructor calls in no-obj-calls (#12909) (Milos Djermanovic)085979fUpdate: consider env in no-implied-eval (fixes #12733) (#12757) (YeonJuan)e90b29bUpdate: Allow testing Suggestions with data in RuleTester (fixes #12606) (#12635) (Milos Djermanovic)183e300Update: support globalThis (refs #12670) (#12774) (YeonJuan)1299705Update: acorn version (#13016) (Idan Avrahami)a5b41a7Update: no-restricted-modules handle TemplateLiteral (fixes #12926) (#12927) (Michal Piechowiak)051567aUpdate: check identifier in array pattern in id-length (fixes #12832) (#12839) (YeonJuan)9038a29Update: func-namesas-neededfalse negative with AssignmentPattern (#12932) (Milos Djermanovic)7747177Update: report rename id destructuring in id-blacklist (fixes #12807) (#12923) (YeonJuan)77df505Update: check renaming identifier in object destructuring (fixes 12827) (#12881) (YeonJuan)41de9dfUpdate: enforceForLogicalOperands no-extra-boolean-cast (fixes #12137) (#12734) (jmoore914)1ee6b63Update: check template literal in yoda (fixes #12863) (#12876) (YeonJuan)439c833Update: array-callback-return checks Array.forEach (fixes #12551) (#12646) (Gabriel R Sezefredo)03a69dbUpdate: check template literal in no-proto, no-iterator (fixes #12801) (#12806) (YeonJuan)562e784Update: fix no-magic-numbers false negative with ignoreArrayIndexes (#12805) (Milos Djermanovic)0460748Update: check template literal in no-constant-condition (fixes #12815) (#12816) (YeonJuan)e59d775Update: Separate pattern/expression options for array-element-newline (#11796) (jacobparish)f8f115aUpdate: treat comment tokens in template-curly-spacing (fixes #12744) (#12775) (YeonJuan)9a93d9eUpdate: fix no-restricted-imports export * false negative (fixes #12737) (#12798) (Milos Djermanovic)68becbdUpdate: fix no-restricted-imports importNames reporting (fixes #12282) (#12711) (Andrey Alexandrov)ae959b6Update: report double extra parens in no-extra-parens (fixes #12127) (#12697) (YeonJuan)b2c6209Update: fix no-extra-parens CallExpression#callee false negatives (#12743) (Milos Djermanovic)14b42c3Update: fix counting jsx comment len in max-len (fixes #12213) (#12661) (YeonJuan)313f70aUpdate: add outerIIFEBody: “off” to indent rule (fixes #11377) (#12706) (Kai Cataldo)3fa39a6Update: Handle locally unsupported regex in computed property keys (#12056) (Milos Djermanovic)8f1020fUpdate: no-void add an option to allow void as a statement (#12613) (Brad Zacher)bb6cf50Update: Add offsetTernaryExpressions option for indent rule (#12556) (Adam Stankiewicz)
Bug Fixes
4c0b028Fix: remove Node.js and CommonJS category from build process (#13242) (Kai Cataldo)d85e291Fix: yoda left string fix for exceptRange (fixes #12883) (#13052) (Anix)8e7a2d9Fix: func-call-spacing “never” reports wrong message (fixes #13190) (#13193) (Milos Djermanovic)ebc28d7Fix: Remove default .js from --ext CLI option (#13176) (Brandon Mills)c9a5035Fix: newBasePath should be an absolute path (fixes #12850) (#13078) (Nick Harris)301b450Fix: no-extra-parens export default sequence expression false positive (#13096) (Milos Djermanovic)bfa811cFix: init error in extending recommended config (fixes #12707) (#12738) (YeonJuan)7551f0cFix: no check for shadowed Object (fixes #12809) (#13115) (Anix)988d842Fix: add end location to report in no-useless-concat (refs #12334) (#13110) (Milos Djermanovic)29f32dbFix: Change error message logic for implicit file ignore (fixes #12873) (#12878) (Scott Hardin)eb1a43cFix: require-await ignore async generators (fixes #12459) (#13048) (Anix)920465bFix: getNameLocationInGlobalDirectiveComment end location (refs #12334) (#13086) (Milos Djermanovic)ae14a02Fix: add end location to report in no-extra-bind (refs #12334) (#13083) (Milos Djermanovic)0c20bc0Fix: check assignment property target in camelcase (fixes #13025) (#13027) (YeonJuan)8d50a7dFix: add end location to report in no-prototype-builtins (refs #12334) (#13087) (Milos Djermanovic)3e4e7f8Fix: incorrect logic for required parens in no-extra-boolean-cast fixer (#13061) (Milos Djermanovic)aef9488Fix: allow references to external globals in id-blacklist (fixes #12567) (#12987) (Milos Djermanovic)4955c50Fix: remove type arguments in prefer-object-spread (fixes #13058) (#13063) (Milos Djermanovic)dbe357dFix: check template literal in prefer-numeric-literals (fixes #13045) (#13046) (YeonJuan)2260611Fix: added async in allow method in no-empty-function (fixes #12768) (#13036) (Anix)7224eeeFix: no-plusplus allow comma operands in for afterthought (fixes #13005) (#13024) (Milos Djermanovic)7598cf8Fix: Newline before eof when creating config via --init (#12952) (Andreas Lind)0243549Fix: camelcase false positive with computed property (fixes #13022) (#13023) (Milos Djermanovic)6cef0d5Fix: Check division operator in astUtils.canTokensBeAdjacent (#12879) (Milos Djermanovic)afde78bFix: curly removes necessary braces between if and else (fixes #12928) (#12943) (Milos Djermanovic)4797fb2Fix: arrow-body-style crash with object literal body (fixes #12884) (#12886) (Milos Djermanovic)de14d1cFix: wrap-iife autofix removes mandatory parentheses (#12905) (Milos Djermanovic)5775b06Fix: Optionally allow underscores in member names (#11972) (Edgardo Avilés)0dfc3ffFix: add end location to report in no-eval (#12960) (Milos Djermanovic)1f1424cFix: fix inconsistently works option in no-extra-parens (fixes #12717) (#12843) (YeonJuan)b5adcaaFix: make YieldExpression throwable (fixes #12880) (#12897) (YeonJuan)95e0586Fix: id-blacklist false positives on renamed imports (#12831) (Milos Djermanovic)dadc892Fix: operator-assignment crash on adjacent division assignment (#12844) (Milos Djermanovic)a9d92f9Fix: radix rule crash on disabled globals (#12824) (Milos Djermanovic)533c114Fix: multiline-comment-style rule add extra space after * (fixes #12785) (#12823) (Karthik Priyadarshan)80309c3Fix: no-constant-condition doesn’t introspect arrays (fixes #12225) (#12307) (Sean Gray)de4fa7cFix: wrong indent at tagged template in indent (fixes #12122) (#12596) (YeonJuan)16a1c1fFix: prefer-object-spread false positives with accessors (fixes #12086) (#12784) (Milos Djermanovic)0d8c0afFix: improve report location for computed-property-spacing (#12795) (Milos Djermanovic)756b95dFix: id-blacklist should ignore ObjectPatterns (fixes #12787) (#12792) (JP Ramassini)01ff791Fix: Display pipe character correctly in test output (#12771) (Brad Zacher)00ddfffFix: Windows path parsing for JUnit (fixes #12507) (#12509) (Michael Wall)1aff21bFix: no-mixed-spaces-and-tabs reports multiline strings (#12566) (Milos Djermanovic)
Documentation
b5c8d73Docs: update 7.0.0 migration guide for consistency (#13267) (Kai Cataldo)356fdb4Docs: add migration guide (#12692) (Toru Nagashima)56d2beeDocs: fix typos (#13204) (Nitin Kumar)516f253Docs: Adds import example for object-curly-newline rule (refs #12018) (#13177) (Luke Lewis)b398e0bDocs: add rule comment in prefer-rest-params doc (#13191) (YeonJuan)c41de38Docs: fix curly multi-or-nest examples with comments (refs #12972) (#13151) (Milos Djermanovic)57221d5Docs: fix eslint comment in no-inner-declarations examples (#13152) (Milos Djermanovic)5dfd4ebDocs: examples with arrow functions in no-return-assign (fixes #13135) (#13138) (Anix)adc8fa8Docs: clarify exceptions in spaced-comment (fixes #13032) (#13126) (Anix)b228f95Docs: Update README team and sponsors (ESLint Jenkins)6c069f9Docs: Add comments to code block in example (#13089) (Kibeom Kwon)ee1f053Docs: Fix typo (#13092) (Max Coplan)76324acDocs: Add further reading to rule (#13084) (Max Coplan)3f7c9bfDocs: clarify variables option in no-use-before-define (fixes #12986) (#13017) (Anix)9ac5b9eDocs: Clarify node_modules is ignored by default (fixes #13006) (#13054) (Mika Kuijpers)0de91f3Docs: removed correct code from incorrect eg (#13060) (Anix)af7af9dDocs: Update governance (#13055) (Nicholas C. Zakas)79ac6cdDocs: added less confusing explanation for func-style (fixes #12900) (#13004) (Anix)b8e20d3Docs: Mention TypeScript’s compiler check (#12903) (Benny Neugebauer)e997f32Docs: Updated arrow-parens for minor grammar issue (#12962) (Tom)cf14355Docs: Fix links to custom parsers doc (#12965) (Brandon Mills)f479f6fDocs: References correct config file name (#12885) (Patrick Kilgore)8d5c434Docs: fix category descriptions for site generation (fixes #12894) (#12930) (Kai Cataldo)05380e6Docs: Remove claim about semicolons from docs (#12944) (Luke Sikina)824d235Docs: add errorOnUnmatchedPattern option to CLIEngine (#12834) (Arthur Denner)33efd71Docs: Fix spelling mistakes (#12861) (Bryan Mishkin)a5b3c5fDocs: Update README team and sponsors (ESLint Jenkins)d6c313dDocs: add missing eslint comments in prefer-regex-literals examples (#12858) (Milos Djermanovic)aea1729Docs: Fix anchor links in Node.js API TOC (#12821) (Matija Marohnić)02fcc05Docs: Improve sort-keys (#12791) (Steven Vachon)25eb703Docs: fix dead link in max-lines rule docs (#12766) (Christian Bundy)098b67dDocs: fix minor typo in brace-style.md (#12749) (Marko Kaznovac)b23ad0dDocs: change a broken link in working-with-rules.md (#12732) (Damien Cassou)
Dependency Upgrades
b98d8bdUpgrade: eslint-release@2.0.0 (#13271) (Kai Cataldo)3eeae56Upgrade: some (dev) deps (#13155) (薛定谔的猫)95e1c70Upgrade: levn@0.4.1 (fixes #9366) (#13140) (Kai Cataldo)2111c52Upgrade: esquery@1.2.0 (#13076) (Milos Djermanovic)95613d4Upgrade: espree@6.2.1 (#13026) (Kai Cataldo)e632c31Upgrade: several dependencies (#12753) (Toru Nagashima)
Build Related
8d1b4dbBuild: changelog update for 7.0.0-rc.0 (ESLint Jenkins)2531b80Build: changelog update for 7.0.0-alpha.3 (ESLint Jenkins)2e8f193Build: changelog update for 7.0.0-alpha.2 (ESLint Jenkins)e9f1073Build: changelog update for 7.0.0-alpha.1 (ESLint Jenkins)c8c1b2bBuild: changelog update for 7.0.0-alpha.0 (ESLint Jenkins)4e16957Build: update browser build (#12693) (Toru Nagashima)827259eBuild: package.json update for eslint-config-eslint release (ESLint Jenkins)
Chores
401a687Chore: fix rules list for prereleases (#13230) (Kai Cataldo)2ce6bedChore: added tests for nested arrays (#13145) (Anix)6b7030bChore: Run tests on Node.js v14 (#13210) (fisker Cheung)e13256eChore: use espree.latestEcmaVersion in config-initializer (#13157) (Kai Cataldo)e4f57b7Chore: add nested array tests for array-element-newline (#13161) (Anix)bc0c02cChore: added lock files to gitignore (#13015) (Anix)26267edChore: update GitHub Actions (#12984) (Pig Fang)472025fChore: update space-before-function-paren in eslint-config-eslint (#12966) (Kai Cataldo)1907e57Chore: add Twitter and Open Collective badge (#12877) (Kai Cataldo)b7f0d20Chore: Use consistent badge style (#12825) (fisker Cheung)3734a66Chore: use ids for messages (#12859) (Gareth Jones)0cae920Chore: rename shadowed global (#12862) (Tony Brix)055b80dChore: Fix typo in complexity.js (#12864) (Kyle Shevlin)9f39ef0Chore: typo in PULL_REQUEST_TEMPLATE.md (#12848) (Balázs Orbán)a60d5cdChore: typo in no-irregular-whitespace.js (#12847) (Balázs Orbán)691d19aChore: add missingecmaVersion2020/11 type value (#12833) (Piotr Błażejewicz (Peter Blazejewicz))f5b9656Chore: add test for no-constant-condition (#12836) (Milos Djermanovic)10a79a6Chore: Adopteslint-plugin/require-meta-docs-descriptioninternally (#12762) (Bryan Mishkin)561b6d4Chore: add prerequisites checklist to PR template (#12790) (Kai Cataldo)9dfc850Chore: Refactor to use messageId in a number of rules (#12715) (Brad Zacher)b77b858Chore: fix separateRequires tests for one-var rule (#12709) (Milos Djermanovic)e4df7dfChore: add JSDoc types for RuleTester test cases (#12325) (Chiawen Chen)4744397Chore: remove unused code in max-lines-per-function (#12659) (YeonJuan)39f5a45Chore: add test cases for for-direction (#12698) (YeonJuan)b340304Chore: Add extra test, improve docs (#12492) (Kevin Partington)