Skip to content

Rule suggestion: vue/require-explicit-slots to require all slots to be documented #2294

Closed
@Amixx

Description

@Amixx

Please describe what the rule should do:
I would like a rule that requires defineSlots to be present if there are any slots in the component - could be called vue/no-undeclated-slots or something similar. I did not find a rule that does this in the rule list, and did not find a relevant issue.

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:

<template>
<slot></slot>
</template>

<script setup lang="ts">
// any code, except `defineSlots`
</script>

Additional context
I am sorry if this issue is not submitted correctly, and will fix any errors. I am also willing to try to implement the rule myself if anyone can give me a starting point (maybe a rule that is somewhat similar)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions