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

feat: support eslint v8 #123

Merged
merged 5 commits into from Oct 12, 2021
Merged

feat: support eslint v8 #123

merged 5 commits into from Oct 12, 2021

Conversation

SimenB
Copy link
Member

@SimenB SimenB commented Sep 17, 2021

2 main breaking changes affect us (beyond node version requirement)

  1. Removal of CLIEngine
  2. Change of config overrides

The first one I believe to be no issue since we can check which is available and adjust our API usage accordingly (and it being async doesn't matter).

However, the second one stumped me a bit. It might be enough to - depending on the eslint version - use overrideConfig instead? This is the error:

Invalid Options:
- Unknown options: configFile, envs, fixDryRun, format, globals, ignorePattern, maxWarnings, parser, parserOptions, quiet, rules
- 'configFile' has been removed. Please use the 'overrideConfigFile' option instead.
- 'envs' has been removed. Please use the 'overrideConfig.env' option instead.
- 'globals' has been removed. Please use the 'overrideConfig.globals' option instead.
- 'ignorePattern' has been removed. Please use the 'overrideConfig.ignorePatterns' option instead.
- 'parser' has been removed. Please use the 'overrideConfig.parser' option instead.
- 'parserOptions' has been removed. Please use the 'overrideConfig.parserOptions' option instead.
- 'rules' has been removed. Please use the 'overrideConfig.rules' option instead.
- 'plugins' doesn't add plugins to configuration to load. Please use the 'overrideConfig.plugins' option instead.
- 'reportUnusedDisableDirectives' must be any of "error", "warn", "off", and null.

Note that I don't think we should necessarily merge this until ESLint v8 is released as stable, but it would be good to be ready to not block others.


Lastly, eslint-plugin-import explodes horribly due to using deep imports (import-js/eslint-plugin-import#2211), so we should skip our lint run somehow, at least until that plugin adds support.

EDIT: Actually, looks like import-js/eslint-plugin-import#2194 should do it once it's released

@SimenB SimenB requested a review from ljharb September 17, 2021 07:01
@SimenB SimenB force-pushed the eslint-v8 branch 2 times, most recently from 8c11648 to 5202a5d Compare September 17, 2021 07:14
@SimenB
Copy link
Member Author

SimenB commented Sep 17, 2021

Hmm, one intermediary step could be to migrate to ESLint instead of CLIEngine when available - I assume that's something we can land without adding full v8 support, and it'll make it easier to land this.

EDIT: See #128

@SimenB
Copy link
Member Author

SimenB commented Sep 17, 2021

I've confirmed that commenting out the no-unused-modules import within the import plugin passes all tests with ESLint 8 🙂 So a release of that should allow us to land this (or at least unblock it of we want to wait)

@SimenB SimenB force-pushed the eslint-v8 branch 2 times, most recently from 8a52924 to c4b4ccb Compare September 17, 2021 09:57
@SimenB
Copy link
Member Author

SimenB commented Sep 17, 2021

🎉

@ljharb
Copy link
Collaborator

ljharb commented Sep 17, 2021

I’d strongly suggest keeping this PR in draft until eslint v8 is fully released, to avoid needing to support prereleases.

@SimenB
Copy link
Member Author

SimenB commented Sep 17, 2021

Yup, agreed 🙂, just getting #128 is fine for me since it'll allow consumers to use v8 (albeit with peer dep warnings) instead of blocking them

@SimenB
Copy link
Member Author

SimenB commented Oct 10, 2021

Version 8 has been released, but I don't wanna merge this with patch-package in place, so let's wait for the import plugin

@ljharb
Copy link
Collaborator

ljharb commented Oct 10, 2021

I’ll try to release that today or tomorrow.

@SimenB SimenB marked this pull request as ready for review October 12, 2021 06:13
@SimenB
Copy link
Member Author

SimenB commented Oct 12, 2021

🥳

@SimenB SimenB merged commit c82d78c into main Oct 12, 2021
@SimenB SimenB deleted the eslint-v8 branch October 12, 2021 06:15
@SimenB
Copy link
Member Author

SimenB commented Oct 12, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants