summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2021-07-11 15:35:09 -0700
committerMichaël Zasso <targos@protonmail.com>2021-07-17 12:50:09 +0200
commitd0fb02c26a67ff3572015855bbe6674ed35deb9a (patch)
tree3a331c2363378eb31556e1d06ed7c199bcd6fd0f
parentbbff5a9e47b7ed294169c239e153af31bb81837a (diff)
downloadnode-new-d0fb02c26a67ff3572015855bbe6674ed35deb9a.tar.gz
test: put common lint exceptions into config file
For lint exceptions that are universal or near universal for `test/common`, put the exceptions in a config file rather than disabling the ESLint rules at the top of each file. PR-URL: https://github.com/nodejs/node/pull/39358 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
-rw-r--r--test/common/.eslintrc.yaml3
-rw-r--r--test/common/arraystream.js1
-rw-r--r--test/common/benchmark.js2
-rw-r--r--test/common/countdown.js2
-rw-r--r--test/common/cpu-prof.js2
-rw-r--r--test/common/dns.js1
-rw-r--r--test/common/duplexpair.js1
-rw-r--r--test/common/fixtures.js1
-rw-r--r--test/common/fixtures.mjs1
-rw-r--r--test/common/heap.js1
-rw-r--r--test/common/hijackstdio.js1
-rw-r--r--test/common/http2.js1
-rw-r--r--test/common/index.js1
-rw-r--r--test/common/index.mjs2
-rw-r--r--test/common/internet.js1
-rw-r--r--test/common/measure-memory.js1
-rw-r--r--test/common/report.js1
-rw-r--r--test/common/require-as.js1
-rw-r--r--test/common/tls.js1
-rw-r--r--test/common/tmpdir.js1
-rw-r--r--test/common/udppair.js1
-rw-r--r--test/common/wpt.js1
-rw-r--r--test/common/wpt/worker.js2
23 files changed, 3 insertions, 27 deletions
diff --git a/test/common/.eslintrc.yaml b/test/common/.eslintrc.yaml
new file mode 100644
index 0000000000..b3981bdd27
--- /dev/null
+++ b/test/common/.eslintrc.yaml
@@ -0,0 +1,3 @@
+rules:
+ node-core/required-modules: off
+ node-core/require-common-first: off
diff --git a/test/common/arraystream.js b/test/common/arraystream.js
index 408d57712c..c9dae0512b 100644
--- a/test/common/arraystream.js
+++ b/test/common/arraystream.js
@@ -1,4 +1,3 @@
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';
const { Stream } = require('stream');
diff --git a/test/common/benchmark.js b/test/common/benchmark.js
index 56351c9250..88c918766f 100644
--- a/test/common/benchmark.js
+++ b/test/common/benchmark.js
@@ -1,5 +1,3 @@
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
-
'use strict';
const assert = require('assert');
diff --git a/test/common/countdown.js b/test/common/countdown.js
index 31507b6125..4aa86b4253 100644
--- a/test/common/countdown.js
+++ b/test/common/countdown.js
@@ -1,5 +1,3 @@
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
-
'use strict';
const assert = require('assert');
diff --git a/test/common/cpu-prof.js b/test/common/cpu-prof.js
index ae81eefd45..e4bba24037 100644
--- a/test/common/cpu-prof.js
+++ b/test/common/cpu-prof.js
@@ -1,5 +1,3 @@
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
-
'use strict';
require('./');
diff --git a/test/common/dns.js b/test/common/dns.js
index 3574229db4..70e171695f 100644
--- a/test/common/dns.js
+++ b/test/common/dns.js
@@ -1,4 +1,3 @@
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';
const assert = require('assert');
diff --git a/test/common/duplexpair.js b/test/common/duplexpair.js
index 4eb4f326f2..1f41ed32f1 100644
--- a/test/common/duplexpair.js
+++ b/test/common/duplexpair.js
@@ -1,4 +1,3 @@
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';
const { Duplex } = require('stream');
const assert = require('assert');
diff --git a/test/common/fixtures.js b/test/common/fixtures.js
index e33ab1d3e1..e5e1d887df 100644
--- a/test/common/fixtures.js
+++ b/test/common/fixtures.js
@@ -1,4 +1,3 @@
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';
const path = require('path');
diff --git a/test/common/fixtures.mjs b/test/common/fixtures.mjs
index 3eeef6d607..06564de6fa 100644
--- a/test/common/fixtures.mjs
+++ b/test/common/fixtures.mjs
@@ -1,4 +1,3 @@
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
import fixtures from './fixtures.js';
const {
diff --git a/test/common/heap.js b/test/common/heap.js
index a6232177ba..fa74e606f0 100644
--- a/test/common/heap.js
+++ b/test/common/heap.js
@@ -1,4 +1,3 @@
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';
const assert = require('assert');
const util = require('util');
diff --git a/test/common/hijackstdio.js b/test/common/hijackstdio.js
index 6995f66658..44e00ed0b1 100644
--- a/test/common/hijackstdio.js
+++ b/test/common/hijackstdio.js
@@ -1,4 +1,3 @@
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';
// Hijack stdout and stderr
diff --git a/test/common/http2.js b/test/common/http2.js
index c4d430d1d9..baaed492e5 100644
--- a/test/common/http2.js
+++ b/test/common/http2.js
@@ -1,4 +1,3 @@
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';
// An HTTP/2 testing tool used to create mock frames for direct testing
diff --git a/test/common/index.js b/test/common/index.js
index df61b3c3cd..0f0885997c 100644
--- a/test/common/index.js
+++ b/test/common/index.js
@@ -19,7 +19,6 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
/* eslint-disable node-core/crypto-check */
'use strict';
const process = global.process; // Some tests tamper with the process global.
diff --git a/test/common/index.mjs b/test/common/index.mjs
index 1824497ff6..babc3fbbba 100644
--- a/test/common/index.mjs
+++ b/test/common/index.mjs
@@ -1,5 +1,3 @@
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
-
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
diff --git a/test/common/internet.js b/test/common/internet.js
index accea74969..227e979d3b 100644
--- a/test/common/internet.js
+++ b/test/common/internet.js
@@ -1,4 +1,3 @@
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';
// Utilities for internet-related tests
diff --git a/test/common/measure-memory.js b/test/common/measure-memory.js
index 67c8fb3b9d..a42f634426 100644
--- a/test/common/measure-memory.js
+++ b/test/common/measure-memory.js
@@ -1,4 +1,3 @@
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';
const assert = require('assert');
diff --git a/test/common/report.js b/test/common/report.js
index 28c1018147..b1d6b05817 100644
--- a/test/common/report.js
+++ b/test/common/report.js
@@ -1,4 +1,3 @@
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';
const assert = require('assert');
const fs = require('fs');
diff --git a/test/common/require-as.js b/test/common/require-as.js
index 7aba4fa6d8..9425404fa1 100644
--- a/test/common/require-as.js
+++ b/test/common/require-as.js
@@ -1,4 +1,3 @@
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';
if (require.main !== module) {
diff --git a/test/common/tls.js b/test/common/tls.js
index 27414c79ed..2c91241c3b 100644
--- a/test/common/tls.js
+++ b/test/common/tls.js
@@ -1,4 +1,3 @@
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
/* eslint-disable node-core/crypto-check */
'use strict';
diff --git a/test/common/tmpdir.js b/test/common/tmpdir.js
index d911feb460..0bafea1582 100644
--- a/test/common/tmpdir.js
+++ b/test/common/tmpdir.js
@@ -1,4 +1,3 @@
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';
const fs = require('fs');
diff --git a/test/common/udppair.js b/test/common/udppair.js
index a7e532a997..6213f4becf 100644
--- a/test/common/udppair.js
+++ b/test/common/udppair.js
@@ -1,4 +1,3 @@
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';
const { internalBinding } = require('internal/test/binding');
const { JSUDPWrap } = internalBinding('js_udp_wrap');
diff --git a/test/common/wpt.js b/test/common/wpt.js
index 74508f0c8d..3e2f8151a6 100644
--- a/test/common/wpt.js
+++ b/test/common/wpt.js
@@ -1,4 +1,3 @@
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';
const assert = require('assert');
diff --git a/test/common/wpt/worker.js b/test/common/wpt/worker.js
index afaee075f7..468e950ac1 100644
--- a/test/common/wpt/worker.js
+++ b/test/common/wpt/worker.js
@@ -1,5 +1,3 @@
-/* eslint-disable node-core/required-modules,node-core/require-common-first */
-
'use strict';
const { runInThisContext } = require('vm');