GeezerVison is showing github.com — tools: restrict internal code from using public `url` module · nodejs/node@08ffc63
File tree
Expand file treeCollapse file tree
Open diff view settings
internal/bootstrap/switches
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: lib/.eslintrc.yaml +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -175,6 +175,10 @@ rules: |
175 | 175 | message: Use `const { structuredClone } = require('internal/structured_clone');` instead of the global. |
176 | 176 | - name: SubtleCrypto |
177 | 177 | message: Use `const { SubtleCrypto } = require('internal/crypto/webcrypto');` instead of the global. |
| 178 | + no-restricted-modules: |
| 179 | + - error |
| 180 | + - name: url |
| 181 | + message: Require `internal/url` instead of `url`. |
178 | 182 | # Custom rules in tools/eslint-rules |
179 | 183 | node-core/avoid-prototype-pollution: error |
180 | 184 | node-core/lowercase-name-for-primitive: error |
|
Collapse file
Copy file name to clipboardExpand all lines: lib/internal/bootstrap/switches/is_main_thread.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -290,7 +290,7 @@ rawMethods.resetStdioForTesting = function() { |
290 | 290 | // Needed by the module loader and generally needed everywhere. |
291 | 291 | require('fs'); |
292 | 292 | require('util'); |
293 | | -require('url'); |
| 293 | +require('url'); // eslint-disable-line no-restricted-modules |
294 | 294 |
|
295 | 295 | require('internal/modules/cjs/loader'); |
296 | 296 | require('internal/modules/esm/utils'); |
|