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

fix: use @eslint/compat to fix eslint v9 + react plugin #113

Merged
merged 6 commits into from
May 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/config-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class ConfigGenerator {
message: "Which framework does your project use?",
initial: 0,
choices: [
{ message: "React", name: "react" },
{ message: "React (⚠️eslint v9 has not been officially supported.)", name: "react" },
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a note, as it will output an warning when using npm install --force:

The config that you've selected requires the following dependencies:

eslint@^9.2.0, globals, @eslint/js, eslint-plugin-react, @eslint/compat
✔ Would you like to install them now? · No / Yes
✔ Which package manager do you want to use? · npm
☕️Installing...
npm WARN using --force Recommended protections disabled.
npm WARN idealTree Removing dependencies.eslint in favor of devDependencies.eslint
npm WARN idealTree Removing dependencies.globals in favor of devDependencies.globals
npm WARN idealTree Removing dependencies.@eslint/js in favor of devDependencies.@eslint/js
npm WARN idealTree Removing dependencies.eslint-plugin-react in favor of devDependencies.eslint-plugin-react
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: example@1.0.0
npm WARN Found: eslint@8.57.0
npm WARN node_modules/eslint
npm WARN   peer eslint@"^6.0.0 || ^7.0.0 || >=8.0.0" from @eslint-community/eslint-utils@4.4.0
npm WARN   node_modules/@eslint-community/eslint-utils
npm WARN     @eslint-community/eslint-utils@"^4.2.0" from eslint@8.57.0
npm WARN   2 more (eslint-plugin-react, the root project)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer eslint@"^3 || ^4 || ^5 || ^6 || ^7 || ^8" from eslint-plugin-react@7.34.1
npm WARN node_modules/eslint-plugin-react
npm WARN   dev eslint-plugin-react@"*" from the root project
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: eslint-plugin-react@7.34.1
npm WARN Found: eslint@9.2.0
npm WARN node_modules/eslint
npm WARN   dev eslint@"^9.2.0" from the root project
npm WARN   1 more (@eslint-community/eslint-utils)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer eslint@"^3 || ^4 || ^5 || ^6 || ^7 || ^8" from eslint-plugin-react@7.34.1
npm WARN node_modules/eslint-plugin-react
npm WARN   dev eslint-plugin-react@"*" from the root project
npm WARN 
npm WARN Conflicting peer dependency: eslint@8.57.0
npm WARN node_modules/eslint
npm WARN   peer eslint@"^3 || ^4 || ^5 || ^6 || ^7 || ^8" from eslint-plugin-react@7.34.1
npm WARN   node_modules/eslint-plugin-react
npm WARN     dev eslint-plugin-react@"*" from the root project

added 5 packages, removed 3 packages, and changed 19 packages in 30s

36 packages are looking for funding
  run `npm fund` for details

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will confuse people. What if we just kept this as "React", and then, if it is selected, output another message:

The React plugin doesn't officially support ESLint v9 yet. What would you like to do?

  • Install ESLint v9.x with compatibility utilities
  • Install ESLint v8.x

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 sounds good, will make a change later.

{ message: "Vue.js", name: "vue" },
{ message: "None of these", name: "none" }
]
Expand Down