Skip to content

The code behind multiline comments can not start a new line #5674

@bwy111

Description

@bwy111

Describe the bug

The code behind multiline comments can not start a new line, it with start at the multiline comments line.

Input code

const { a } = require('./a');
/**
 * test
 */
App({a});

Config

{
  "jsc": {
    "preserveAllComments": true,
    "parser": {
      "syntax": "ecmascript",
      "jsx": false
    },
    "target": "es5",
    "loose": false,
    "minify": {
      "compress": false,
      "format": {
        "indent_level": 2
      },
      "mangle": false
    }
  },
  "minify": false,
  "isModule": true,
  "module": {
    "type": "commonjs"
  }
}

Playground link

https://play.swc.rs/?version=1.2.245&code=H4sIAAAAAAAAA0vOzysuUahWSFSoVbBVKEotLM0sStVQ19NPVNe05tLX0uJS0FIoSS0uAdL6XI4FBRrVibWa1gBvmA8aNwAAAA%3D%3D&config=H4sIAAAAAAAAA0WOMQ7DIAxF7%2BKZqVIXtqpzz1Ah4kRENiDsRI0i7l5QaTsh877f9wmreLAn5IKCZccb0T0xY1QBq2VDA9mVhnpIjqjuBRbQsxNfQlYwzdC%2BZkeC1YC6sqD2iFwbo5QEBzXAIYb56CafuDfKD82psNOOQpxa%2B5NwRwJ7aU52caGvpda%2FZ%2BwGeaRp64nPwTymE%2FTI7e1tnOIqUOsbFfOIWPEAAAA%3D

Expected behavior

"use strict";
var a = require("./a").a;
/**
 * test
 */ 
App({
    a: a
});

Actual behavior

"use strict";
var a = require("./a").a;
/**
 * test
 */ App({
    a: a
});

Version

1.2.245

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions