Implement Flat Config
See original GitHub issueThis issue describes the implementation plan for eslint/rfcs#9, which will take place in several phases:
Phase 1: Extract current config system
- Create new GitHub repository (
eslint/eslintrc
) - Copy
eslintrc
source files and tests into new GitHub repository - Create Jenkins release job for
@eslint/eslintrc
- Publish
@eslint/eslintrc
to npm - Update ESLint to use
@eslint/eslintrc
- Remove in-memory filesystem from tests
- Update
CLIEngine
to useCascadingConfigArrayFactory
from@eslint/eslintrc
Phase 2: Implement flat config with eslintrc
compatibility
- Create the
FlatCompat
class ineslint/eslintrc
repository - Create
FlatConfigArray
to represent simple configs - Update
Linter
class to understandFlatConfigArray
objects - Ensure
Linter#defineRule
andLinter#definePlugin
throw errors when usingFlatConfigArray
- Add
context.languageOptions
in backwards-compatible way tocontext
inLinter
- Ensure
context.parserPath
still works inLinter
forFlatConfigArray
(for now) - Create
FlatRuleTester
to allow rule testing withFlatConfigArray
format - Create
FlatESLint
class to mirrorESLint
class but useeslint.config.js
instead - #15661
- #15683
- #15687
- Implement caching
- Update
cli.js
to search foreslint.config.js
file and useFlatESLint
if found (ESLint
if not) - Ensure invalid CLI flags cause errors when using flat config (for example,
--resolve-plugins-relative-to
) - Switch
eslint/eslint
repo to use flat config - Document flat config
- Release ESLint with
eslintrc
compatibility - #16416
- #16415
- #16414
- #16413
- #16410
- #16402
- #16341
- #16340
- #16299
- #16275
- #16265
- #16264
- #16537
Phase 3: Compatibility testing
- Work with
eslint-config-airbnb
to switch to new format and ensure it works correctly - Work with
eslint-config-standard
to switch to new format and ensure it works correctly - Work with
eslint-plugin-node
to switch configs to new format and ensure it works correctly - Work with
eslint-plugin-vue
to switch configs to new format and ensure it works correctly - Work with
eslint-plugin-react
to switch configs to new format and ensure it works correctly - Switch ESLint config to load external configs/plugins without
FlatCompat
- Release ESLint with extended compatibility
Phase 4: General availability
- Write blog post about flat config format
- Output warning when people use
eslintrc
files - Switch documentation so
eslint.config.js
is the default and recommended format (link to legacyeslintrc
docs from the same page) - Switch documentation for shareable configs to flat config format (links to legacy docs included)
- Switch documentation for plugins to flat config format (links to legacy docs included)
- Release ESLint with GA flat config
Phase 5: Remove eslintrc
- Remove old CLI flags
- Remove
context.parserPath
,context.parserOptions
,context.globals
inLinter
- Throw error when
eslint-env
config comment is used - Remove
eslintrc
support - Remove
eslintrc
documentation - Delete
ESLint
class and renameFlatESLint
toESLint
- Delete
RuleTester
class and renameFlatRuleTester
toRuleTester
- Release ESLint without
eslintrc
🎉
Issue Analytics
- State:
- Created 3 years ago
- Reactions:219
- Comments:17 (12 by maintainers)
Top Results From Across the Web
ESLint's new config system, Part 2: Introduction to flat config
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >How to correctly configure the parser & plugins with ESLint's ...
ESLint's new configuration system, "Flat Config" allows for multiple rule-sets in a single configuration file. This makes overriding rules much ...
Read more >Setup & Configuration of Canvas - Flat
The configuration of Flat for Education in your Canvas courses can be done in a few seconds. You can either use our default...
Read more >Creating Sheet Metal Flat Pattern Configurations - 2018
To create a flat pattern configuration: In a sheet metal part, create a new configuration. In the FeatureManager design tree, do one of...
Read more >Flatten - Confluent Documentation
The configuration snippet below shows how to use Flatten to concatenate field names with the period . delimiter character. "transforms": "flatten" ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Phase 1 is now compete. The old config system has been separated out into a separate package. That means I can now move on to phase 2. 🎉
I think it would be a good idea to include @typescript-eslint in the Phase 3 list.
IMO onboarding the project as early as possible is a hard requirement for the workstream. Without ts-eslint’s onboarding the majority of ESLint users won’t able to transition to flat configs without needing to use the compatibility tooling.
For reference - by weekly download volume
@typescript-eslint/eslint-plugin
users make up over 65% of ESLint users and@typescript-eslint/parser
users make up over 70% of ESLint’s users. (plugin = 19.2m / parser = 21m / eslint = 28.8m)It would be a real shame if most users’ first experience with new config system involves reaching for the compatibility APIs. Making sure that doesn’t happen should be a top priority!
Feel free to chat with us (cc @JoshuaKGoldberg and @JamesHenry)!
Separately but very related to the above - I’d also suggest including
eslint-plugin-import
for the same reasons given that it is similar in size (17.1m - ~60%).