vuejs/eslint-plugin-vue

"eslint-plugin-vue": "~10.3.0" raises error: component name "default" should always be multi-word.eslintvue/multi-word-component-names

Closed this issue · 1 comments

What rule do you want to change?
"eslint-plugin-vue": "~10.3.0"

Does this change cause the rule to produce more or fewer warnings?
Fewer warnings. It would allow special framework-convention filenames like default.vue, index.vue, error.vue, and 404.vue without triggering the rule.

How will the change be implemented? (New option, new default behavior, etc.)?
Modify a new behavior to ignore files like default, index and error without putting them in ignore section of .eslintrc

Please provide some example code that this change will affect:

<!-- default.vue -->
<template>
  <div>Default layout</div>
</template>

What does the rule currently do for this code?
Component name "default" should always be multi-word.eslintvue/multi-word-component-names

What will the rule do after it's changed?
Without warning or errror we will create default.vue in version 10

I don't think this would be a good default for most people:

  • Not everyone uses a framework (e.g. Nuxt.js) where default.vue etc. is common.
  • Different frameworks might have different common component names, and we don't want to ignore them all by default.
  • There is already an ignores option to ignore certain component names: https://eslint.vuejs.org/rules/multi-word-component-names.html#ignores-todo
  • This option can be set on a per-repo or even per-directory level, so that those are e.g. only ignored in a layouts directory.
  • These exceptions can be put in a sharable config specific to a framework, e.g. @nuxt/eslint-config.
  • Alternatively, the rule can be disabled on a per-file basis with <!-- eslint-disable vue/multi-word-component-names -->.
  • Or, the rule can be disabled globally if not adhering to the style guide rule is deemed acceptable for a project.