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

[multline-comment-style] fix breaks code #12785

Closed
hornta opened this issue Jan 14, 2020 · 8 comments · Fixed by #12823
Closed

[multline-comment-style] fix breaks code #12785

hornta opened this issue Jan 14, 2020 · 8 comments · Fixed by #12823
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion autofix This change is related to ESLint's autofixing capabilities bug ESLint is working incorrectly good first issue Good for people who haven't worked on ESLint before help wanted The team would welcome a contribution from the community for this issue rule Relates to ESLint's core rules

Comments

@hornta
Copy link

hornta commented Jan 14, 2020

Tell us about your environment

  • ESLint Version: 6.7.2
  • Node Version: 12.14.1
  • npm Version: 6.13.4

What parser (default, Babel-ESLint, etc.) are you using?
babel-eslint@10.0.3

Please show your full configuration:

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.
When autofixing the following code it resulted in non-parseable js code. This is a minimal reproducible example.

/* eslint-enable multiline-comment-style */
/*
  // a line comment
  some.code();
*/

What did you expect to happen?
I expect it to not yield non-parseable code.

What actually happened? Please include the actual, raw output from ESLint.
It yielded non-parseable code

@hornta hornta added bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon labels Jan 14, 2020
@yeonjuan
Copy link
Member

yeonjuan commented Jan 14, 2020

Hello, I'm not an eslint member. But, In my opinion, it looks like a bug. reproduced- demo

/* eslint multiline-comment-style: ["error"] */
/*
  // a line comment
  some.code();
*/

after fix. -> Parsing error: Unterminated regular expression.

/* eslint multiline-comment-style: ["error"] */
/*
 *// a line comment
 *some.code();
 */

@aladdin-add aladdin-add added accepted There is consensus among the team that this change meets the criteria for inclusion autofix This change is related to ESLint's autofixing capabilities rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Jan 14, 2020
@aladdin-add
Copy link
Member

hi, thanks! labelled accepted, based on the repro-demo.

@kaicataldo kaicataldo added good first issue Good for people who haven't worked on ESLint before help wanted The team would welcome a contribution from the community for this issue labels Jan 14, 2020
@jpramassini
Copy link
Contributor

I'd be interested in jumping on this one if there aren't any other takers.

@kaicataldo
Copy link
Member

@jpramassini Please feel free! Let us know if you have any questions.

@karthikkp
Copy link
Contributor

@jpramassini Still working on this?

@jpramassini
Copy link
Contributor

Hey Karthik, sorry for the delay on this. I'm planning on knocking this out this weekend.

@jpramassini
Copy link
Contributor

@karthikkp I got the flu so I might be slower in getting to this than I thought. If you want to take a crack at it, go for it.

@karthikkp
Copy link
Contributor

@jpramassini Thank you. I am taking up this issue

kaicataldo pushed a commit that referenced this issue Jan 27, 2020
…) (#12823)

* Fix: multiline-comment-style rule missed an extra space after *  (fixes #12785)

* logic changed to handled only the edge case

* test case added for the edge case

* checks full offset and apply space after * only if there already isn't white space after it.

* addeed new test case
montmanu pushed a commit to montmanu/eslint that referenced this issue Mar 4, 2020
…nt#12785) (eslint#12823)

* Fix: multiline-comment-style rule missed an extra space after *  (fixes eslint#12785)

* logic changed to handled only the edge case

* test case added for the edge case

* checks full offset and apply space after * only if there already isn't white space after it.

* addeed new test case
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Jul 27, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jul 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion autofix This change is related to ESLint's autofixing capabilities bug ESLint is working incorrectly good first issue Good for people who haven't worked on ESLint before help wanted The team would welcome a contribution from the community for this issue rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants