Commits
Click on a commit to change the comparison rangefeat(regex-parser): parse simple `TemplateLiterals` (#13265)
This PR adds the function to parse `TemplateLiteral`s.
If the `new RegExp(`${variable}`)` or `new RegExp("", `${foo}`)` the parsing will be skipped, this is a different behavior then for `StringLiteral`s.
https://github.com/eslint/eslint/blob/5082fc206de6946d9d4c20e57301f78839b3b9f2/tests/lib/rules/no-misleading-character-class.js#L91-L93
I would like to have a strict algo, when a regexp will be parsed and not. Currently, every rule does it by its own.
https://github.com/oxc-project/oxc/blob/2cd4c7b42cd7d4d455dd1f64ee453e05d5da26ef/crates/oxc_linter/src/rules/eslint/no_control_regex.rs#L322
Moved some structs into the parent directory, so it can be consumed by both parsers. I guess `ParserTrait` could be helpful to share common methods like
- consume_hex_digits
- parse_unicode_escape_sequence