You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disallow name from being set on Option API style components.
The name property should generally be the file name, and since vue-loader defaults the component name with the file name, it's not necessary to set manually.
This rule will be helpful in discouraging the practice and removing unused strings in the codebase for a smaller bundle size.
FYI In Vue 3, there's no way to set the component name; it's just the file name.
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:
Please describe what the rule should do:
Disallow
name
from being set on Option API style components.The
name
property should generally be the file name, and since vue-loader defaults the component name with the file name, it's not necessary to set manually.This rule will be helpful in discouraging the practice and removing unused strings in the codebase for a smaller bundle size.
FYI In Vue 3, there's no way to set the component name; it's just the file name.
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:
However, I think recursive components should be fine (unless vue-loader is able to resolve the self-recursion by file name):
Additional context
Perhaps this rule can be merged with https://eslint.vuejs.org/rules/require-name-property.html
The text was updated successfully, but these errors were encountered: