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

Inclusion of "eslint:recommended" #3

Closed
jls-tschanzc opened this issue Oct 7, 2019 · 2 comments
Closed

Inclusion of "eslint:recommended" #3

jls-tschanzc opened this issue Oct 7, 2019 · 2 comments
Assignees

Comments

@jls-tschanzc
Copy link

Hi everyone

When I generate a project using Vue CLI and select "prettier" during the prompts, I get the following eslint extends config:

"extends": [
  "plugin:vue/essential",
  "@vue/prettier"
]

When checking the plugin:vue/essential rules I can see that no further extends is used. In the prettier config (this repo) I see that it adds eslint:recommended at the top.

As far as I understand eslint extends, this means that rules defined in eslint:recommended would override any rules defined before it (so e.g. in plugin:vue/essential, which does not matter in this case as there is no overlap).

Now if I were to add our own set of rules, I would ideally put it before the @vue/prettier config as I want to benefit from the eslint-config-prettier defined within it (to disable possible code-style rules). But this would also mean that this set of rules can't contradict eslint:recommended as that one has higher priority (comes later in the array) and would overrule all conflicting custom rules. If I were to put the config after @vue/prettier I would have to make sure to either not include anything that conflicts with the rules in eslint-config-prettier or possibly duplicate this in the "extends" array to come last.

So what I would like:

"extends": [
  "my-custom-rules",
  "plugin:vue/essential",
  "@vue/prettier"
]

Which would result in my-custom-rules to be overruled by eslint:recommended.

What would might be possible:

"extends": [
  "plugin:vue/essential",
  "@vue/prettier"
  "my-custom-rules",
  "eslint-config-prettier"
]

Duplicating the eslint-config-prettier rules.

Is there a special reason for including eslint:recommended in this config? Might it be better to remove that and allow vue-cli to generate a config like this:

"extends": [
  "eslint:recommended",
  "plugin:vue/essential",
  "@vue/prettier"
]

Which would be clearer and make it easy to add custom configs.

@qidaneix
Copy link

qidaneix commented Oct 25, 2019

I approve of it, and meet the same problem.
I config typescript + prettier from vue-cli to build my project. When I want to extend plugin:@typescript-eslint/recommended plugin:@typescript-eslint/recommended-requiring-type-checking plugin:@typescript-eslint/eslint-recommended into my eslintrc.js, I can not find a appropriate order to sort them because @vue/prettier extends the eslint:recommended.

@haoqunjiang haoqunjiang self-assigned this Oct 25, 2019
@blowsie
Copy link

blowsie commented Dec 3, 2019

The breaking change states to use @vue/prettier/recommended is there any documentation on how to use this?

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

No branches or pull requests

4 participants