From 99da83b54da7c5d1cdc24220959ff81154a6e74f Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 2 May 2017 22:01:57 -0700 Subject: [PATCH] tools: relax lint rule for regexps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Vse Mozhet Byt Reviewed-By: Refael Ackermann Reviewed-By: Yuta Hiroto Reviewed-By: Сковорода Никита Андреевич Reviewed-By: James M Snell Reviewed-By: Anna Henningsen --- .eslintrc.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 87780936f3..9decb302d6 100644 --- a/.eslintrc.yaml +++ b/.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}]