-
-
Notifications
You must be signed in to change notification settings - Fork 19
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: generated vue-ts config #64
Conversation
4e09fb5
to
d7d71e4
Compare
d7d71e4
to
5a3ea69
Compare
lib/init/config-initializer.js
Outdated
// The configuration of the framework plugins should be placed at the end of extends. | ||
if (answers.framework === "react") { | ||
config.plugins.push("react"); | ||
config.extends.push("plugin:react/recommended"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After this change, plugin:react/recommended
would come after airbnb
, so some rules that airbnb
explicitly turns off (for example, react/jsx-key
because it has too many false positives) would be enabled. Perhaps there's actually no need for plugin:react/recommended
when airbnb
is selected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but IMHO, the recommended
config should always be safe to use - if the rule has too many false positives, it should not be enabled in the recommended
. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it looks unusual that shareable config disables plugin's recommended rules, but I think that generally if the selected shareable config uses a plugin, then the shareable config should have precedence over plugin's configs, i.e. we should just not use plugin's configs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
fixes eslint/eslint#17221
it's a bug when choosing vue+ts. to repro:
the generated config (
.eslintrc.cjs
):the cause is
.vue
files should be parsed byvue-eslint-parser
, not@typescript-eslint/parser
. Its documentation says that custom parsers should useparserOption.parser
to config.https://eslint.vuejs.org/user-guide/#how-to-use-a-custom-parser
the new generated config: