Skip to content

Inclusion of "eslint:recommended" #3

Closed
@jls-tschanzc

Description

@jls-tschanzc

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions