diff --git a/test/wpt/.eslintrc.yaml b/test/wpt/.eslintrc.yaml new file mode 100644 index 00000000000000..b3981bdd272eca --- /dev/null +++ b/test/wpt/.eslintrc.yaml @@ -0,0 +1,3 @@ +rules: + node-core/required-modules: off + node-core/require-common-first: off diff --git a/test/wpt/README.md b/test/wpt/README.md index 39f59d44060e3a..d12bb71681ee1c 100644 --- a/test/wpt/README.md +++ b/test/wpt/README.md @@ -46,7 +46,6 @@ For example, for the URL tests, add a file `test/wpt/test-url.js`: ```js 'use strict'; -require('../common'); const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('url'); diff --git a/test/wpt/test-abort.js b/test/wpt/test-abort.js index 11960351b756e6..f582f4c718a5c0 100644 --- a/test/wpt/test-abort.js +++ b/test/wpt/test-abort.js @@ -1,5 +1,5 @@ 'use strict'; -require('../common'); + const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('dom/abort'); diff --git a/test/wpt/test-atob.js b/test/wpt/test-atob.js index b227ae4d20e105..eba001f7b7ef78 100644 --- a/test/wpt/test-atob.js +++ b/test/wpt/test-atob.js @@ -1,6 +1,5 @@ 'use strict'; -require('../common'); const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('html/webappapis/atob'); diff --git a/test/wpt/test-blob.js b/test/wpt/test-blob.js index 0a0c16a4e3631b..9027516ec619f4 100644 --- a/test/wpt/test-blob.js +++ b/test/wpt/test-blob.js @@ -1,6 +1,5 @@ 'use strict'; -require('../common'); const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('FileAPI/blob'); diff --git a/test/wpt/test-broadcastchannel.js b/test/wpt/test-broadcastchannel.js index d402d8be2f7c39..6757e1429fc5c4 100644 --- a/test/wpt/test-broadcastchannel.js +++ b/test/wpt/test-broadcastchannel.js @@ -1,6 +1,5 @@ 'use strict'; -require('../common'); const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('webmessaging/broadcastchannel'); diff --git a/test/wpt/test-console.js b/test/wpt/test-console.js index e66726431fba6e..5d085756e258d8 100644 --- a/test/wpt/test-console.js +++ b/test/wpt/test-console.js @@ -1,5 +1,5 @@ 'use strict'; -require('../common'); + const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('console'); diff --git a/test/wpt/test-domexception.js b/test/wpt/test-domexception.js index 09018a25ac58d8..ea68c8562aea57 100644 --- a/test/wpt/test-domexception.js +++ b/test/wpt/test-domexception.js @@ -1,6 +1,5 @@ 'use strict'; -require('../common'); const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('webidl/ecmascript-binding/es-exceptions'); diff --git a/test/wpt/test-encoding.js b/test/wpt/test-encoding.js index bf54683c5c9f14..af20760bd533d3 100644 --- a/test/wpt/test-encoding.js +++ b/test/wpt/test-encoding.js @@ -1,5 +1,5 @@ 'use strict'; -require('../common'); + const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('encoding'); diff --git a/test/wpt/test-events.js b/test/wpt/test-events.js index 6d4a4cff2d9fdc..428762b6642580 100644 --- a/test/wpt/test-events.js +++ b/test/wpt/test-events.js @@ -1,5 +1,5 @@ 'use strict'; -require('../common'); + const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('dom/events'); diff --git a/test/wpt/test-file.js b/test/wpt/test-file.js index 71e8c179de95e2..a48b2fb55299b9 100644 --- a/test/wpt/test-file.js +++ b/test/wpt/test-file.js @@ -1,6 +1,5 @@ 'use strict'; -require('../common'); const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('FileAPI/file'); diff --git a/test/wpt/test-hr-time.js b/test/wpt/test-hr-time.js index 36fdde8036c0cc..9471f1e24c4268 100644 --- a/test/wpt/test-hr-time.js +++ b/test/wpt/test-hr-time.js @@ -1,6 +1,5 @@ 'use strict'; -require('../common'); const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('hr-time'); diff --git a/test/wpt/test-microtask-queuing.js b/test/wpt/test-microtask-queuing.js index 3a83fd33ba051e..86f7d4edbc1c92 100644 --- a/test/wpt/test-microtask-queuing.js +++ b/test/wpt/test-microtask-queuing.js @@ -1,6 +1,5 @@ 'use strict'; -require('../common'); const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('html/webappapis/microtask-queuing'); diff --git a/test/wpt/test-performance-timeline.js b/test/wpt/test-performance-timeline.js index 12f1abd3a52a32..8fa7859b0c8a8a 100644 --- a/test/wpt/test-performance-timeline.js +++ b/test/wpt/test-performance-timeline.js @@ -1,5 +1,5 @@ 'use strict'; -require('../common'); + const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('performance-timeline'); diff --git a/test/wpt/test-streams.js b/test/wpt/test-streams.js index 43c212247c41e7..6aa435303ab6b3 100644 --- a/test/wpt/test-streams.js +++ b/test/wpt/test-streams.js @@ -1,6 +1,5 @@ 'use strict'; -require('../common'); const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('streams'); diff --git a/test/wpt/test-structured-clone.js b/test/wpt/test-structured-clone.js index 57b990c23cdfb5..26edf0607083a9 100644 --- a/test/wpt/test-structured-clone.js +++ b/test/wpt/test-structured-clone.js @@ -1,6 +1,5 @@ 'use strict'; -require('../common'); const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('html/webappapis/structured-clone'); diff --git a/test/wpt/test-timers.js b/test/wpt/test-timers.js index 7736d540a2aa28..86b1cf35b80629 100644 --- a/test/wpt/test-timers.js +++ b/test/wpt/test-timers.js @@ -1,6 +1,5 @@ 'use strict'; -require('../common'); const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('html/webappapis/timers'); diff --git a/test/wpt/test-url.js b/test/wpt/test-url.js index cca2184b47720b..fc84c22a275c38 100644 --- a/test/wpt/test-url.js +++ b/test/wpt/test-url.js @@ -1,6 +1,5 @@ 'use strict'; -require('../common'); const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('url'); diff --git a/test/wpt/test-user-timing.js b/test/wpt/test-user-timing.js index 36d13297ba57cc..2a4c9b8dbf52ea 100644 --- a/test/wpt/test-user-timing.js +++ b/test/wpt/test-user-timing.js @@ -1,5 +1,5 @@ 'use strict'; -require('../common'); + const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('user-timing'); diff --git a/test/wpt/test-wasm-webapi.js b/test/wpt/test-wasm-webapi.js index fecc6e89a3fe1a..2ffccd31267d32 100644 --- a/test/wpt/test-wasm-webapi.js +++ b/test/wpt/test-wasm-webapi.js @@ -1,6 +1,5 @@ 'use strict'; -require('../common'); const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('wasm/webapi');