Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mysticatea opened this issue Sep 25, 2019 · 1 comment · May be fixed by rsumner868/librealsense2.1#1, rsumner868/librealsense#4, O330oei/node#4 or O330oei/node#11

Comments

@mysticatea
Copy link
Member

@mysticatea mysticatea commented Sep 25, 2019

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.

@kaicataldo
Copy link
Member

@kaicataldo kaicataldo commented Sep 25, 2019

Verified and agree that this looks like a bug.

kaicataldo added a commit that referenced this issue Sep 26, 2019
kaicataldo added a commit that referenced this issue Sep 26, 2019
@kaicataldo kaicataldo added the autofix label Sep 26, 2019
kaicataldo added a commit that referenced this issue Nov 18, 2019
…12316)

* Fix: preserve whitespace in multiline-comment-style (fixes #12312)

* Add support for preserving whitespace in other comment types

* Handle blank lines in starred-block comments correctly

* Add more tests

* Fix starred-block alignment/missing star fixer

* Use RegExp to check for whitespace-only lines

* Fix up comments
@eslint eslint bot locked and limited conversation to collaborators May 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.