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

findStaticImports and findDynamicImports do not respect comments #153

Closed
pcbowers opened this issue Feb 27, 2023 · 0 comments · Fixed by #155
Closed

findStaticImports and findDynamicImports do not respect comments #153

pcbowers opened this issue Feb 27, 2023 · 0 comments · Fixed by #155

Comments

@pcbowers
Copy link

Environment

mlly: ^1.1.1
node: 18.14.2

Reproduction

import { findDynamicImports, findStaticImports } from "mlly"

console.log(findDynamicImports("// const foo = await import('bar')").length) // returns 1
console.log(findStaticImports("// import { foo } from 'bar' ").length) // returns 1

Describe the bug

Similar to findExports before #56 was merged, imports that have been commented out are still being parsed.

Additional context

No response

Logs

No response

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 a pull request may close this issue.

1 participant