Skip to content

[multiline-comment-style] autofix removes indentation in the comment #12312

@mysticatea

Description

@mysticatea

Tell us about your environment

  • ESLint Version: 6.4.0
  • Node Version: 12.10.0
  • npm Version: 6.11.3

What parser (default, Babel-ESLint, etc.) are you using?

Default.

Please show your full configuration:
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

Online Demo.

/*eslint multiline-comment-style: [error] */

/*
{
    "foo": 1,
    "bar": 2
}
*/

What did you expect to happen?

ESLint fixes it to:

/*eslint multiline-comment-style: [error] */

/*
 * {
 *     "foo": 1,
 *     "bar": 2
 * }
 */

What actually happened? Please include the actual, raw output from ESLint.

ESLint fixed it to:

/*eslint multiline-comment-style: [error] */

/*
 * {
 * "foo": 1,
 * "bar": 2
 * }
 */

The indentation in the comment is broken.

Are you willing to submit a pull request to fix this bug?

Yes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionautofixThis change is related to ESLint's autofixing capabilitiesbugESLint is working incorrectlyruleRelates to ESLint's core rules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions