better-regex
autofix breaks regular expression syntax: /|/g
-> //g
#2314
Labels
better-regex
autofix breaks regular expression syntax: /|/g
-> //g
#2314
An empty regular expression such as
//
is invalid and parsed as a line comment instead, which breaks other syntax within the code. I would expect thebetter-regex
rule to not propose code with empty regular expressions.The following is a minimal example:
I would expect this expression to be corrected to something like:
The text was updated successfully, but these errors were encountered: