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

Chore: refactor regex in config comment parser #12662

Merged
merged 1 commit into from Dec 20, 2019

Conversation

@mdjermanovic
Copy link
Member

mdjermanovic commented Dec 14, 2019

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

[X] Other, please explain:

A chore to avoid an error that occurs while bundling linter for the online demo.

regjsparser treats escaped - in character classes in a regex with the u flag as invalid syntax.

E.g., /[\-]/u

ref: jviereck/regjsparser#98

What changes did you make? (Give an overview)

Modified one regex in linter/config-comment-parser.js to avoid escaping -.

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

Are the new and the old regexes equivalent.

@kaicataldo

This comment has been minimized.

Copy link
Member

kaicataldo commented Dec 14, 2019

Was there a recent release that broke this? If so, could we lock it at an old version? Looks like it's breaking our CI builds.

@mdjermanovic

This comment has been minimized.

Copy link
Member Author

mdjermanovic commented Dec 14, 2019

It's happening with v0.6.1 of regjsparser, released less than 24h ago.

Would it be possible to lock it at the previous version? It seems to be a deep dependency.

Looks like this chore PR fixed the problem (this build is passing). On the other hand, refactoring a core feat because of the demo build doesn't look nice, although it's a very small change.

@Conduitry Conduitry mentioned this pull request Dec 15, 2019
0 of 2 tasks complete
@kaicataldo

This comment has been minimized.

Copy link
Member

kaicataldo commented Dec 16, 2019

@eslint/eslint-team Can we get some other opinions on this? This is currently making CI fail in master.

Copy link
Member

platinumazure left a comment

Might as well put this in. The regexes should be equivalent (- does not need to be escaped at the beginning or end of a character class, but does need to be escaped elsewhere, and order of characters in a character class shouldn't matter).

@mysticatea

This comment has been minimized.

Copy link
Member

mysticatea commented Dec 17, 2019

It may be good if we update webpack.config.js. For example, ["@babel/preset-env", { targets: "> 1%, not ie 11" }] will fix this as not using that problematic parser.

@kaicataldo

This comment has been minimized.

Copy link
Member

kaicataldo commented Dec 18, 2019

I don't think we support IE 11 on the site anymore anyway.

@mysticatea

This comment has been minimized.

Copy link
Member

mysticatea commented Dec 18, 2019

Right. The demo of our site doesn't support IE11 while a time.

Since jviereck/regjsparser#98 doesn't have positive reaction, I think better that we update our build to stop using regjsparser.

Copy link
Member

kaicataldo left a comment

I think it would be prudent to land this to fix CI ASAP and to follow up with @mysticatea's suggestion.

Copy link
Member

btmills left a comment

👍 to this as a temporary solution until @mysticatea's suggestion is implemented.

@kaicataldo kaicataldo merged commit 7171fca into master Dec 20, 2019
18 checks passed
18 checks passed
Verify Files
Details
Test (ubuntu-latest, 13.x)
Details
Test (ubuntu-latest, 12.x)
Details
Test (ubuntu-latest, 10.x)
Details
Test (ubuntu-latest, 8.x)
Details
Test (ubuntu-latest, 8.10.0)
Details
Test (windows-latest, 12.x)
Details
Test (macOS-latest, 12.x)
Details
Browser Test
Details
commit-message Commit message follows guidelines
Details
continuous-integration Build #20191214.1 succeeded
Details
continuous-integration (Test on Node.js 10 (Linux)) Test on Node.js 10 (Linux) succeeded
Details
continuous-integration (Test on Node.js 12 (Linux)) Test on Node.js 12 (Linux) succeeded
Details
continuous-integration (Test on Node.js 12 (Windows)) Test on Node.js 12 (Windows) succeeded
Details
continuous-integration (Test on Node.js 12 (macOS)) Test on Node.js 12 (macOS) succeeded
Details
continuous-integration (Test on Node.js 8 (Linux)) Test on Node.js 8 (Linux) succeeded
Details
licence/cla Contributor License Agreement is signed.
Details
release-monitor No patch release is pending
Details
@kaicataldo kaicataldo deleted the commentparser-regex-avoidescape branch Dec 20, 2019
@kaicataldo

This comment has been minimized.

Copy link
Member

kaicataldo commented Dec 20, 2019

Thanks for contributing!

@kaicataldo kaicataldo added accepted and removed evaluating labels Dec 20, 2019
@kaicataldo

This comment has been minimized.

Copy link
Member

kaicataldo commented Dec 20, 2019

Sorry, meant to mark this as accepted before merging since it had three approvals from TSC members in addition to being proposed by a team member.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.