Skip to content

vue/html-self-closing should consider <slot> to be a component tag, not a normal HTML tag #2190

Open
@catrope

Description

@catrope

What rule do you want to change?
vue/html-self-closing

Does this change cause the rule to produce more or fewer warnings?
N/A

How will the change be implemented? (New option, new default behavior, etc.)?
utils.isCustomComponent() would return true for <slot> tags

Please provide some example code that this change will affect:

<slot />

What does the rule currently do for this code?
If configured with {"void": "never", "normal": "never", "component": "always"}, the rule rejects self-closing <slot /> tags, because it considers them to be in the "normal" category.

What will the rule do after it's changed?
It will accept self-closing <slot /> tags even if "normal": "never" is set, because it considers them to be special Vue tags (like component tags).

Additional context
{"void": "never", "normal": "never", "component": "always"} is not the default setting for this rule, but it's the one that produces the most HTML-like Vue template syntax. We are switching to this config for that reason, and we were surprised that it resulted in <slot /> being rejected and changed to <slot></slot>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions