Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Rule proposal: slot-name-casing #2580

Copy link
Copy link
Closed
@markbrockhoff

Description

@markbrockhoff
Issue body actions

Please describe what the rule should do:
The proposed linter rule should allow limiting the casing for slot names.
For example in bigger projects it might happen that people mix camelCase and kebab-case for the names of component slots. To keep the codebase uniform it would be really helpful if a linter rule would warn or optionally even automatically fix invalid slot names according to the projects configuration.

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:

Bad:

<template>
  <div>
    <slot name="random-Slot_name" />
  </div>
</template

Good:

<template>
  <div>
    <slot name="randomSlotName" />
  </div>
</template

Good:

<template>
  <div>
    <slot name="random-slot-name" />
  </div>
</template

Additional context
It would most likely be enough to detect invalid slot names when a slot is defined. While fixing invalid usage of slots would be nice for existing projects adapting the rule but might also blow up it's complexity.

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.