Skip to content

fix: remove import specifiers with correct end offset#162

Merged
huang-julien merged 5 commits into
nuxt:mainfrom
KazariEX:fix/remove-import-specifier
Dec 12, 2025
Merged

fix: remove import specifiers with correct end offset#162
huang-julien merged 5 commits into
nuxt:mainfrom
KazariEX:fix/remove-import-specifier

Conversation

@KazariEX

@KazariEX KazariEX commented Dec 5, 2025

Copy link
Copy Markdown
Member

🔗 Linked issue

❓ 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

The current code might result in the following code being transformed:

import { useSlots as _useSlots, /* defineComponent as _defineComponent */, createVNode as _createVNode } from "vue";

We should try using the start position of the next specifier as the end offset for the replacement.

Please feel free to modify my implementation as it's ugly!

@pkg-pr-new

pkg-pr-new Bot commented Dec 5, 2025

Copy link
Copy Markdown

Open in StackBlitz

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

commit: ca681a7

@huang-julien

Copy link
Copy Markdown
Member

Can you add a small test covering thisspecific case please ? :)

@huang-julien

Copy link
Copy Markdown
Member

there's some conflict you need to resolve before :) then i'll merge it

@huang-julien
huang-julien merged commit bb8c343 into nuxt:main Dec 12, 2025
3 checks passed
@KazariEX
KazariEX deleted the fix/remove-import-specifier branch December 12, 2025 11:11
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.

2 participants