Skip to content

feat(no-deprecated-slot-attribute): add ignoreParents option #2784

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

ST-DDT
Copy link
Contributor

@ST-DDT ST-DDT commented Jul 9, 2025

Adds #2710


Adds an ignoreParents: string[] option to no-deprecated-slot-attribute to allow ignoring web-component usecases:

<template>
	<web-component>
 		<Entry slot="entry" />
	</web-component>
</template>

Preview:


Note to self: Next PR(s):

Copy link

changeset-bot bot commented Jul 9, 2025

🦋 Changeset detected

Latest commit: cba96ee

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

@ST-DDT ST-DDT marked this pull request as ready for review July 9, 2025 21:31
@FloEdelmann FloEdelmann linked an issue Jul 10, 2025 that may be closed by this pull request
2 tasks
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 now. Thank you! 🙂

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds an ignoreParents option to the no-deprecated-slot-attribute rule so users can skip slot-attribute deprecation checks when a component is nested inside specified parent tags (e.g., web components).

  • Introduce ignoreParents in rule schema, parsing logic, and documentation
  • Extend tests to cover literal and regex-based ignoreParents matching
  • Update utility JSDoc to accept VDocumentFragment in isVElement

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/lib/rules/no-deprecated-slot-attribute.js Add valid/invalid test cases for ignoreParents
lib/utils/index.js Extend JSDoc for isVElement to include fragments
lib/rules/syntaxes/slot-attribute.js Import and apply ignoreParents in reporting logic
lib/rules/no-deprecated-slot-attribute.js Add ignoreParents to rule schema
docs/rules/no-deprecated-slot-attribute.md Document the new ignoreParents option
.changeset/beige-teams-camp.md Bump version with a minor release note
Comments suppressed due to low confidence (1)

docs/rules/no-deprecated-slot-attribute.md:53

  • [nitpick] Clarify that regex patterns in ignoreParents are matched against the component’s raw tag name (which can be kebab-case or PascalCase). You may want to note that users should include case-insensitive flags or patterns to cover both formats.
- `"ignoreParents"` (`string[]`) An array of tags or regular expression patterns (e.g. `/^custom-/`) for parents that ignore these rules. This option is especially useful for [Web-Components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components). Default is empty.

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.

vue/no-deprecated-slot-attribute conflicts with web component named slots
2 participants