-
-
Notifications
You must be signed in to change notification settings - Fork 501
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
[$50 Opire Bounty] feat(linter): eslint/no-invalid-regexp #611
Comments
Hi. To implement this rule, it seems necessary to implement a parser like @eslint-community/regexpp. Where is this planned to be implemented? |
We don't have a regex parser yet but it's open for contributions by veterans like you! If you are interested in learning Rust by implementing a regex parser, please reach out and I'll guide you. To get started, we have a small tutorial here where some of the chapters are already translated into Japanese 😁 https://oxc-project.github.io/javascript-parser-in-rust/ja/ |
Oh, thank you for the detailed information.
The Japanese version is great! As a native speaker, I might be able to contribute to the translation into Japanese. |
Oops, I forgot to mention one thing. |
No no, we can merge small pieces and collectively iterate on it so no effort is lost. Just send in small PRs. You may wish to try https://graphite.dev for such tasks. |
Thank you. For now, I'll give a small prototype a try.
Oh, there's a tool like this? Thanks for introducing it to me. I didn't know about it, so I'll take a closer look! |
Hi, I tried coding a prototype regex parser some time ago in my fork. It can (afaik correctly) parse all regexes I found in the MDN docs. The main issues are imo the lack of a lexer (which would help with some backslash edge cases and string-vs-literal normalization) and messy output when dealing with unicode. I temporarily gave up on it due to encountering too many small tedious issues (escaping, spans, output, ...) and then later also starting projects for school. I'd like to continue working on it in around two weeks, once I'll hopefully finish the schoolwork. Feel free to either pick it up in the meantime or take inspiration for your version. I can clean it up tomorrow and possibly PR it in here. (and sorry, I should have written somewhere earlier that I was working on it) |
I see. I didn't know that. I have a suggestion: since you've made so much progress, why not create a feature branch in this repository for the regex-parser so everyone can collaborate there? And for issues related to this parser, it might be a good idea to leave documentation and address remaining concerns as separate issues. What do you think? In any case, it might be better not to have too many significant changes in the forked repository and merge them into the feature branch of this repository while sharing issues with everyone. cc @Boshen |
At the very least, since this issue originally pertained to eslint/no-invalid-regexp, I've created a separate issue for the regular expression parser. |
I agree. Upon closer inspection (as in remembering what I did then) the branch can't be directly integrated to oxc since it also overwrites a linter rule for testing, making it unusable for now. Also the code structure isn't great as it was created hastily without preplanning and doesn't use existing oxc infra. That means we are probably better off starting from scratch, just reusing the parsing logic, which is imo ok. |
I created this reward to encourage this issue to be resolved as it hasn't received updates in a long time. |
Thank you both! Once this busy weekend is over, I’ll try applying for them. |
Paid ✌️ Thank you for your contribution! I hope you can enjoy more Opire bounties and earn money by helping the OSS 🤗 |
Also confirmed. Thank you so much~! 🙌🏻 |
Implement ESLint's
no-invalid-regexp
rule.To get started, run
Bounty from @nabby27: https://app.opire.dev/issues/01HWTY9ZE1GM8XSS2QQGD84068
The text was updated successfully, but these errors were encountered: