
Highlights
This is a summary of the major changes you need to know about for this version of ESLint.
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@9.0.0-beta.2 --save-dev
Migration Guide
As there are a lot of changes, we’ve created a migration guide describing the breaking 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.
Multiple /* eslint */ comments for the same rule are now disallowed
In ESLint v8.x, if the file being linted contained multiple /* eslint */ configuration comments for the same rule, the last one would be applied, while the others would be silently ignored.
In ESLint v9.0.0, the first one is applied, while the others are reported as lint errors.
New Features
- The
no-restricted-importsrule has new optionsallowImportNamesandallowImportNamePattern. - The
no-unused-varsrule has a new optionignoreClassWithStaticInitBlock. - The
complexityrule now also takes into account optional chaining and default values in destructuring patterns and parameters.
Breaking Changes
Features
1c173dcfeat: addignoreClassWithStaticInitBlockoption tono-unused-vars(#18170) (Tanuj Kanti)a451b32feat: makeno-misleading-character-classreport more granular errors (#18082) (Francesco Trotta)c49ed63feat: update complexity rule for optional chaining & default values (#18152) (Mathias Schreck)11144a2feat:no-restricted-importsoption addedallowImportNames(#16196) (M Pater)
Bug Fixes
e37153ffix: improve error message for invalid rule config (#18147) (Nitin Kumar)af6e170fix: stop linting files after an error (#18155) (Francesco Trotta)
Documentation
ba1c1bbdocs: Update README (GitHub Actions Bot)337cdf9docs: Explain limitations of RuleTester fix testing (#18175) (Nicholas C. Zakas)c7abd89docs: Explain Node.js version support (#18176) (Nicholas C. Zakas)d961eebdocs: show red underlines in examples in rules docs (#18041) (Yosuke Ota)558274adocs: Update README (GitHub Actions Bot)2908b9bdocs: Update release documentation (#18174) (Nicholas C. Zakas)1f1260edocs: replace HackerOne link with GitHub advisory (#18165) (Francesco Trotta)e5ef3cddocs: add inline cases condition inno-fallthrough(#18158) (Tanuj Kanti)450d0f0docs: fixignoreoption docs (#18154) (Francesco Trotta)
