From b642b021dff2dd87b3ce496d545cda9e345a2dc1 Mon Sep 17 00:00:00 2001 From: LiviaMedeiros Date: Sun, 10 Sep 2023 22:58:41 +0800 Subject: [PATCH] tools: restrict internal code from using public `url` module --- lib/.eslintrc.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index 2b77dce6967d7b..0d9443ed413912 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -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