mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
tools: restrict internal code from using public url module
PR-URL: https://github.com/nodejs/node/pull/49590 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
committed by
Node.js GitHub Bot
parent
2a0e5de163
commit
f5bb2c7d20
@@ -179,6 +179,10 @@ rules:
|
||||
message: Use `const { structuredClone } = require('internal/structured_clone');` instead of the global.
|
||||
- name: SubtleCrypto
|
||||
message: Use `const { SubtleCrypto } = require('internal/crypto/webcrypto');` instead of the global.
|
||||
no-restricted-modules:
|
||||
- error
|
||||
- name: url
|
||||
message: Require `internal/url` instead of `url`.
|
||||
# Custom rules in tools/eslint-rules
|
||||
node-core/avoid-prototype-pollution: error
|
||||
node-core/lowercase-name-for-primitive: error
|
||||
|
||||
@@ -290,7 +290,7 @@ rawMethods.resetStdioForTesting = function() {
|
||||
// Needed by the module loader and generally needed everywhere.
|
||||
require('fs');
|
||||
require('util');
|
||||
require('url');
|
||||
require('url'); // eslint-disable-line no-restricted-modules
|
||||
|
||||
require('internal/modules/cjs/loader');
|
||||
require('internal/modules/esm/utils');
|
||||
|
||||
Reference in New Issue
Block a user