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 Simple Config #13481

Open
nzakas opened this issue Jul 10, 2020 · 2 comments
Open

Implement Simple Config #13481

nzakas opened this issue Jul 10, 2020 · 2 comments

Comments

@nzakas
Copy link
Member

@nzakas 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 simple config with eslintrc compatibility

  • Create the ESLintRCCompat class in eslint/eslintrc repository
  • Create ESLintConfigArray to represent simple configs
  • Update ESLint class to search for eslint.config.js files and fallback to eslintrc system
  • Rename useESLintRC option to ESLint as useConfigFile (still keep useESLintRC for backwards compatibility)
  • Update Linter class to understand new config format and provide context.parser in addition to context.parserPath.
  • Update Linter class to ignore eslint-env comments
  • Ensure invalid CLI flags cause errors when using simple config (for example, --resolve-plugins-relative-to)
  • Switch eslint/eslint repo to use simple config
  • Create --no-config-file as equivalent to no-eslintrc
  • Document simple config
  • Release ESLint with eslintrc compatibility

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 ESLintRCCompat
  • Release ESLint with extended compatibility

Phase 4: General availability

  • Write blog post about simple 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 simple config format (links to legacy docs included)
  • Switch documentation for plugins to simple config format (links to legacy docs included)
  • Release ESLint with GA simple config

Phase 5: Remove eslintrc

  • Remove old CLI flags
  • Remove context.parserPath in Linter
  • Throw error when eslint-env config comment is used
  • Remove eslintrc support
  • Remove eslintrc documentation
  • Release ESLint without eslintrc 🎉
@nzakas nzakas self-assigned this Jul 10, 2020
@nzakas nzakas added this to Assigned in Public Roadmap Aug 8, 2020
@nzakas nzakas changed the title Simple Config Development Plan Implement Simple Config Aug 8, 2020
@nzakas nzakas moved this from Assigned to In Progress in Public Roadmap Aug 20, 2020
nzakas added a commit that referenced this issue Aug 20, 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 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 added a commit that referenced this issue Aug 24, 2020
kaicataldo pushed a commit that referenced this issue Aug 26, 2020
@nzakas
Copy link
Member Author

@nzakas 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.

nzakas added a commit that referenced this issue Sep 22, 2020
mdjermanovic pushed a commit that referenced this issue Oct 9, 2020
* Chore: Refactor CLIEngine tests (refs #13481)

* A bit of cleanup

* Address review comments

* Fix incomplete fixture cleanup

* Only remove config file if present
bryanbraun added a commit to sparkbox/eslint-config-sparkbox that referenced this issue Oct 20, 2020
…to dependencies"

This reverts commit ab37b7f.

Reverting this because it turns out that we can't actually declare
eslint plugins as dependencies. There's a feature request for this
that has been open since 2015: eslint/eslint#3458

This is also described in the docs but I missed it because I mixed
up "sharable configs" with "plugins". More details on that here:
https://eslint.org/docs/developer-guide/shareable-configs#publishing-a-shareable-config

It looks like there is a "simple config" initiative in progress which
should improve this (eslint/eslint#13481).
But until that's available, it's probably best to revert this to the
existing approach.
btmills added a commit that referenced this issue Oct 23, 2020
* Chore: Remove more ESLintRC-related files (refs #13481)

* Fix failing tests

* Rewrite FileEnumerator tests

* Remove commented out line

* Fix package.json version

* Fix linting error

* Adjust test coverage limits

* Update tests/lib/eslint/eslint.js

Co-authored-by: Brandon Mills <btmills@users.noreply.github.com>

Co-authored-by: Brandon Mills <btmills@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Public Roadmap
  
In Progress
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.