Skip to content

Optionally ignore vue/no-unregistered-components warnings against recursive components #1304

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

Closed
arrudaje opened this issue Sep 21, 2020 · 0 comments · Fixed by #1305
Closed

Comments

@arrudaje
Copy link
Contributor

What rule do you want to change?
vue/no-unregistered-components

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.)?
My idea was to add the argument ignoreRecursive to the rule. If true, it would check the component's name against the name of the component it's inserted into (for this, the parent component needs to have its name property set), and, if they're the same, do not warn.

Please provide some example code that this change will affect:

<template>
    <span>{{ note.text }}</span>
    <Note
        v-for="reply in note.replies"
        :note="reply"
    />
</template>

<script>
    export default {
        name: 'Note',
        props: {
            note: {
                type: Object,
                required: true,
            },
        },
    };
</script>

What does the rule currently do for this code?
It marks the recursive Note component inserted in the template with a warning.

What will the rule do after it's changed?
The warning would not appear in recursive components, as the reference is in the name property, so it is self-registered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants