Updated config lookup algorithm in ESLint 10
ESLint 10 is out and it comes with something truly great: config discovery starting from the directory where the linted file resides, instead of process.cwd() and moving down.
This means you can have different ESLint configs for different directories without having to write a custom CLI wrapper over ESLint to deal with the whole thing.
This guarantees that the config file in use is the closes to the file being linted.
It’s like it was built with tool authors in mind!
More context: ESLint 9 introduced the concept of flat config in which different setups for different directories had to be created.
Compared to this, ESLint 10 reverts to the old way of config discover/lookup but merges it with the best of ESLint 9 config.
The major traits of ESLint 10 are:
- single name for config –
eslint.config.[js|mjs|cjs|ts] - typescript support
- no more
.eslintrc - standardized file globbing
- monorepo friendly
If you want to upgrade, check if the plugins you use are breaking. The cadence at which the plugin ecosystem evolves dictates how fast you can upgrade.