Skip to content

fix: search through all matching import declaration for findImportSpecifier#167

Merged
huang-julien merged 1 commit into
mainfrom
fix/duplicatedimport
Dec 14, 2025
Merged

fix: search through all matching import declaration for findImportSpecifier#167
huang-julien merged 1 commit into
mainfrom
fix/duplicatedimport

Conversation

@huang-julien

Copy link
Copy Markdown
Member

🔗 Linked issue

fix #162

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

This PR makes findImportSpecifier look over all importDecl instead of looking for the first import. We can have code like

import { ref } from 'vue'
import { defineComponent } from 'vue'

that get defineComponenyt import from @nuxt/hints injected but not having the import from vue removed because the first line get matched.

@pkg-pr-new

pkg-pr-new Bot commented Dec 13, 2025

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/nuxt/hints/@nuxt/hints@167

commit: ecf7a19

@huang-julien
huang-julien merged commit 35ac99a into main Dec 14, 2025
6 checks passed
@huang-julien
huang-julien deleted the fix/duplicatedimport branch December 14, 2025 10:36
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.

1 participant