Skip to content

Commit

Permalink
tools: restrict internal code from using public url module
Browse files Browse the repository at this point in the history
  • Loading branch information
LiviaMedeiros committed Sep 11, 2023
1 parent b5e9fb6 commit e203c81
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/bootstrap/switches/is_main_thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit e203c81

Please sign in to comment.