Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix(plugin/babel): bypass directly required plugins or presets in babel config #590

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

mridgway
Copy link
Contributor

@mridgway mridgway commented Apr 9, 2024

Babel supports importing or directly declaring plugins in the JS configuration. Currently knip will throw an error trying to parse the plugin name if a plugin/preset is directly imported.

Example config directly from babel monorepo: https://github.com/babel/babel/blob/main/babel.config.js#L199

I'm not sure if knip will actually handle the require/import in JS babel configs yet, but this at least makes it not throw.

@webpro webpro merged commit 77329af into webpro-nl:main Apr 9, 2024
8 of 11 checks passed
@webpro
Copy link
Collaborator

webpro commented Apr 9, 2024

🚀 This pull request is included in v5.9.2. See Release 5.9.2 for release notes.

Using Knip in a commercial project? Please consider sponsoring me.

@webpro
Copy link
Collaborator

webpro commented Apr 9, 2024

Thanks @mridgway!

@mridgway mridgway deleted the fixBabelPluginResolution branch April 9, 2024 21:09
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