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

Update: Regex incorrectly checks newline in comments (fixes #12263) #12407

Merged
merged 1 commit into from Oct 20, 2019
Merged

Update: Regex incorrectly checks newline in comments (fixes #12263) #12407

merged 1 commit into from Oct 20, 2019

Conversation

yeonjuan
Copy link
Member

What is the purpose of this pull request? (put an "X" next to item)

[X] Bug fix (#12263)

What changes did you make? (Give an overview)
Fix regex in sourceCode.isSpaceBetweenTokens()

Is there anything you'd like reviewers to focus on?
#12263

@jsf-clabot
Copy link

jsf-clabot commented Oct 11, 2019

CLA assistant check
All committers have signed the CLA.

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Oct 11, 2019
Copy link
Member

@kaicataldo kaicataldo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

lib/source-code/source-code.js Outdated Show resolved Hide resolved
@kaicataldo kaicataldo added accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features and removed triage An ESLint team member will look at this issue soon labels Oct 11, 2019
@yeonjuan yeonjuan changed the title Fix: isSpaceBetweenTokens() sees newline in multiline block comments as spaces(fixes #12263) Fix: isSpaceBetweenTokens() sees newline in multiline block comments as spaces (fixes #12263) Oct 11, 2019
@yeonjuan yeonjuan changed the title Fix: isSpaceBetweenTokens() sees newline in multiline block comments as spaces (fixes #12263) Fix: isSpaceBetweenTokens() incorrectly checks newline in comments (fixes #12263) Oct 11, 2019
@yeonjuan yeonjuan changed the title Fix: isSpaceBetweenTokens() incorrectly checks newline in comments (fixes #12263) Fix: Regex incorrectly checks newline in multiline comments (fixes #12263) Oct 11, 2019
@yeonjuan yeonjuan changed the title Fix: Regex incorrectly checks newline in multiline comments (fixes #12263) Fix: Regex incorrectly checks newline in comments (fixes #12263) Oct 11, 2019
Copy link
Member

@kaicataldo kaicataldo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mdjermanovic
Copy link
Member

The change LGTM, but I think that the commit message and PR title should be Update: because this is a bug fix that can produce more warnings.

At the moment It's probably only a few core rules where that could happen.

Example:

/* eslint space-before-function-paren:["error", "always"]*/

function foo/* comment
*/(){}

function foo// comment
(){}

This can also affect plugins.

Might be also good to somehow check will the flag be transpiled for the online demo, because it isn't widely supported in browsers yet.

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I agree with @mdjermanovic, this should be an Update as this can add more lint messages in some cases.

Could you please edit the PR title to use the "Update:" prefix? Thanks!

@yeonjuan yeonjuan changed the title Fix: Regex incorrectly checks newline in comments (fixes #12263) Update: Regex incorrectly checks newline in comments (fixes #12263) Oct 12, 2019
@yeonjuan
Copy link
Member Author

@platinumazure Ok! That make sense! Thanks!

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks for changing the commit summary!

We can leave this open another day or two in case more teammates want to review this.

Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@platinumazure the commit message is still Fix:, maybe to leave it as is and change the message while merging the PR?

@platinumazure
Copy link
Member

platinumazure commented Oct 13, 2019

@platinumazure the commit message is still Fix:, maybe to leave it as is and change the message while merging the PR?

@mdjermanovic On the GitHub interface, the default/suggested merge commit message is the PR title if there are two or more commits. So if we merge using GitHub, it will suggest the PR title in this case. That's why the "commit-message" status check is currently passing and nothing needs to be done here.

(When there is only one commit, that commit's message is suggested/used, so in that case, we would need to edit it on merge.)

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 bug ESLint is working incorrectly core Relates to ESLint's core APIs and features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants