Skip to content

fix(no-deprecated-slot-attribute): apply ignore and ignoreParents to v-bind:slot - #3211

Merged
ota-meshi merged 1 commit into
vuejs:masterfrom
NgoQuocViet2001:fix-slot-attribute-ignore-v-bind
Oct 29, 2026
Merged

ota-meshi merged 1 commit into
vuejs:masterfrom
NgoQuocViet2001:fix-slot-attribute-ignore-v-bind

Conversation

@NgoQuocViet2001

Copy link
Copy Markdown
Contributor

The ignore and ignoreParents options were only checked for a static slot="...". A bound slot on the same ignored element, or under the same ignored parent, was still reported. --fix then wrapped it in <template v-slot:[...]>, and that breaks named slots on web components:

<!-- { ignoreParents: ['my-web-component'] } -->
<my-web-component>
  <div slot="start">A</div>     <!-- ignored -->
  <div :slot="slotName">B</div> <!-- reported, then rewritten to <template v-slot:[slotName]> -->
</my-web-component>

This change moves the existing ignore check into a small helper that both the slot and the v-bind:slot handlers call. Elements that are not ignored are still reported and fixed as before. Follow-up to #2784, which added ignoreParents.

  • Ran: npx vitest run tests/lib: 291 files, 11745 tests pass. On master, the 4 new cases fail.
  • Ran: npm run build && npm run tsc: no errors.
  • Checked: eslint on the changed files and markdownlint "**/*.md" report nothing.

@changeset-bot

changeset-bot Bot commented Oct 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 977993e

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 Patch

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

@FloEdelmann FloEdelmann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Makes sense to me, thank you!

@FloEdelmann
FloEdelmann requested a review from a team October 26, 2026 18:06

@ota-meshi ota-meshi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Thank you!

@ota-meshi
ota-meshi merged commit cf90d7f into vuejs:master Oct 29, 2026
17 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants