Skip to content

Commit

Permalink
test: put common lint exceptions into config file
Browse files Browse the repository at this point in the history
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: #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>
  • Loading branch information
Trott authored and targos committed Sep 4, 2021
1 parent 0b1ce72 commit 831f266
Show file tree
Hide file tree
Showing 23 changed files with 3 additions and 27 deletions.
3 changes: 3 additions & 0 deletions test/common/.eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rules:
node-core/required-modules: off
node-core/require-common-first: off
1 change: 0 additions & 1 deletion test/common/arraystream.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';

const { Stream } = require('stream');
Expand Down
2 changes: 0 additions & 2 deletions test/common/benchmark.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable node-core/require-common-first, node-core/required-modules */

'use strict';

const assert = require('assert');
Expand Down
2 changes: 0 additions & 2 deletions test/common/countdown.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable node-core/require-common-first, node-core/required-modules */

'use strict';

const assert = require('assert');
Expand Down
2 changes: 0 additions & 2 deletions test/common/cpu-prof.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable node-core/require-common-first, node-core/required-modules */

'use strict';

require('./');
Expand Down
1 change: 0 additions & 1 deletion test/common/dns.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';

const assert = require('assert');
Expand Down
1 change: 0 additions & 1 deletion test/common/duplexpair.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
1 change: 0 additions & 1 deletion test/common/fixtures.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';

const path = require('path');
Expand Down
1 change: 0 additions & 1 deletion test/common/fixtures.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable node-core/require-common-first, node-core/required-modules */
import fixtures from './fixtures.js';

const {
Expand Down
1 change: 0 additions & 1 deletion test/common/heap.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
1 change: 0 additions & 1 deletion test/common/hijackstdio.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';

// Hijack stdout and stderr
Expand Down
1 change: 0 additions & 1 deletion test/common/http2.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions test/common/index.mjs
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
1 change: 0 additions & 1 deletion test/common/internet.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';

// Utilities for internet-related tests
Expand Down
1 change: 0 additions & 1 deletion test/common/measure-memory.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';

const assert = require('assert');
Expand Down
1 change: 0 additions & 1 deletion test/common/report.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
1 change: 0 additions & 1 deletion test/common/require-as.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';

if (require.main !== module) {
Expand Down
1 change: 0 additions & 1 deletion test/common/tls.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable node-core/require-common-first, node-core/required-modules */
/* eslint-disable node-core/crypto-check */

'use strict';
Expand Down
1 change: 0 additions & 1 deletion test/common/tmpdir.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';

const fs = require('fs');
Expand Down
1 change: 0 additions & 1 deletion test/common/udppair.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
1 change: 0 additions & 1 deletion test/common/wpt.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';

const assert = require('assert');
Expand Down
2 changes: 0 additions & 2 deletions test/common/wpt/worker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable node-core/required-modules,node-core/require-common-first */

'use strict';

const { runInThisContext } = require('vm');
Expand Down

0 comments on commit 831f266

Please sign in to comment.