Skip to content

Exclude some tags from vue/v-on-event-hyphenation and vue/attribute-hyphenation #2605

Closed
@highfredo

Description

@highfredo

What rule do you want to change?
vue/v-on-event-hyphenation and vue/attribute-hyphenation

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

How will the change be implemented? (New option, new default behavior, etc.)?
New option to exclude some tags from applying rules.
For example

{
  rules: {
    "vue/v-on-event-hyphenation": ["always", {
      exclude: ["custom-element-tag", /custom-element-.+/]
    }]
  }
}

Please provide some example code that this change will affect:

<template>
  <!-- error -->
  <vue-component fooBar="baz"></button>
  <!-- ok -->
  <vue-component foo-bar="baz"></button>
  <custom-element-tag barFoo="foo" @fooBar="baz"></custom-element-tag>
</template>

What does the rule currently do for this code?

What will the rule do after it's changed?

Additional context
I'm working on a project that includes some custom elements that don't follow kebab case rule, so when applying the rule these elements are broken.
This would help keep kebab-case in the vue component tags and camelCase in the custom elements

Not to be confused with ignore, which ignores attributes, not tags.

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