
Highlights
This version of ESLint is not ready for production use and is provided to gather feedback from the community before releasing the final version. Please let us know if you having any problems or feedback by creating issues on our GitHub repo.
Most of the highlights of this release are breaking changes, and are discussed further in the migration guide. There are summaries of the significant changes below. (Less significant changes are included in the migration guide.)
This prerelease version of ESLint has a separate documentation section.
Node.js < v18.18.0, v19 no longer supported
As of this post, Node.js v20.x is the LTS release, and as such we are dropping support for all versions of Node.js prior to v18.18.0 as well as v19.x.
Flat config is now the default and has some changes
Flat config is now the default configuration format for ESLint and eslintrc is officially deprecated. To continue using a eslintrc configuration file, you’ll need to set the ESLINT_USE_FLAT_CONFIG environment variable to false.
This release introduces support for eslint.config.mjs and eslint.config.cjs in addition to eslint.config.js, making it easier to use the module format you’d prefer regardless of the module format of the containing package.
This change affects users, plugin developers, and integrators as many aspects of ESLint had to change to make this happen. Please see our previous blog post for more details.
Removed all formatters except stylish, html, json, and json-with-meta
The following formatters have been removed:
checkstylecompactjslint-xmljunittapunixvisualstudio
If you are using these formatters currently, you’ll need to install the standalone packages for use with ESLint v9.0.0.
Removed valid-jsdoc and require-jsdoc rules
We have removed valid-jsdoc and require-jsdoc. We recommend using the eslint-plugin-jsdoc plugin instead.
Removed deprecated methods on context and SourceCode
As we announced in September, we have removed a lot of deprecated methods from context and replaced them with methods on SourceCode.
Updating eslint:recommended
The eslint:recommended configuration is updated to include new rules that we feel are important, and to remove deprecated and less important rules.
Changes to how you write rules
We’ve made multiple changes to help prevent errors in rules:
- Function-style rules will stop working in v9.0.0. Function-style rules are rules created by exporting a function from a file rather than exporting an object with a
create()method. - When a rule doesn’t have
meta.schemaspecified, a default schema of[]will be applied. This means that rules without a schema will be assumed to have no options, which in turn means that validation will fail if options are provided. RuleTesternow strictly checks that suggestion messages are unique for the same lint problem and ensures that suggestions generate valid syntax.
--quiet option is more performant
The --quiet option hides all warnings in the ESLint console. In v9.0.0, we are making a performance improvement by also not executing any rules set to "warn".
Running eslint with no file arguments
If you are using flat config and you don’t pass any file arguments to the CLI, the CLI will default to linting the current directory, which means you can type npx eslint and it will just work. (Doing the same with an eslintrc config file will result in an error.)
Unused disable directives cause warnings by default
ESLint has long been able to flag unused disable directives. In this release, we’ve enabled warnings for unused disable directives by default. You can modify this value in your config file with linterOptions.reportUnusedDisableDirectives or on the command line using --report-unused-disable-directives-severity.
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-alpha.0 --save-dev
Breaking Changes
946ae00feat!: FlatRuleTester -> RuleTester (#17922) (Nicholas C. Zakas)baff28cfeat!: removeno-inner-declarationsfromeslint:recommended(#17920) (Milos Djermanovic)cadfbcdfeat!: Rename FlatESLint to ESLint (#17914) (Nicholas C. Zakas)d1018fcfeat!: skip running warnings in --quiet mode (#17274) (Maddy Miller)fb81b1cfeat!: Set defaultschema: [], drop support for function-style rules (#17792) (Milos Djermanovic)0b21e1ffeat!: add two more cases tono-implicit-coercion(#17832) (Gürgün Dayıoğlu)2916c63feat!: Switch Linter to flat config by default (#17851) (Nicholas C. Zakas)200518efix!: Parsing ‘exported’ comment using parseListConfig (#17675) (amondev)bdd6ba1feat!: Remove valid-jsdoc and require-jsdoc (#17694) (Nicholas C. Zakas)12be307fix!: Behavior of CLI when no arguments are passed (#17644) (Nicholas C. Zakas)8fe8c56feat!: Update shouldUseFlatConfig and CLI so flat config is default (#17748) (Nicholas C. Zakas)60dea3efeat!: deprecate no-new-symbol, recommend no-new-native-nonconstructor (#17710) (Francesco Trotta)5aa9c49feat!: check for parsing errors in suggestion fixes (#16639) (Bryan Mishkin)b3e0bb0feat!: assert suggestion messages are unique in rule testers (#17532) (Josh Goldberg ✨)e563c52feat!:no-invalid-regexpmake allowConstructorFlags case-sensitive (#17533) (Josh Goldberg ✨)e5f02c7fix!: no-sequences rule schema correction (#17878) (MHO)6ee3e9efeat!: Updateeslint:recommendedconfiguration (#17716) (Milos Djermanovic)c2cf85afeat!: drop support for string configurations in flat config array (#17717) (Milos Djermanovic)c314fd6feat!: RemoveSourceCode#getComments()(#17715) (Milos Djermanovic)ae78ff1feat!: Remove deprecated context methods (#17698) (Nicholas C. Zakas)f71c328feat!: Swap FlatESLint-ESLint, FlatRuleTester-RuleTester in API (#17823) (Nicholas C. Zakas)5304da0feat!: remove formatters except html, json(-with-metadata), and stylish (#17531) (Josh Goldberg ✨)e1e827ffeat!: Require Node.js^18.18.0 || ^20.9.0 || >=21.1.0(#17725) (Milos Djermanovic)
Features
8792464feat: Enable eslint.config.mjs and eslint.config.cjs (#17909) (Nicholas C. Zakas)24ce927feat: warn by default for unused disable directives (#17879) (Bryan Mishkin)
Bug Fixes
f182114fix: deep merge behavior in flat config (#17906) (Francesco Trotta)b577e8afix: allow circular references in config (#17752) (Francesco Trotta)
Documentation
7f0ba51docs: showNEXTin version selectors (#17911) (Milos Djermanovic)0a7911edocs: add flat config default to v9 migration guide (#17927) (Milos Djermanovic)94f8065docs: Add CLI updates to migrate to v9 guide (#17924) (Nicholas C. Zakas)16187f2docs: Add exported and string config notes to migrate to v9 guide (#17926) (Nicholas C. Zakas)3ae50ccdocs: Add RuleTester changes to migrate to v9 guide (#17923) (Nicholas C. Zakas)0831b58docs: add rule changes to v9 migration guide (#17925) (Milos Djermanovic)037abfcdocs: update API docs (#17919) (Milos Djermanovic)afc3c03docs: add function-style andmeta.schemachanges to v9 migration guide (#17912) (Milos Djermanovic)1da0723docs: updateeslint:recommendedsection in Migrate to v9.x (#17908) (Milos Djermanovic)f55881fdocs: remove configuration-files-new (#17907) (Milos Djermanovic)63ae191docs: Migrate to v9.0.0 (#17905) (Nicholas C. Zakas)e708496docs: Switch to flat config by default (#17840) (Nicholas C. Zakas)fdf0424docs: Update Create a Plugin for flat config (#17826) (Nicholas C. Zakas)e6a91bddocs: Switch shareable config docs to use flat config (#17827) (Nicholas C. Zakas)3831fb7docs: updated examples ofmax-linesrule (#17898) (Tanuj Kanti)cd1ac20docs: Update README (GitHub Actions Bot)
Chores
17fedc1chore: upgrade @eslint/js@9.0.0-alpha.0 (#17928) (Milos Djermanovic)cb89ef3chore: package.json update for @eslint/js release (Jenkins)f6f4a45chore: drop structuredClone polyfill for v9 (#17915) (Kevin Gibbons)412dcbbchore: upgrade eslint-plugin-n@16.6.0 (#17916) (Milos Djermanovic)02a8bafchore: Rename files with underscores (#17910) (Nicholas C. Zakas)c0f5d91chore: remove creating an unused instance of Linter in tests (#17902) (Milos Djermanovic)3826cdfchore: use jsdoc/no-multi-asterisks with allowWhitespace: true (#17900) (Percy Ma)a9a17b3chore: fix getting scope in tests (#17899) (Milos Djermanovic)595a1f6test: ensure that CLI tests run with FlatESLint (#17884) (Francesco Trotta)c7eca43chore: update dependency markdownlint-cli to ^0.38.0 (#17865) (renovate[bot])cc0c9f7ci: bump github/codeql-action from 2 to 3 (#17873) (dependabot[bot])
