ESLint v9.0.0-alpha.0 released

We just pushed ESLint v9.0.0-alpha.0, which is a major release upgrade of ESLint. This release adds some new features and fixes several bugs found in the previous release. This release also has some breaking changes, so please read the following closely.

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:

  • checkstyle
  • compact
  • jslint-xml
  • junit
  • tap
  • unix
  • visualstudio

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:

  1. 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.
  2. When a rule doesn’t have meta.schema specified, 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.
  3. RuleTester now 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

  • 946ae00 feat!: FlatRuleTester -> RuleTester (#17922) (Nicholas C. Zakas)
  • baff28c feat!: remove no-inner-declarations from eslint:recommended (#17920) (Milos Djermanovic)
  • cadfbcd feat!: Rename FlatESLint to ESLint (#17914) (Nicholas C. Zakas)
  • d1018fc feat!: skip running warnings in --quiet mode (#17274) (Maddy Miller)
  • fb81b1c feat!: Set default schema: [], drop support for function-style rules (#17792) (Milos Djermanovic)
  • 0b21e1f feat!: add two more cases to no-implicit-coercion (#17832) (Gürgün Dayıoğlu)
  • 2916c63 feat!: Switch Linter to flat config by default (#17851) (Nicholas C. Zakas)
  • 200518e fix!: Parsing ‘exported’ comment using parseListConfig (#17675) (amondev)
  • bdd6ba1 feat!: Remove valid-jsdoc and require-jsdoc (#17694) (Nicholas C. Zakas)
  • 12be307 fix!: Behavior of CLI when no arguments are passed (#17644) (Nicholas C. Zakas)
  • 8fe8c56 feat!: Update shouldUseFlatConfig and CLI so flat config is default (#17748) (Nicholas C. Zakas)
  • 60dea3e feat!: deprecate no-new-symbol, recommend no-new-native-nonconstructor (#17710) (Francesco Trotta)
  • 5aa9c49 feat!: check for parsing errors in suggestion fixes (#16639) (Bryan Mishkin)
  • b3e0bb0 feat!: assert suggestion messages are unique in rule testers (#17532) (Josh Goldberg ✨)
  • e563c52 feat!: no-invalid-regexp make allowConstructorFlags case-sensitive (#17533) (Josh Goldberg ✨)
  • e5f02c7 fix!: no-sequences rule schema correction (#17878) (MHO)
  • 6ee3e9e feat!: Update eslint:recommended configuration (#17716) (Milos Djermanovic)
  • c2cf85a feat!: drop support for string configurations in flat config array (#17717) (Milos Djermanovic)
  • c314fd6 feat!: Remove SourceCode#getComments() (#17715) (Milos Djermanovic)
  • ae78ff1 feat!: Remove deprecated context methods (#17698) (Nicholas C. Zakas)
  • f71c328 feat!: Swap FlatESLint-ESLint, FlatRuleTester-RuleTester in API (#17823) (Nicholas C. Zakas)
  • 5304da0 feat!: remove formatters except html, json(-with-metadata), and stylish (#17531) (Josh Goldberg ✨)
  • e1e827f feat!: Require Node.js ^18.18.0 || ^20.9.0 || >=21.1.0 (#17725) (Milos Djermanovic)

Features

  • 8792464 feat: Enable eslint.config.mjs and eslint.config.cjs (#17909) (Nicholas C. Zakas)
  • 24ce927 feat: warn by default for unused disable directives (#17879) (Bryan Mishkin)

Bug Fixes

  • f182114 fix: deep merge behavior in flat config (#17906) (Francesco Trotta)
  • b577e8a fix: allow circular references in config (#17752) (Francesco Trotta)

Documentation

  • 7f0ba51 docs: show NEXT in version selectors (#17911) (Milos Djermanovic)
  • 0a7911e docs: add flat config default to v9 migration guide (#17927) (Milos Djermanovic)
  • 94f8065 docs: Add CLI updates to migrate to v9 guide (#17924) (Nicholas C. Zakas)
  • 16187f2 docs: Add exported and string config notes to migrate to v9 guide (#17926) (Nicholas C. Zakas)
  • 3ae50cc docs: Add RuleTester changes to migrate to v9 guide (#17923) (Nicholas C. Zakas)
  • 0831b58 docs: add rule changes to v9 migration guide (#17925) (Milos Djermanovic)
  • 037abfc docs: update API docs (#17919) (Milos Djermanovic)
  • afc3c03 docs: add function-style and meta.schema changes to v9 migration guide (#17912) (Milos Djermanovic)
  • 1da0723 docs: update eslint:recommended section in Migrate to v9.x (#17908) (Milos Djermanovic)
  • f55881f docs: remove configuration-files-new (#17907) (Milos Djermanovic)
  • 63ae191 docs: Migrate to v9.0.0 (#17905) (Nicholas C. Zakas)
  • e708496 docs: Switch to flat config by default (#17840) (Nicholas C. Zakas)
  • fdf0424 docs: Update Create a Plugin for flat config (#17826) (Nicholas C. Zakas)
  • e6a91bd docs: Switch shareable config docs to use flat config (#17827) (Nicholas C. Zakas)
  • 3831fb7 docs: updated examples of max-lines rule (#17898) (Tanuj Kanti)
  • cd1ac20 docs: Update README (GitHub Actions Bot)

Chores

  • 17fedc1 chore: upgrade @eslint/js@9.0.0-alpha.0 (#17928) (Milos Djermanovic)
  • cb89ef3 chore: package.json update for @eslint/js release (Jenkins)
  • f6f4a45 chore: drop structuredClone polyfill for v9 (#17915) (Kevin Gibbons)
  • 412dcbb chore: upgrade eslint-plugin-n@16.6.0 (#17916) (Milos Djermanovic)
  • 02a8baf chore: Rename files with underscores (#17910) (Nicholas C. Zakas)
  • c0f5d91 chore: remove creating an unused instance of Linter in tests (#17902) (Milos Djermanovic)
  • 3826cdf chore: use jsdoc/no-multi-asterisks with allowWhitespace: true (#17900) (Percy Ma)
  • a9a17b3 chore: fix getting scope in tests (#17899) (Milos Djermanovic)
  • 595a1f6 test: ensure that CLI tests run with FlatESLint (#17884) (Francesco Trotta)
  • c7eca43 chore: update dependency markdownlint-cli to ^0.38.0 (#17865) (renovate[bot])
  • cc0c9f7 ci: bump github/codeql-action from 2 to 3 (#17873) (dependabot[bot])

The latest ESLint news, case studies, tutorials, and resources.

ESLint v9.5.0 released
2 min read

ESLint v9.5.0 released

We just pushed ESLint v9.5.0, which is a minor release upgrade of ESLint. This release adds some new features and fixes several bugs found in the previous release.

ESLint v9.4.0 released
1 min read

ESLint v9.4.0 released

We just pushed ESLint v9.4.0, which is a minor release upgrade of ESLint. This release adds some new features and fixes several bugs found in the previous release.