Skip to content

Rule suggestion: Add new option to specify tags to ignore rules vue/no-deprecated-slot-attribute #2313

Closed
@kazuma0129

Description

@kazuma0129

What rule do you want to change?
vue/no-deprecated-slot-attribute

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

How will the change be implemented? (New option, new default behavior, etc.)?
New option

Please provide some example code that this change will affect:

Suppose we have a code like this.

<template>
  <!-- bad -->
  <div slot="one"></div>
  <a slot="two"></div>
  <my-component slot="three"></div>
</template>

What I would like is an option like this.
Specifically, an option that allows the tag name to be passed as an array.

rules: {
    "vue/no-deprecated-slot-attribute": [
      "error",
      { ignore: ["a", "my-component"] }
    ],
}

As a result, this rule will be excluded for slots with tags specified as "ignore".

<template>
  <!-- still bad -->
  <div slot="one"></div>
  <!-- good -->
  <a slot="two"></div>
  <my-component slot="three"></div>
</template>

What does the rule currently do for this code?
There is no such option.
It’s just applying or not applying the rule, which does not seem flexible to me.

What will the rule do after it's changed?
This option allows explicit and centralized control of where the rule is being ignored.

This is useful for custom elements that have slots as attributes.
Currently, the rule must be turned off or disabled each time it is used.

Additional context

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