Port @eslint-community/regexpp #1559
togami2864
started this conversation in
Ideas
Replies: 2 comments 6 replies
-
I think it is a good idea! Do you want to implement this parser? |
Beta Was this translation helpful? Give feedback.
1 reply
-
OXC is also adding a regex parser. Could be worth to take a look at :) |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
There's some ECMA regex related rules like no-misleading-character-class, no-useless-escape.
ESLint leverages @eslint-community/regexpp, ecma script regex parer to implement these rules, while Biome lacks a dedicated regex parser, leading to the implementation of simple regex parsers within individual rules to manage diverse regex inputs.
e.g.
biome/crates/biome_js_analyze/src/semantic_analyzers/nursery/no_misleading_character_class.rs
Lines 291 to 618 in bc3bd4e
biome/crates/biome_js_analyze/src/analyzers/suspicious/no_control_characters_in_regex.rs
Lines 73 to 198 in 593da22
And some bugs have been reported.
Consequently, I propose porting @eslint-community/regexpp into biome. An additional note is made of the absence of an ECMA regex parser in Rust on crates.io.
pros:
cons:
This is just an idea. What do you think?
Beta Was this translation helpful? Give feedback.
All reactions