Skip to content

fix(prefer-import-from-vue): don't report names not exported by vue - #3081

Merged
waynzh merged 3 commits into
vuejs:masterfrom
rodindev:fix/prefer-import-from-vue-non-exports
May 14, 2026
Merged

fix(prefer-import-from-vue): don't report names not exported by vue#3081
waynzh merged 3 commits into
vuejs:masterfrom
rodindev:fix/prefer-import-from-vue-non-exports

Conversation

@rodindev

@rodindev rodindev commented May 13, 2026

Copy link
Copy Markdown
Contributor

fix #2354

For @vue/reactivity and @vue/shared, named imports/exports of bindings not re-exported by vue (e.g. pauseTracking from @vue/reactivity) are no longer reported. @vue/runtime-dom and @vue/runtime-core are unchanged — vue re-exports everything from them.

Two existing tests that pinned the false-positive behaviour moved from invalid to valid. Added one invalid case for mixed-named imports (at least one name in vue, no autofix possible).

@changeset-bot

changeset-bot Bot commented May 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6a6c39f

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

Comment thread docs/rules/prefer-import-from-vue.md Outdated
Comment thread .changeset/prefer-import-from-vue-non-exports.md Outdated
Comment thread lib/rules/prefer-import-from-vue.js Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 invalid to valid, and add an invalid mixed-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.

Comment thread docs/rules/prefer-import-from-vue.md
Comment thread tests/lib/rules/prefer-import-from-vue.test.ts

@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.

Thank you! 🙂

@FloEdelmann
FloEdelmann requested review from ota-meshi and waynzh May 13, 2026 15:17

@waynzh waynzh 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.

thanks!

@waynzh
waynzh merged commit d37d17b into vuejs:master May 14, 2026
22 checks passed
@github-actions github-actions Bot mentioned this pull request May 14, 2026
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.

Incorrect prefer-import-from-vue for values that are not exported by vue

4 participants