Skip to content

fix(parseStaticImport): omit empty import names#232

Merged
pi0 merged 1 commit intounjs:mainfrom
patzick:fix/empty-sources-map
Feb 23, 2024
Merged

fix(parseStaticImport): omit empty import names#232
pi0 merged 1 commit intounjs:mainfrom
patzick:fix/empty-sources-map

Conversation

@patzick
Copy link
Copy Markdown
Contributor

@patzick patzick commented Feb 23, 2024

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ 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

Hey @pi0,
the last release is causing problems for imports formatted by prettier, where the comma is added at the end, like

import {
  something,
  somethingElse,
} from "package"

that causes errors in unimport:
image

This PR fixes that and adds a test to make sure we're covering that case. Cheers!

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.27%. Comparing base (226a47b) to head (6cbcf1b).
Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #232      +/-   ##
==========================================
- Coverage   88.04%   87.27%   -0.78%     
==========================================
  Files           8        8              
  Lines        1062     1092      +30     
  Branches      188      199      +11     
==========================================
+ Hits          935      953      +18     
- Misses        127      139      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

Thanks!

@pi0 pi0 changed the title fix: omit empty import names fix(parseStaticImport): omit empty import names Feb 23, 2024
@pi0 pi0 merged commit 83699b6 into unjs:main Feb 23, 2024
@patzick patzick deleted the fix/empty-sources-map branch November 9, 2025 13:32
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