Skip to content

Commit 84797b2

Browse files
Trottgibfahn
authored andcommitted
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: #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>
1 parent b58972a commit 84797b2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.eslintrc.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ rules:
101101
key-spacing: [2, {mode: minimum}]
102102
keyword-spacing: 2
103103
linebreak-style: [2, unix]
104-
max-len: [2, {code: 80, ignoreUrls: true, tabWidth: 2}]
104+
max-len: [2, {code: 80,
105+
ignoreRegExpLiterals: true,
106+
ignoreUrls: true,
107+
tabWidth: 2}]
105108
new-parens: 2
106109
no-mixed-spaces-and-tabs: 2
107110
no-multiple-empty-lines: [2, {max: 2, maxEOF: 0, maxBOF: 0}]

0 commit comments

Comments
 (0)