-
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
tools: relax lint rule for regexps #12807
Conversation
Relax the rule for maximum line length in JS files if the line contains a regular expression literal. This will avoid the need to convert a regular expression literal into a RegExp constructor call broken across multiple lines in order to satisfy the maximum line length rule. That practice hampers readability.
Replace RegExp constructors with regular expression literals where possible.
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.
👍 With both hands
When will JS get RegEx.VERBOSE 💚😞 |
This is great! The main purpose behind the |
Landed in f1d593c...6bcf65d |
Relax the rule for maximum line length in JS files if the line contains a regular expression literal. This will avoid the need to convert a regular expression literal into a RegExp constructor call broken across multiple lines in order to satisfy the maximum line length rule. That practice hampers readability. PR-URL: #12807 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Replace RegExp constructors with regular expression literals where possible. PR-URL: #12807 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Relax the rule for maximum line length in JS files if the line contains a regular expression literal. This will avoid the need to convert a regular expression literal into a RegExp constructor call broken across multiple lines in order to satisfy the maximum line length rule. That practice hampers readability. PR-URL: nodejs#12807 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Replace RegExp constructors with regular expression literals where possible. PR-URL: nodejs#12807 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Should this be backported to |
Relax the rule for maximum line length in JS files if the line contains a regular expression literal. This will avoid the need to convert a regular expression literal into a RegExp constructor call broken across multiple lines in order to satisfy the maximum line length rule. That practice hampers readability. PR-URL: nodejs#12807 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Replace RegExp constructors with regular expression literals where possible. PR-URL: nodejs#12807 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Relax the rule for maximum line length in JS files if the line contains a regular expression literal. This will avoid the need to convert a regular expression literal into a RegExp constructor call broken across multiple lines in order to satisfy the maximum line length rule. That practice hampers readability. PR-URL: #12807 Backport-PR-URL: #13776 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Replace RegExp constructors with regular expression literals where possible. PR-URL: #12807 Backport-PR-URL: #13776 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Relax the rule for maximum line length in JS files if the line contains a regular expression literal. This will avoid the need to convert a regular expression literal into a RegExp constructor call broken across multiple lines in order to satisfy the maximum line length rule. That practice hampers readability. PR-URL: #12807 Backport-PR-URL: #13776 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Replace RegExp constructors with regular expression literals where possible. PR-URL: #12807 Backport-PR-URL: #13776 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Relax the rule for maximum line length in JS files if the line contains
a regular expression literal. This will avoid the need to convert a
regular expression literal into a RegExp constructor call broken across
multiple lines in order to satisfy the maximum line length rule. That
practice hampers readability.
In lib and test (but mostly test), replace RegExp constructors with regular expression literals where
possible.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
tools lib test