From 235656df8dd9236ddc9c9bf797f581630d2fd349 Mon Sep 17 00:00:00 2001 From: Lam Wei Li Date: Sat, 12 Mar 2022 15:16:00 +0800 Subject: [PATCH] chore(lint): should not disable eslint rule, no-cond-assign, in file-level --- .eslintrc | 1 + lib/appenders/multiprocess.js | 1 - lib/appenders/tcp.js | 1 - lib/layouts.js | 1 - 4 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.eslintrc b/.eslintrc index 65d85be..75260ea 100644 --- a/.eslintrc +++ b/.eslintrc @@ -11,6 +11,7 @@ "indent": 2, "func-names": 0, "max-len": [1, 120, 2], + "no-cond-assign": ["error", "except-parens"], "no-use-before-define": ["warn"], "no-param-reassign": 0, "no-plusplus": ["error", { "allowForLoopAfterthoughts": true }], diff --git a/lib/appenders/multiprocess.js b/lib/appenders/multiprocess.js index 50810a3..5a3a442 100644 --- a/lib/appenders/multiprocess.js +++ b/lib/appenders/multiprocess.js @@ -100,7 +100,6 @@ function workerAppender(config) { function emptyBuffer() { let evt; debug('(worker) emptying worker buffer'); - /* eslint no-cond-assign:0 */ while ((evt = buffer.shift())) { write(evt); } diff --git a/lib/appenders/tcp.js b/lib/appenders/tcp.js index f5ee9b5..8098d48 100644 --- a/lib/appenders/tcp.js +++ b/lib/appenders/tcp.js @@ -18,7 +18,6 @@ function appender(config, layout) { function emptyBuffer() { let evt; debug('emptying buffer'); - /* eslint no-cond-assign:0 */ while ((evt = buffer.shift())) { write(evt); } diff --git a/lib/layouts.js b/lib/layouts.js index dad2797..8223ce6 100644 --- a/lib/layouts.js +++ b/lib/layouts.js @@ -340,7 +340,6 @@ function patternLayout(pattern, tokens) { let result; let searchString = pattern; - /* eslint no-cond-assign:0 */ while ((result = regex.exec(searchString)) !== null) { // const matchedString = result[0]; const padding = result[1];