Browse Source

tools: relax lint rule for regexps

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: https://github.com/nodejs/node/pull/12807
Backport-PR-URL: https://github.com/nodejs/node/pull/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>
v6.x
Rich Trott 8 years ago
committed by Myles Borins
parent
commit
99da83b54d
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 5
      .eslintrc.yaml

5
.eslintrc.yaml

@ -101,7 +101,10 @@ rules:
key-spacing: [2, {mode: minimum}]
keyword-spacing: 2
linebreak-style: [2, unix]
max-len: [2, {code: 80, ignoreUrls: true, tabWidth: 2}]
max-len: [2, {code: 80,
ignoreRegExpLiterals: true,
ignoreUrls: true,
tabWidth: 2}]
new-parens: 2
no-mixed-spaces-and-tabs: 2
no-multiple-empty-lines: [2, {max: 2, maxEOF: 0, maxBOF: 0}]

Loading…
Cancel
Save