Skip to content

Comments starting with //= moved to previous line #8684

@fabien-michel

Description

@fabien-michel

v7 Regression

Describe the regression
A comment line starting with "//=" is moved at the end of the previous code line without comment
This is a problem for some process/macro relies on theses specifics comments lines to act.
This doesn't occur with pre 7 version of babel

Input Code

var toto = 1;
//= my comment

var truc="bidule";
// my comment

Compile to :

var toto = 1; //= my comment

var truc="bidule";
// my comment

Babel Configuration (.babelrc, package.json, cli command)

{
  { compact: false, presets: ["@babel/env"] }
}

Expected behavior/code

var toto = 1;
//= my comment

var truc="bidule";
// my comment

Environment

  • Babel version(s): v7.0.0
  • Node/npm version: Node 7

Metadata

Metadata

Assignees

No one assigned

    Labels

    7.x: regressionarea: commentsoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions