-
Notifications
You must be signed in to change notification settings - Fork 657
☂️ Implement Regex Rules #159
Comments
@sebmck let me know if there are any rules we shouldn't implement that are listed here. |
@KevinKelbie I'd love to help work on these but I'm not sure what they are, can you give me a quick summary and a link to an example implementation in Rome. Which file do we put the rules in also? |
Hey, I would like to work on |
@zinyando I think the main file you want to look at is here because that's were the other rules are located such as |
@tatchi Tip: Use the |
Note that there are also some missing syntax implementation in the regex parser. Notably some unicode escapes and backreferences. Happy to accept PRs if anyone wants to implement them. |
I'll have a go at the |
Unclear how the |
@sebmck that is a fair shout. Should that be taken out then since it may not apply to Rome? |
If we're unsure how to tackle |
Are RegExp constructor calls ( |
@stephenwf They are. I think we should leave them as-is for the timebeing. We should figure out some strategy to extract the regex, explode it into a |
Hey, I can work on the |
Hi there, |
I'll try tackling |
I'll take on |
I'll do |
@KevinKelbie are POSIX character classes supported in javascript regex? It looks like Regexr only supports them for the PCRE engine. |
@wgardiner that does seem to be the case. Could we still add some linting to tell the user that its not a supported feature in the javascript version of regex? |
@KevinKelbie Sure, I can add a lint rule to throw an error for POSIX character classes and POSIX collating sequences |
I'll take a stab at I need to check to see if the unquantifiable types are defined but if not hopefully I can add those. |
@caffeinateoften I'll probably make a PR for |
I'd like to try |
I'd love to contribute. I'll pick up |
Guess I'll jump in. Can I claim |
I might not understand |
@macovedj I think your right however I find the error message to not be that helpful. It would be nice if the underline was under the incorrect flags rather than the start of the regex. What do you think? |
I can pick up timeout! |
I never commented here but I opened a PR for |
@KevinKelbie I think that |
@macovedj sorry for the late response, the underline still appears for me on |
@KevinKelbie Have you seen that is ready for review again? Also, is my understanding of |
Awesome!
It's been almost a month since we have heard anything from some of the assignees so I'd be happy to re-assign someone else to some of these issues. If anyone is stuggling with implementing their rule they have taken I'm sure some people on the discord would be able to point you in the right direction. If you are taking on an already assigned rule then perhaps you could tag the assignee to let them know and wait a day to let them respond. |
Feel free to take on rules that have been assigned but have had no movement on. |
Cool I'll probably start with some of the non-regex ones since they're older. |
turns out the rule was completed already |
Copying what I mentioned in #20
Thank you everyone! |
Followed is a list of ESLint rules that we should implement.
groupopen
Unmatched opening parenthesis.groupclose
Unmatched closing parenthesis.setopen
Unmatched opening square bracket.Example @baryla Disallow unmatched opening square bracket in regular expressions #176
rangerev
Range values reversed. Start char code is greater than end char code.quanttarg
Invalid target for quantifier. @caffeinateoften feat(parseOperator & parseQuantifier): '{' is parsed as Operator and … #189quantrev
Quantifier minimum is greater than maximum. @KevinKelbieimplement lint/invalidQuantifierRange #179implement quantrev #249esccharopen
Dangling backslash. @diokeyImplementDangling backslash #218esccharopen
Dangling backslash lint rule #181esccharbad
Unrecognized or malformed escape character. @ParkourKarthikesccharbad
Invalid escape sequence. @ParkourKarthikunicodebad
Unrecognized unicode category or script. @zinyandoposixcharclassbad
Unrecognized POSIX character class. @wgardinerposixcharclassnoset
POSIX character class must be in a character set. @wgardinernotsupported
The "{{~getLabel()}}" feature is not supported in this flavor of RegEx.extraelse
Extra else in conditional group. @zinyando Disallow extra else in regular expressions #170unmatchedref
Reference to non-existent group "{{name}}". @diokey Implement reference to non-existent group regex rule #197modebad
Unrecognized mode flag "{{errmode}}
". @macovedjbadmode
regex lint rule enhancement #195badname
Group name can not start with a digit. @tatchidupname
Duplicate group name. @tatchi Add noDuplicateGroupNamesInRegularExpressions lint rule #166branchreseterr
Branch Reset. Results will be ok, but RegExr's parser does not number branch reset groups correctly.timeout
The expression took longer than 250ms to execute.jsfuture
The "{{~getLabel()}}" feature may not be supported in all browsers.infinite
The expression can return empty matches, and may match infinitely in some use cases. @1ntEgr8fwdslash
Unescaped forward slash. This may cause issues if copying/pasting this expression into code.Please comment if you want to work on one of these and I'll mark you to avoid duplicating work. Mentions next to rules indicate that someone else is working on it. If a PR isn't opened within a few days then it will be up for grabs.
A checkmark indicates an open PR.
A reference implementation of these features can be found here
The text was updated successfully, but these errors were encountered: