eslint-plugin-vue icon indicating copy to clipboard operation
eslint-plugin-vue copied to clipboard

Allow disabling file name checking for multi-word-component-names rule

Open ssipos90 opened this issue 3 years ago • 1 comments

Hi,

What rule do you want to change? multi-word-component-names

Does this change cause the rule to produce more or fewer warnings? Fewer warnings.

How will the change be implemented? (New option, new default behavior, etc.)? New option for disabling file name checking

What will the rule do after it's changed? Don't error/warn for single worded file names if the option disables it.

Additional context This rule enforces a specific file naming convention that's out if it's scope. How files are named and the overall project is structured does not impact the HTML single word ~~rule~~ conflict.

If I have a file in this structure: src/products/Show.vue, this rule forces me to write it src/products/ShowProduct.vue which is redundant; how it's used in .vue components is the only real concern.

<template>
  <show-product ... />
</template>
<script>
import ShowProduct from 'src/products/Show.vue';

return {
  components: {
    ShowProduct
  }
};
</script>

An option to disable it is fine (I'd remove it altogether for file names, it's out of bounds).

ssipos90 avatar Jan 25 '22 13:01 ssipos90

Thank you for posting this issue. If the user enables that option, we should also uncheck the name property as well. However, I think the rules need to check their names if they are using the components recursively in the template.

ota-meshi avatar Jan 25 '22 23:01 ota-meshi