-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
ESLint: Added regexp plugin #2924
Conversation
JS File Size Changes (gzipped)A total of 42 files have changed, with a combined diff of -83 B (-0.2%).
|
This is kinda awesome, and I love how it makes every language slightly smaller. As for the other rule, maybe open in a separate PR and discuss there? Would be good to see the impact on the code. |
In that case, we might also want to add the
Good idea. There are also a few other rules I would like to add. I'll make PRs for each. |
This PR adds the
eslint-plugin-regexp
plugin. This plugin statically analyses regex patterns and usages to find potential problems and suggest improvements. (Full disclaimer: I am a maintainer of the plugin.)Right now, I only enabled a few rules to handle common things in code review (all warnings) and a few rules to detect (potential) errors.
@LeaVerou @Golmote @mAAdhaTTah
There is another really good rule I am unsure about adding, the
regexp/no-dupe-disjunctions
rule. This rule actually finds more than a dozen bugs in our regexes (not fixed here) and even points out likely causes of exp backtracking directly and live in the IDE.However, the rule is slow. Right now, it increases the total linting time 5x (
npm run lint
), from 5s to 25s on my machine. This doesn't seem to be a problem for live code editing/viewing.Should I also enable the
regexp/no-dupe-disjunctions
rule?