-
-
Notifications
You must be signed in to change notification settings - Fork 670
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
Rule Proposal: vue/ban-component-names
#2180
Comments
Note that we already have the |
Sry, I missed it. Could what I descripted be an enhancement? |
Would you fancy opening a PR to add a "Related rules" section to both rules to link them together and avoid this in the future?
|
Of course.
Should I open a new issue to follow this, or in this issue?
Well, I can think of somethings immediately like:
Although it is not recommended, I think users may want to only disallow part of html tag names but not all. |
I think a new issue makes more sense.
I think in this case, disabling the whole rule is better. Either you want to enforce not using HTML names for your components, or you don't care. |
I found this issue after realizing that I've disabled the {
"extends": ["plugin:vue/vue3-recommended"],
"rules": {
"vue/multi-word-component-names": ["error", { "ignores": ["Dashboard", "Main", "Widget"] }],
"vue/no-reserved-component-names": ["error", { "ignores": ["Main"] }]
}
} I care about enforcing not using html names for my components, except for this once exception ( |
Thanks for your explanation, it makes sense to me. Can you please open a new issue and link to this thread, to keep the issues actionable? |
Please describe what the rule should do:
Ban some component names, such as those that are the same to native html tag or built-in components.
I think this rule can include
vue/multi-word-component-names
.For
vue/multi-word-component-names
, I have encountered many developers who do not find this rule helpful as it is turned on by default, and it goes against their intuition since using a single word as a component name is very common in development, finally they will close the rule 😂.So I want this rule can enhance
vue/multi-word-component-names
, provides more fine-tuned, intuitive control and greater customizability.What category should the rule belong to?
[ ] Enforces code style (layout)
[x] 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:
Additional context
We can collect html tag names from MDN.
Some potentially useful options:
allowHtmlTag: allow those that are same to html tagIt you approve, I am willing to make a PR for this.
The text was updated successfully, but these errors were encountered: