ESLint v8.0.0 released
by Brandon Mills - 9 October 2021We just pushed ESLint v8.0.0, which is a major release upgrade of ESLint. This release adds some new features and fixes several bugs found in the previous release. This release also has some breaking changes, so please read the following closely.
Highlights
There are several breaking changes in v8.0.0. We've created a migration guide to explain the breaking changes and describe how to upgrade. In addition, there are several new features:
- ESLint's default parser and all core rules now fully support the following ES2022 syntax:
- Class public instance fields and private instance fields
- Class public static fields and private static fields
- Class private instance methods and accessors
- Class private static methods and accessors
- RegExp match indices
- Top-level
await
- Autofix can now remove unused disable directives when
--fixand--report-unused-disable-directivesare used together. - The use of reserved words as identifiers in ES3 is now disallowed. This change only affects users with default parser configured with
{ "ecmaVersion": 3 }in parser options. - The
class-methods-use-thisrule has a newenforceForClassFieldsoption. - The
max-classes-per-filerule has a newignoreExpressionsoption. - The
meta.docs.categoryproperty has been removed from all core rules.
Breaking Changes
7cf96cfBreaking: Disallow reserved words in ES3 (fixes #15017) (#15046) (Milos Djermanovic)305e14aBreaking: remove meta.docs.category in core rules (fixes #13398) (#14594) (薛定谔的猫)24c9f2aBreaking: Strict package exports (refs #13654) (#14706) (Nicholas C. Zakas)86d31a4Breaking: disallow SourceCode#getComments() in RuleTester (refs #14744) (#14769) (Milos Djermanovic)1d2213dBreaking: Fixable disable directives (fixes #11815) (#14617) (Josh Goldberg)4a7aab7Breaking: requiremetafor fixable rules (fixes #13349) (#14634) (Milos Djermanovic)d6a761fBreaking: Requiremeta.hasSuggestionsfor rules with suggestions (#14573) (Bryan Mishkin)6bd747bBreaking: support new regex d flag (fixes #14640) (#14653) (Yosuke Ota)8b4f3abBreaking: fix comma-dangle schema (fixes #13739) (#14030) (Joakim Nilsson)b953a4eBreaking: upgrade espree and support new class features (refs #14343) (#14591) (Toru Nagashima)8cce06cBreaking: add some rules to eslint:recommended (refs #14673) (#14691) (薛定谔的猫)86bb63bBreaking: Dropcodeframeandtableformatters (#14316) (Federico Brigante)f3cb320Breaking: drop node v10/v13/v15 (fixes #14023) (#14592) (薛定谔的猫)
Enhancements
67c0074Update: Suggest missing rule in flat config (fixes #14027) (#15074) (Nicholas C. Zakas)cf34e5cUpdate: space-before-blocks ignore after switch colons (fixes #15082) (#15093) (Milos Djermanovic)14a4739Update:no-new-funcrule catching eval case ofMemberExpression(#14860) (Mojtaba Samimi)0a1a850Update: includeruleIdin error logs (fixes #15037) (#15053) (Ari Perkkiö)88a3952Update: support class fields in thecomplexityrule (refs #14857) (#14957) (Milos Djermanovic)6d1ccb6Update: enforceForClassFields in class-methods-use-this (refs #14857) (#15018) (YeonJuan)dd10937Update: added ignoreExpressions option to max-classes-per-file (#15000) (Josh Goldberg)05ca24cUpdate: Code path analysis for class fields (fixes #14343) (#14886) (Nicholas C. Zakas)44c6fc8Update: support class fields in func-name-matching (refs #14857) (#14964) (Milos Djermanovic)3d7d5fbUpdate: reporting loc forneveroption ineol-last(refs #12334) (#14840) (Nitin Kumar)f110926Update: fix no-unused-vars false negative with comma operator (#14928) (Sachin)26b0cd9Update: fix no-unreachable logic for class fields (refs #14857) (#14920) (Milos Djermanovic)9052eeeUpdate: check class fields in no-extra-parens (refs #14857) (#14906) (Milos Djermanovic)
Bug Fixes
2174a6fFix: require-atomic-updates property assignment message (fixes #15076) (#15109) (Milos Djermanovic)c9efb5fFix: preserve formatting when rules are removed from disable directives (#15081) (Milos Djermanovic)9bd3d87Fix: semicolon-less style in lines-between-class-members (refs #14857) (#15045) (Milos Djermanovic)f966fe6Fix: Update semi for class-fields (refs #14857) (#14945) (Nicholas C. Zakas)e9764f3Fix: no-undef-init should not apply to class fields (refs #14857) (#14994) (Milos Djermanovic)3409785Fix: camelcase ignoreGlobals shouldn't apply to undef vars (refs #14857) (#14966) (Milos Djermanovic)ee1b54fFix: keyword-spacing private name compat (refs #14857) (#14946) (Nicholas C. Zakas)af96584Fix: handle computed class fields in operator-linebreak (refs #14857) (#14915) (Milos Djermanovic)a773b99Fix: no-useless-computed-key edge cases with class fields (refs #14857) (#14903) (Milos Djermanovic)cbc43daFix: prefer-destructuring PrivateIdentifier false positive (refs #14857) (#14897) (Milos Djermanovic)ccb9a91Fix: dot-notation false positive with private identifier (refs #14857) (#14898) (Milos Djermanovic)
Documentation
f885fe0Docs: add note and example for extending the range of fix (refs #13706) (#13748) (Milos Djermanovic)3da1509Docs: Add jsdoctypeannotation to sample rule (#15085) (Bryan Mishkin)68a49a9Docs: Update Rollup Integrations (#15142) (xiaohai)d867f81Docs: Remove a dot from curly link (#15128) (Mauro Murru)2d654f1Docs: add example .eslintrc.json (#15087) (Nicolas Mattia)16034f0Docs: fix fixable example (#15107) (QiChang Li)7f2346bDocs: Update release blog post template (#15094) (Nicholas C. Zakas)a744dfaDocs: Update CLA info (#15058) (Brian Warner)91e82f5Docs: LintMessage.line and column are possibly undefined (#15032) (Brandon Mills)dd56631Docs: remove duplicate code path analysis document (#15033) (Milos Djermanovic)8c61f5aDocs: add info about non-capturing groups to prefer-named-capture-group (#15009) (Andrzej Wódkiewicz)4338b74Docs: add no-dupe-class-members examples with class fields (refs #14857) (#15005) (Milos Djermanovic)88b4e3dDocs: Make clear how rule options are overridden (fixes #14962) (#14976) (Jake Ob)4165c7fDocs: Clarify Linter vs ESLint in node.js api docs (fixes #14953) (#14995) (Brian Bartels)80cfb8fDocs: fix typo in migration guide (#14985) (Nitin Kumar)396a0e3Docs: update ScopeManager with class fields (#14974) (Milos Djermanovic)6663e7aDocs: removedocsscript (fixes #14288) (#14971) (Nitin Kumar)44f7de5Docs: Update deprecated information (#14961) (TagawaHirotaka)a8bcef7Docs: Add 2021 and 2022 to supported ECMAScript versions (#14952) (coderaiser)b301069Docs: fix 'When Not To Use' in prefer-named-capture-group (refs #14959) (#14969) (Milos Djermanovic)e98f14dDocs: Fix typo in no-implicit-globals.md (#14954) (jwbth)81c60f4Docs: document ESLint api (#14934) (Sam Chen)28fe19cDocs: Add v8.0.0 migration guide (fixes #14856) (#14884) (Nicholas C. Zakas)1f5d088Docs: add an exampleObject.assign()for rule no-import-assign (#14916) (薛定谔的猫)c4e5802Docs: improve rule details forno-console(fixes #14793) (#14901) (Nitin Kumar)5c3a470Docs: add class fields in no-multi-assign documentation (refs #14857) (#14907) (Milos Djermanovic)d234d89Docs: add class fields in func-names documentation (refs #14857) (#14908) (Milos Djermanovic)e037d61Docs: Mention workaround for escaping the slash character in selectors (#14675) (Aria)81f03b6Docs: Update license copyright (#14877) (Nicholas C. Zakas)
Dependency Upgrades
7d3f7f0Upgrade: unfrozen @eslint/eslintrc (fixes #15036) (#15146) (Brandon Mills)9e5c2e8Upgrade: @eslint/eslintrc@1.0.1 (#15047) (Milos Djermanovic)ec9db63Upgrade: @eslint/eslintrc@1.0.0 (#14865) (Milos Djermanovic)62c6fe7Upgrade: Debug 4.0.1 > 4.3.2 (#14892) (sandesh bafna)88db3f5Upgrade:js-yamlto v4 (#14890) (Bryan Mishkin)ae6072bUpgrade:eslint-visitor-keysto v3 (#14902) (Bryan Mishkin)e53d8cfUpgrade:markdownlintdev dependencies (#14883) (Bryan Mishkin)d66e941Upgrade: @humanwhocodes/config-array to 0.6 (#14891) (Bryan Mishkin)
Build Related
71faa38Build: changelog update for 8.0.0-rc.0 (ESLint Jenkins)d148ffdBuild: changelog update for 8.0.0-beta.2 (ESLint Jenkins)95cc61eBuild: changelog update for 8.0.0-beta.1 (ESLint Jenkins)c74fe08Build: Force prerelease peer dep for Node 16 in CI (#14933) (Brandon Mills)027165cBuild: changelog update for 8.0.0-beta.0 (ESLint Jenkins)b8b2d55Build: add codeql (#14729) (薛定谔的猫)
Chores
fabdf8aChore: Removetarget.allfromMakefile.js(#15088) (Hirotaka Tagawa / wafuwafu13)05d7140Chore: document target global in Makefile.js (#15084) (Hirotaka Tagawa / wafuwafu13)47be800Chore: test Property > .key with { a = 1 } pattern (fixes #14799) (#15072) (Milos Djermanovic)9fb0f70Chore: fix bug report template (#15061) (Milos Djermanovic)f87e199Chore: Cleanup issue templates (#15039) (Nicholas C. Zakas)921ba1eChore: fix failing cli test (#15041) (Milos Djermanovic)143a598Chore: Switch issues to use forms (#15024) (Nicholas C. Zakas)b4232d4Chore: Add test that deprecated rules display a deprecated notice (#14989) (TagawaHirotaka)db15183Chore: Refactor comments of tests (#14956) (TagawaHirotaka)a79c9f3Chore: Enforce jsdoc check-line-alignment never (#14955) (Brett Zamir)2d18db6Chore: add test for mergingparserOptionsin Linter (#14948) (Milos Djermanovic)9a4ae3bChore: Apply comment require-description and check ClassDeclaration (#14949) (Brett Zamir)8344675Chore: fix small typo (#14951) (Sosuke Suzuki)58840acChore: Update jsdoc plugin and tweak rules in effect (#14814) (Brett Zamir)be334f9Chore: Fix Makefile call to linter.getRules() (#14932) (Brandon Mills)0c86b68Chore: Replace old syntax for Array flat/flatMap (#14614) (Stephen Wade)6a89f3fChore: ignoreyarn-error.logand.pnpm-debug.log(#14925) (Nitin Kumar)3b6cd89Chore: Add rel/abs path tests inno-restricted-{imports/modules}rules (#14910) (Bryan Mishkin)f984515Chore: add assertions on reporting location insemi(#14899) (Nitin Kumar)149230cChore: Specify Node 14.x for Verify Files CI job (#14896) (Milos Djermanovic)537cf6aChore: updateglob-parent(fixes #14879)(#14887) (Nitin Kumar)f7b4a3fChore: update dev deps to latest (#14624) (薛定谔的猫)