Skip to content

Commit 551ca68

Browse files
aduh95targos
authored andcommitted
lib: restrict usage of fetch related globals in core internals
PR-URL: #41957 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Mestery <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: Filip Skokan <[email protected]>
1 parent 835cdd5 commit 551ca68

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/.eslintrc.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ rules:
3939
message: Use `const { Atomics } = globalThis;` instead of the global.
4040
- name: Blob
4141
message: Use `const { Blob } = require('buffer');` instead of the global.
42+
- name: BroadcastChannel
43+
message: Use `const { BroadcastChannel } = require('internal/worker/io');` instead of the global.
4244
- name: Buffer
4345
message: Use `const { Buffer } = require('buffer');` instead of the global.
4446
- name: DOMException
@@ -47,18 +49,22 @@ rules:
4749
message: Use `const { Event } = require('internal/event_target');` instead of the global.
4850
- name: EventTarget
4951
message: Use `const { EventTarget } = require('internal/event_target');` instead of the global.
52+
- name: Headers
53+
message: Use `const { Headers } = require('internal/deps/undici/undici');` instead of the global.
5054
# Intl is not available in primordials because it can be
5155
# disabled with --without-intl build flag.
5256
- name: Intl
5357
message: Use `const { Intl } = globalThis;` instead of the global.
54-
- name: BroadcastChannel
55-
message: Use `const { BroadcastChannel } = require('internal/worker/io');` instead of the global.
5658
- name: MessageChannel
5759
message: Use `const { MessageChannel } = require('internal/worker/io');` instead of the global.
5860
- name: MessageEvent
5961
message: Use `const { MessageEvent } = require('internal/worker/io');` instead of the global.
6062
- name: MessagePort
6163
message: Use `const { MessagePort } = require('internal/worker/io');` instead of the global.
64+
- name: Request
65+
message: Use `const { Request } = require('internal/deps/undici/undici');` instead of the global.
66+
- name: Response
67+
message: Use `const { Response } = require('internal/deps/undici/undici');` instead of the global.
6268
# SharedArrayBuffer is not available in primordials because it can be
6369
# disabled with --no-harmony-sharedarraybuffer CLI flag.
6470
- name: SharedArrayBuffer
@@ -85,6 +91,8 @@ rules:
8591
message: Use `const { Crypto } = require('internal/crypto/webcrypto');` instead of the global.
8692
- name: CryptoKey
8793
message: Use `const { CryptoKey } = require('internal/crypto/webcrypto');` instead of the global.
94+
- name: fetch
95+
message: Use `const { fetch } = require('internal/deps/undici/undici');` instead of the global.
8896
- name: global
8997
message: Use `const { globalThis } = primordials;` instead of `global`.
9098
- name: globalThis

0 commit comments

Comments
 (0)