Skip to content

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

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
kazuma0129 opened this issue Nov 14, 2023 · 0 comments · Fixed by #2314

Comments

@kazuma0129
Copy link
Contributor

kazuma0129 commented Nov 14, 2023

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

@kazuma0129 kazuma0129 changed the title Add new option to specify tags to ignore rules vue/no-deprecated-slot-attribute Rule suggestion: Add new option to specify tags to ignore rules vue/no-deprecated-slot-attribute Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant