Skip to content

Commit

Permalink
tools: relax lint rule for regexps
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-By: Vse Mozhet Byt <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
Trott authored and Olivier Martin committed May 6, 2017
1 parent add093a commit 06ce01e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,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}]
Expand Down

0 comments on commit 06ce01e

Please sign in to comment.