mlly icon indicating copy to clipboard operation
mlly copied to clipboard

Multiline comments are not stripped

Open cjpearson opened this issue 1 year ago • 0 comments

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 avatar Oct 04 '24 16:10 cjpearson