Skip to content

Migrate to ESLint flat config, so ESLint 9 can land #1324

Description

@devill

pnpm run lint still runs ESLint 8.57.1, which npm now reports as unsupported on every install (WARN deprecated eslint@8.57.1: This version is no longer supported). The config is .eslintrc plus .eslintignore, and ESLint 9 removed both in favour of eslint.config.js.

That is why the Dependabot bump cannot land — #1302 fails CI with:

Oops! Something went wrong! :(

ESLint: 9.8.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

Why this is worth doing beyond the one stuck pull request

Staying on ESLint 8 silently freezes the plugins around it, because Dependabot can only offer versions whose peer ranges resolve:

  • eslint-plugin-unicorn is stuck at 56.0.1 while 72.0.0 is current. Recent releases peer eslint >=10.4, so no upgrade can even be proposed while ESLint is 8. This is not visible as a stale pull request — Dependabot simply stays silent.
  • eslint-plugin-react@7.37.5 is already the latest release and peers ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7. So ESLint 9 is the realistic target here; ESLint 10 stays out of reach until that plugin supports it.

Scope

Replace .eslintrc and .eslintignore with a single eslint.config.js, porting the existing extends, plugins, parser, env, rules and settings.

The shareable configs currently extended all ship flat-config variants at the versions already installed, so nothing needs upgrading first to start:

extends flat equivalent available
eslint:recommended @eslint/jsjs.configs.recommended
plugin:jest/recommended configs['flat/recommended']
plugin:unicorn/recommended configs['flat/recommended']
plugin:react/recommended configs.flat.recommended
plugin:@typescript-eslint/recommended configs['flat/recommended']
plugin:prettier/recommended eslint-plugin-prettier/recommended

@eslint/js is currently only present transitively and would need promoting to a direct devDependency.

env: {node, browser, es6} becomes languageOptions.globals, and the seven .eslintignore entries (examples/, dist/, node_modules/, coverage/, npm/, docs/, integration/) become an ignores block.

Done when

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency filejavascriptPull requests that update javascript code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions