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-imports
rule has new optionsallowImportNames
andallowImportNamePattern
. - The
no-unused-vars
rule has a new optionignoreClassWithStaticInitBlock
. - The
complexity
rule now also takes into account optional chaining and default values in destructuring patterns and parameters.
Breaking Changes
Features
1c173dc
feat: addignoreClassWithStaticInitBlock
option tono-unused-vars
(#18170) (Tanuj Kanti)a451b32
feat: makeno-misleading-character-class
report more granular errors (#18082) (Francesco Trotta)c49ed63
feat: update complexity rule for optional chaining & default values (#18152) (Mathias Schreck)11144a2
feat:no-restricted-imports
option addedallowImportNames
(#16196) (M Pater)
Bug Fixes
e37153f
fix: improve error message for invalid rule config (#18147) (Nitin Kumar)af6e170
fix: stop linting files after an error (#18155) (Francesco Trotta)
Documentation
ba1c1bb
docs: Update README (GitHub Actions Bot)337cdf9
docs: Explain limitations of RuleTester fix testing (#18175) (Nicholas C. Zakas)c7abd89
docs: Explain Node.js version support (#18176) (Nicholas C. Zakas)d961eeb
docs: show red underlines in examples in rules docs (#18041) (Yosuke Ota)558274a
docs: Update README (GitHub Actions Bot)2908b9b
docs: Update release documentation (#18174) (Nicholas C. Zakas)1f1260e
docs: replace HackerOne link with GitHub advisory (#18165) (Francesco Trotta)e5ef3cd
docs: add inline cases condition inno-fallthrough
(#18158) (Tanuj Kanti)450d0f0
docs: fixignore
option docs (#18154) (Francesco Trotta)