vuejs / eslint-plugin-vue

Official ESLint plugin for Vue.js
https://eslint.vuejs.org/
MIT License
4.47k stars 667 forks source link

Only allow specific compontent names #2568

Open fisker opened 1 month ago

fisker commented 1 month ago

Please describe what the rule should do:

Enforce consistency component name prefix. This rule should accept options to enforce component matches names or name patterns.

What category should the rule belong to?

[x] Enforces code style (layout) [ ] Warns about a potential error (problem) [ ] Suggests an alternate way of doing something (suggestion) [ ] Other (please specify:)

Provide 2-3 code examples that this rule should warn about:

<!-- Good -->
<keep-alive></keep-alive> <!-- builtin -->
<button/> <!-- html tag -->
<foo-button/> <!-- allowed with option `/^foo\-/` -->

<!-- Bad -->
<bar-button/>

Additional context

N/A

ota-meshi commented 3 weeks ago

Thank you for proposing the rule. That rule sounds good to me.