Skip to content

Commit e203c81

Browse files
committed
tools: restrict internal code from using public url module
1 parent b5e9fb6 commit e203c81

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/.eslintrc.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ rules:
179179
message: Use `const { structuredClone } = require('internal/structured_clone');` instead of the global.
180180
- name: SubtleCrypto
181181
message: Use `const { SubtleCrypto } = require('internal/crypto/webcrypto');` instead of the global.
182+
no-restricted-modules:
183+
- error
184+
- name: url
185+
message: Require `internal/url` instead of `url`.
182186
# Custom rules in tools/eslint-rules
183187
node-core/avoid-prototype-pollution: error
184188
node-core/lowercase-name-for-primitive: error

lib/internal/bootstrap/switches/is_main_thread.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ rawMethods.resetStdioForTesting = function() {
290290
// Needed by the module loader and generally needed everywhere.
291291
require('fs');
292292
require('util');
293-
require('url');
293+
require('url'); // eslint-disable-line no-restricted-modules
294294

295295
require('internal/modules/cjs/loader');
296296
require('internal/modules/esm/utils');

0 commit comments

Comments
 (0)