question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement Flat Config

See original GitHub issue

This 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)
  • Copyeslintrc 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 use CascadingConfigArrayFactory from @eslint/eslintrc

Phase 2: Implement flat config with eslintrc compatibility

  • Create the FlatCompat class in eslint/eslintrc repository
  • Create FlatConfigArray to represent simple configs
  • Update Linter class to understand FlatConfigArray objects
  • Ensure Linter#defineRule and Linter#definePlugin throw errors when using FlatConfigArray
  • Add context.languageOptions in backwards-compatible way to context in Linter
  • Ensure context.parserPath still works in Linter for FlatConfigArray (for now)
  • Create FlatRuleTester to allow rule testing with FlatConfigArray format
  • Create FlatESLint class to mirror ESLint class but use eslint.config.js instead
  • #15661
  • #15683
  • #15687
  • Implement caching
  • Update cli.js to search for eslint.config.js file and use FlatESLint 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 legacy eslintrc 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 in Linter
  • Throw error when eslint-env config comment is used
  • Remove eslintrc support
  • Remove eslintrc documentation
  • Delete ESLint class and rename FlatESLint to ESLint
  • Delete RuleTester class and rename FlatRuleTester to RuleTester
  • Release ESLint without eslintrc 🎉

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:219
  • Comments:17 (12 by maintainers)

github_iconTop GitHub Comments

38reactions
nzakascommented, Oct 28, 2020

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. 🎉

26reactions
bradzachercommented, Oct 31, 2022

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%).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found