Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Flat Config #13481

Open
54 of 69 tasks
nzakas opened this issue Jul 10, 2020 · 27 comments
Open
54 of 69 tasks

Implement Flat Config #13481

nzakas opened this issue Jul 10, 2020 · 27 comments
Assignees
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion breaking This change is backwards-incompatible core Relates to ESLint's core APIs and features feature This change adds a new feature to ESLint

Comments

@nzakas
Copy link
Member

nzakas commented Jul 10, 2020

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

Phase 3: Compatibility testing

Phase 4: General availability (v9.0.0)

  • 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 Linter to use flat config by default
  • 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)
  • Omiting any file/dir positional parameter to CLI does not give an error #14308
  • Rename ESLint class to LegacyESLint and rename FlatESLint to ESLint
  • Delete RuleTester class and rename FlatRuleTester to RuleTester
  • Update api.js to export new values for ESLint and RuleTester
  • Switch shouldUseFlatConfig() to return true except if ESLINT_USE_FLAT_CONFIG is false.
  • Release ESLint with GA flat config

Phase 5: Remove eslintrc (v10.0.0)

  • Remove old CLI flags
  • Remove context.parserPath, context.parserOptions, context.globals in Linter
  • Remove configType constructor option for Linter; throw error if found.
  • Report an error when eslint-env config comment is used
  • Remove eslintrc support
  • Remove eslintrc documentation
  • Delete FlatESLint class
  • Delete LegacyESLint class
  • Switch shouldUseFlatConfig() to always return true
  • Release ESLint without eslintrc 🎉
@nzakas nzakas added core Relates to ESLint's core APIs and features accepted There is consensus among the team that this change meets the criteria for inclusion breaking This change is backwards-incompatible feature This change adds a new feature to ESLint labels Jul 10, 2020
@nzakas nzakas self-assigned this Jul 10, 2020
@nzakas nzakas changed the title Simple Config Development Plan Implement Simple Config Aug 8, 2020
nzakas added a commit that referenced this issue Aug 21, 2020
* Chore: Mark config-related files (refs #13481)

* Fix lint errors

* Fix more linting errors
@nzakas
Copy link
Member Author

nzakas commented Aug 24, 2020

Update: Most of the CLIEngine tests are so tightly coupled to the existing file structure (overriding and stubbing require imports and then trying to use an in-memory file system) that there's just no way I can get all of the tests to pass. I suspect that the tests aren't actually testing what we think they are due to this complexity. It seems my only path forward is to leave the eslintrc functionality in place in the eslint repo and then make a copy in the eslintrc repo. We will just have to focus on removing the eslintrc functionality when we remove CLIEngine.

@nzakas
Copy link
Member Author

nzakas commented Aug 27, 2020

I'm going to make one more pass but using a physical file system instead of an in-memory filesystem to see if I can disentangle the tests. If that doesn't work, I'll do a more minimal extraction and move on.

@mahnunchik
Copy link

Any news?

@nzakas
Copy link
Member Author

nzakas commented Nov 23, 2022

@mahnunchik you can look at the checklist in the original comment to see the current progress.

@karlhorky
Copy link
Contributor

  • Work with eslint-plugin-react to switch configs to new format and ensure it works correctly

@nzakas now that the new config format has been added in jsx-eslint/eslint-plugin-react#3429, should this checkbox in Phase 3 be checked?

@ljharb
Copy link
Contributor

ljharb commented Jan 11, 2023

eslint-plugin-react v7.32.0 has been released, with flat config support - but only less than 12 hours ago. It's probably wise to wait a bit longer to make sure it actually does work correctly :-)

@CallMeLaNN

This comment was marked as off-topic.

@nzakas
Copy link
Member Author

nzakas commented Feb 10, 2023

This is a tracking issue and not the best place to ask for help. Please open a discussion instead.

@CallMeLaNN
Copy link

This is a tracking issue and not the best place to ask for help. Please open a discussion instead.

My intention was to get a chance to help or send PR for some plugins since I already study the code of the flat configs on both Eslint and some plugins. It could be the way to start contribute to the community on the phase 3.

Anyway, in that case, you may update somewhere about the concern above whenever Eslint team is ready.

@nzakas
Copy link
Member Author

nzakas commented Feb 13, 2023

@CallMeLaNN that's great, we'd appreciate the help...but this is still not the right place for that type of question. Happy to continue in a separate discussion.

@homersimpsons

This comment was marked as off-topic.

@mdjermanovic

This comment was marked as off-topic.

@nzakas
Copy link
Member Author

nzakas commented Mar 14, 2023

Folks - if you have questions about flat config, please open a discussion rather than commenting here. This issue is for tracking purposes only.

@eslint eslint locked as off-topic and limited conversation to collaborators Mar 14, 2023
@mdjermanovic
Copy link
Member

  • Remove context.parserPath, context.parserOptions, context.globals in Linter

Does context.globals exist?

@nzakas nzakas added this to v9.0.0 Sep 21, 2023
@nzakas nzakas moved this to Planned in v9.0.0 Sep 21, 2023
@nzakas nzakas moved this from Planned - Alpha to Implementing in v9.0.0 Oct 31, 2023
@nzakas nzakas moved this from Implementing to Done in v9.0.0 Dec 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion breaking This change is backwards-incompatible core Relates to ESLint's core APIs and features feature This change adds a new feature to ESLint
Projects
Status: Implementing
Status: Done
Development

No branches or pull requests