You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a block of code which uses str.replace(/=*$/, '') to on a base64 string (round trip is not needed or wanted, I'm just generating random strings). First no-div-regex complained about this, then I updated the code to str.replace(/\=*$/, '') and no-useless-escape complained instead.
If you want I can open a bug with eslint, see if they'll add a ignore-div-regex boolean option to no-useless-escape. For now I'm just disabling no-div-regex on my own repo, leaving it to editors to disambiguate with regex syntax highlighting.
The text was updated successfully, but these errors were encountered:
I just did an additional test, it appears that str.replace(/[=]*$/, '') does not trip either rule and produces the desired result. I posted eslint/eslint#11355, we'll see if/how they want this handled.
While I still think the no-useless-escape rule should have an option to not conflict, I have decided to remove the no-div-regex rule. From looking closer at it, I don't really see the point of it. With syntax highlighting and proper formatting and spacing (which XO enforces), there's really no ambiguity.
I have a block of code which uses
str.replace(/=*$/, '')
to on a base64 string (round trip is not needed or wanted, I'm just generating random strings). Firstno-div-regex
complained about this, then I updated the code tostr.replace(/\=*$/, '')
andno-useless-escape
complained instead.If you want I can open a bug with eslint, see if they'll add a
ignore-div-regex
boolean option tono-useless-escape
. For now I'm just disablingno-div-regex
on my own repo, leaving it to editors to disambiguate with regex syntax highlighting.The text was updated successfully, but these errors were encountered: