Skip to content

feat(no-restricted-html-elements): support array of elements #2750

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

Merged
merged 2 commits into from
Jun 6, 2025

Conversation

ShayanTheNerd
Copy link
Contributor

This addition helps reduce duplication in a scenario like the following.

This:

'vue/no-restricted-html-elements': [
  'error',
  { element: 'a', message: 'Use `<ULink>`.' },
  { element: 'NuxtLink', message: 'Use `<ULink>`.' },
  { element: 'RouterLink', message: 'Use `<ULink>`.' },
],

Becomes this:

'vue/no-restricted-html-elements': [
  'error',
  {
    element: ['a', 'RouterLink', 'NuxtLink'],
    message: 'Use `<ULink>`.'
  },
],

Note: I purposely didn't change the key from element to elements to avoid breaking changes.

Copy link

changeset-bot bot commented Jun 1, 2025

🦋 Changeset detected

Latest commit: aeb51f6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
eslint-plugin-vue Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@FloEdelmann FloEdelmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you 🙂

Copy link
Member

@waynzh waynzh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks!

@waynzh waynzh merged commit cf261fb into vuejs:master Jun 6, 2025
11 checks passed
@github-actions github-actions bot mentioned this pull request May 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants