Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(parseStaticImport): omit empty import names #232

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

patzick
Copy link
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.

Copy link

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
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
5 of 6 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants