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
Thank you for posting the issue.
Hmm🤔. I'm not sure the prefer-lookaround rule should report that far. As you wrote Hi->Hello is easier to read the first one.
In the first example, I prefer 'a'.replace(/a/, 'a-') because it's simpler.
The only advantage of this transformation seems to be that it reduced redundancy.
This makes regexes more complex. Using a lookbehind to reduce some redundancy is a clever trick, but it's also not trivial to understand.
The prefix needs to be at least 6 characters long to produce shorter source code.
The resulting regexes might be harder to change. Whether you can do this trick depends on the pattern, so you might need to undo the trick to change the regex.
In the first example, I prefer 'a'.replace(/a/, 'a-') because it's simpler.
Should we prefer
over
?
I'm not sure about this. Since it may make code unreadable.
The text was updated successfully, but these errors were encountered: