
Highlights
- 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. - All core rules have been updated to support ES2022 class fields and private class members. ESLint now fully supports 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
- The
class-methods-use-thisrule has a newenforceForClassFieldsoption. - The
max-classes-per-filerule has a newignoreExpressionsoption.
Since this is a beta release, it is not expected to be ready for production, but please try it and report any unexpected issues.
Notes
- VS Code ESLint extension has added support for ESLint v8.0.0, you’ll just need to install the latest v2.1.25 of the extension.
- We have received reports from plugin authors about problems with testing plugin rules with Jest, as Jest’s resolver currently doesn’t support subpath exports. For a workaround, please see this comment.
Installing
Since this is a pre-release version, you will not automatically be upgraded by npm. You must specify the next tag when installing:
npm i eslint@next --save-dev
You can also specify the version directly:
npm i eslint@8.0.0-beta.2 --save-dev
Migration Guide
As there are a lot of changes, we’ve created a migration guide describing the changes in great detail along with the steps you should take to address them. We expect that most users should be able to upgrade without any build changes, but the migration guide should be a useful resource if you encounter problems.
Breaking Changes
Enhancements
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)
Bug Fixes
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)
Documentation
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)

