GeezerVison is showing github.com — lib: restrict usage of fetch related globals in core internals · nodejs/node@7fc68f9
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: lib/.eslintrc.yaml +10Lines changed: 10 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
37 | 37 | # disabled with --no-harmony-atomics CLI flag. |
38 | 38 | - name: Atomics |
39 | 39 | message: Use `const { Atomics } = globalThis;` instead of the global. |
| 40 | + - name: BroadcastChannel |
| 41 | + message: Use `const { BroadcastChannel } = require('internal/worker/io');` instead of the global. |
40 | 42 | - name: Buffer |
41 | 43 | message: Use `const { Buffer } = require('buffer');` instead of the global. |
42 | 44 | - name: DOMException |
|
45 | 47 | message: Use `const { Event } = require('internal/event_target');` instead of the global. |
46 | 48 | - name: EventTarget |
47 | 49 | message: Use `const { EventTarget } = require('internal/event_target');` instead of the global. |
| 50 | + - name: Headers |
| 51 | + message: Use `const { Headers } = require('internal/deps/undici/undici');` instead of the global. |
48 | 52 | # Intl is not available in primordials because it can be |
49 | 53 | # disabled with --without-intl build flag. |
50 | 54 | - name: Intl |
@@ -55,6 +59,10 @@ rules: |
55 | 59 | message: Use `const { MessageEvent } = require('internal/worker/io');` instead of the global. |
56 | 60 | - name: MessagePort |
57 | 61 | message: Use `const { MessagePort } = require('internal/worker/io');` instead of the global. |
| 62 | + - name: Request |
| 63 | + message: Use `const { Request } = require('internal/deps/undici/undici');` instead of the global. |
| 64 | + - name: Response |
| 65 | + message: Use `const { Response } = require('internal/deps/undici/undici');` instead of the global. |
58 | 66 | # SharedArrayBuffer is not available in primordials because it can be |
59 | 67 | # disabled with --no-harmony-sharedarraybuffer CLI flag. |
60 | 68 | - name: SharedArrayBuffer |
|
81 | 89 | message: Use `const { Crypto } = require('internal/crypto/webcrypto');` instead of the global. |
82 | 90 | - name: CryptoKey |
83 | 91 | message: Use `const { CryptoKey } = require('internal/crypto/webcrypto');` instead of the global. |
| 92 | + - name: fetch |
| 93 | + message: Use `const { fetch } = require('internal/deps/undici/undici');` instead of the global. |
84 | 94 | - name: global |
85 | 95 | message: Use `const { globalThis } = primordials;` instead of `global`. |
86 | 96 | - name: globalThis |
|