+
Skip to content

Multiline comments are not stripped #279

Open
@cjpearson

Description

@cjpearson

Environment

Node v20.18.0, mlly@1.7.1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载