
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.0 --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.
New default values for rule options
In v9.0.0, the following rules have new defaults:
no-unused-vars: The default value of thecaughtErrorsoption is changed from"none"to"all".no-useless-computed-key: The default value of theenforceForClassMembersoption is changed fromfalsetotrue.
Stricter RuleTester validations
This release adds more checks in RuleTester:
- Messages cannot have unsubstituted placeholders.
- Suggestions must change the code.
- Test case
outputmust be different fromcode. - Test error objects must specify
messageormessageId. - Test error object must specify
suggestionsif the actual error provides suggestions. - Test suggestion objects must specify
descormessageId. - Test suggestion objects must specify
output. filenameandonlyproperties of test objects must be of the expected type (stringandboolean, respectively).
New API loadESLint()
ESLint now exports a new function loadESLint() from its main entry point. Integrations can use this function to get either the ESLint class (former FlatESLint class) or the LegacyESLint class (former ESLint class) and thus easily swap between flat config and eslintrc APIs.
Breaking Changes
9163646feat!: Rule Tester checks for missing placeholder data in the message (#18073) (fnx)3c4d51dfeat!: default forenforceForClassMembersinno-useless-computed-key(#18054) (Francesco Trotta)47e60f8feat!: Stricter rule test validations (#17654) (fnx)1a94589feat!:no-unused-varsdefault caughtErrors to ‘all’ (#18043) (Josh Goldberg ✨)
Features
53f0f47feat: Add loadESLint() API method for v9 (#18097) (Nicholas C. Zakas)2d11d46feat: add suggestions touse-isnanin binary expressions (#17996) (StyleShit)
Bug Fixes
Documentation
f1c7e6fdocs: Switch to Ethical Ads (#18090) (Strek)15c143fdocs: JS Foundation -> OpenJS Foundation in PR template (#18092) (Nicholas C. Zakas)6ea339edocs: add stricter rule test validations to v9 migration guide (#18085) (Milos Djermanovic)3c816f1docs: use relative link from CLI to core concepts (#18083) (Milos Djermanovic)9458735docs: fix malformedeslintconfig comments in rule examples (#18078) (Francesco Trotta)07a1adadocs: link from--fixCLI doc to the relevant core concept (#18080) (Bryan Mishkin)b844324docs: Update team responsibilities (#18048) (Nicholas C. Zakas)aadfb60docs: document languageOptions and other v9 changes for context (#18074) (fnx)857e242docs: tweak explanation for meta.docs rule properties (#18057) (Bryan Mishkin)10485e8docs: recommend messageId over message for reporting rule violations (#18050) (Bryan Mishkin)98b5ab4docs: Update README (GitHub Actions Bot)505fbf4docs: updateno-restricted-importsrule (#18015) (Tanuj Kanti)c25b4afdocs: Update README (GitHub Actions Bot)
Chores
e40d1d7chore: upgrade @eslint/js@9.0.0-beta.0 (#18108) (Milos Djermanovic)9870f93chore: package.json update for @eslint/js release (Jenkins)2c62e79chore: upgrade @eslint/eslintrc@3.0.1 (#18107) (Milos Djermanovic)81f0294chore: upgrade espree@10.0.1 (#18106) (Milos Djermanovic)5e2b292chore: upgrade eslint-visitor-keys@4.0.0 (#18105) (Milos Djermanovic)ce838adchore: replace dependency npm-run-all with npm-run-all2 ^5.0.0 (#18045) (renovate[bot])54df731chore: update dependency markdownlint-cli to ^0.39.0 (#18084) (renovate[bot])8f06a60chore: update dependency shelljs to ^0.8.5 (#18079) (Francesco Trotta)93ffe30chore: update dependency file-entry-cache to v8 (#17903) (renovate[bot])
