-
-
Notifications
You must be signed in to change notification settings - Fork 681
Make rule vue/no-unregistered-components ignore recursive components #1305
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
Make rule vue/no-unregistered-components ignore recursive components #1305
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR and report! Sorry for the late reply.
I didn't know that I could use self component in <template>
using the same name as name
option.
I think it's a bug, so I don't think it's necessary to add option.
@ota-meshi Thank you for your reply! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
Right now when we use recursive components (when we want to use the current component inside of itself - with the example of a
Note
component that can have a number of replies, that look and behave exactly like theNote
component, and they stack inside of one another), eslint-plugin-vue complains against it, making us disable this rule every time we want to use a recursive component.The suggestion is to include a new argument to the rule,
ignoreRecursive
, which, iftrue
, checks whether the name of the parent component is the same as the child component (making it thus a recursive component), not warning about this rule on it.Resolves #1304