-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
benchmark,lib,test,tools: remove unneeded . escape #9449
Conversation
I take it you aim to enable |
var methExpr = | ||
/^(?:method:?\s*)?(?:[^\.]+\.)?([^ \.\(\)]+)\([^\)]*\)\s*?$/i; | ||
/^(?:method:?\s*)?(?:[^.]+\.)?([^ .\(\)]+)\([^\)]*\)\s*?$/i; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can also un-escape parens inside character classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, indeed. Done! Rebased and force pushed. Thanks!
The `.` character does not need to be escaped when it appears inside a regular expression character class. This removes instances of unnecessary escapes of the `.` character. This also removes a few unnecessary escapes of the `(` and `)` characters within character classes too.
It's already enabled, but in the current version of ESLint, it catches far more instances of useless escapes in our code base than the version we are using. I think some of our "useless" escapes are reasonable as they improve readability, but there are certainly ones that (in my opinion) we can do without, and I'm removing those. In the meantime, I'm hoping a configuration option to ignore certain types of "useless" escaping (or even to turn it off entirely for regular expressions) lands in ESLint so that we can upgrade without turning off the rule entirely or reducing the readability of some of our regular expressions. (If that doesn't happen, I may try to contribute such a configuration option myself. If anyone reading this wants to beat me to it, that would be awesome.) |
Landed in 4463d2b |
The `.` character does not need to be escaped when it appears inside a regular expression character class. This removes instances of unnecessary escapes of the `.` character. This also removes a few unnecessary escapes of the `(` and `)` characters within character classes too. PR-URL: nodejs#9449 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: James Snell <[email protected]>
The `.` character does not need to be escaped when it appears inside a regular expression character class. This removes instances of unnecessary escapes of the `.` character. This also removes a few unnecessary escapes of the `(` and `)` characters within character classes too. PR-URL: #9449 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: James Snell <[email protected]>
@Trott should this be backported? |
The `.` character does not need to be escaped when it appears inside a regular expression character class. This removes instances of unnecessary escapes of the `.` character. This also removes a few unnecessary escapes of the `(` and `)` characters within character classes too. PR-URL: nodejs#9449 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: James Snell <[email protected]>
The `.` character does not need to be escaped when it appears inside a regular expression character class. This removes instances of unnecessary escapes of the `.` character. This also removes a few unnecessary escapes of the `(` and `)` characters within character classes too. PR-URL: nodejs#9449 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: James Snell <[email protected]>
Backports submitted. |
The `.` character does not need to be escaped when it appears inside a regular expression character class. This removes instances of unnecessary escapes of the `.` character. This also removes a few unnecessary escapes of the `(` and `)` characters within character classes too. PR-URL: #9449 Ref: #9749 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: James Snell <[email protected]>
The `.` character does not need to be escaped when it appears inside a regular expression character class. This removes instances of unnecessary escapes of the `.` character. This also removes a few unnecessary escapes of the `(` and `)` characters within character classes too. PR-URL: #9449 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: James Snell <[email protected]>
The `.` character does not need to be escaped when it appears inside a regular expression character class. This removes instances of unnecessary escapes of the `.` character. This also removes a few unnecessary escapes of the `(` and `)` characters within character classes too. PR-URL: #9449 Ref: #9749 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: James Snell <[email protected]>
The `.` character does not need to be escaped when it appears inside a regular expression character class. This removes instances of unnecessary escapes of the `.` character. This also removes a few unnecessary escapes of the `(` and `)` characters within character classes too. PR-URL: #9449 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: James Snell <[email protected]>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
benchmark lib test tools
Description of change
The
.
character does not need to be escaped when it appears inside aregular expression character class. This removes instances of
unnecessary escapes of the
.
character.