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

Multiline comments are not stripped #279

Open
cjpearson opened this issue Oct 4, 2024 · 0 comments · May be fixed by #280
Open

Multiline comments are not stripped #279

cjpearson opened this issue Oct 4, 2024 · 0 comments · May be fixed by #280
Labels
bug Something isn't working

Comments

@cjpearson
Copy link

Environment

Node v20.18.0, [email protected]

Reproduction

mlly.hasESMSyntax(`/* export * */`, { stripComments: false }) // true ✅ 
mlly.hasESMSyntax(`/* export * */`, { stripComments: true }) // false ✅ 
mlly.hasESMSyntax(`/* 
  export * 
*/`, { stripComments: true }) // true ❌ 

Describe the bug

The strip comments functionality does not handle multiline comments resulting in incorrect results for hasESMSyntax and isValidNodeImport.

Additional context

No response

Logs

No response

@cjpearson cjpearson added the bug Something isn't working label Oct 4, 2024
cjpearson added a commit to cjpearson/mlly that referenced this issue Oct 7, 2024
cjpearson added a commit to cjpearson/mlly that referenced this issue Oct 7, 2024
cjpearson added a commit to cjpearson/mlly that referenced this issue Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant