fix(prefer-import-from-vue): don't report names not exported by vue - #3081
Merged
waynzh merged 3 commits intoMay 14, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: 6a6c39f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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
reviewed
May 13, 2026
FloEdelmann
requested changes
May 13, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes vue/prefer-import-from-vue false-positives by avoiding reports for named imports/exports when none of the imported/exported names are actually exported by vue (addresses #2354).
Changes:
- Update rule logic to suppress reports for named imports/exports when all referenced names are not in
vue’s export list. - Adjust tests to move prior false-positive cases from
invalidtovalid, and add aninvalidmixed-names case (no autofix). - Update rule documentation and add a changeset entry for the patch release.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/rules/prefer-import-from-vue.js | Changes reporting logic to avoid flagging named imports/exports that vue can’t provide. |
| tests/lib/rules/prefer-import-from-vue.test.ts | Updates fixtures to reflect new non-reporting behavior and adds a mixed-names invalid case. |
| docs/rules/prefer-import-from-vue.md | Documents the refined reporting behavior for the rule. |
| .changeset/prefer-import-from-vue-non-exports.md | Adds a patch-level release note for the fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #2354
For
@vue/reactivityand@vue/shared, named imports/exports of bindings not re-exported byvue(e.g.pauseTrackingfrom@vue/reactivity) are no longer reported.@vue/runtime-domand@vue/runtime-coreare unchanged —vuere-exports everything from them.Two existing tests that pinned the false-positive behaviour moved from
invalidtovalid. Added oneinvalidcase for mixed-named imports (at least one name invue, no autofix possible).