From 92cabd4ba917c5062cccad284111b0a2f3fdc7fa Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 14 Aug 2026 10:50:16 +0200 Subject: [PATCH 1/2] tools: fix the list of globals in ESLint config files Signed-off-by: Antoine du Hamel --- eslint.config.mjs | 19 +++++++++++-------- lib/eslint.config_partial.mjs | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index c3c276fd80fc..c59d447589c1 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -122,36 +122,39 @@ export default [ ByteLengthQueuingStrategy: 'readonly', CompressionStream: 'readonly', CountQueuingStrategy: 'readonly', - CustomEvent: 'readonly', crypto: 'readonly', Crypto: 'readonly', CryptoKey: 'readonly', + CustomEvent: 'readonly', DecompressionStream: 'readonly', DisposableStack: 'readonly', EventSource: 'readonly', fetch: 'readonly', Float16Array: 'readonly', FormData: 'readonly', + localStorage: 'readonly', navigator: 'readonly', QuotaExceededError: 'readonly', + ReadableByteStreamController: 'readonly', ReadableStream: 'readonly', - ReadableStreamDefaultReader: 'readonly', ReadableStreamBYOBReader: 'readonly', ReadableStreamBYOBRequest: 'readonly', - ReadableByteStreamController: 'readonly', ReadableStreamDefaultController: 'readonly', + ReadableStreamDefaultReader: 'readonly', Response: 'readonly', + sessionStorage: 'readonly', + ShadowRealm: 'readonly', + Storage: 'readonly', + SubtleCrypto: 'readonly', TextDecoderStream: 'readonly', TextEncoderStream: 'readonly', TransformStream: 'readonly', TransformStreamDefaultController: 'readonly', - ShadowRealm: 'readonly', - SubtleCrypto: 'readonly', - WritableStream: 'readonly', - WritableStreamDefaultWriter: 'readonly', - WritableStreamDefaultController: 'readonly', WebSocket: 'readonly', Worker: 'readonly', + WritableStream: 'readonly', + WritableStreamDefaultController: 'readonly', + WritableStreamDefaultWriter: 'readonly', }, }, }, diff --git a/lib/eslint.config_partial.mjs b/lib/eslint.config_partial.mjs index 7a57d65ceb46..e1f2b935ad18 100644 --- a/lib/eslint.config_partial.mjs +++ b/lib/eslint.config_partial.mjs @@ -252,6 +252,10 @@ export default [ name: 'SharedArrayBuffer', message: "Use `const { constructSharedArrayBuffer } = require('internal/util');` instead of the global.", }, + { + name: 'Storage', + message: "Use `const { Storage } = reqiore('internal/webstorage');` instead of the global.", + }, // Temporal is not available in primordials because it can be // disabled with --no-harmony-temporal CLI flag. { @@ -286,6 +290,10 @@ export default [ name: 'URL', message: "Use `const { URL } = require('internal/url');` instead of the global.", }, + { + name: 'URLPattern', + message: "Use `const { URLPattern } = require('internal/url');` instead of the global.", + }, { name: 'URLSearchParams', message: "Use `const { URLSearchParams } = require('internal/url');` instead of the global.", @@ -296,6 +304,10 @@ export default [ name: 'WebAssembly', message: 'Use `const { WebAssembly } = globalThis;` instead of the global.', }, + { + name: 'WebSocket', + message: 'Use `const { WebSocket } = require("internal/deps/undici/src/lib/web/websocket/websocket.js");` instead of the global.', + }, { name: 'Worker', message: "Use `const { Worker } = require('internal/webworker');` instead of the global.", @@ -364,6 +376,10 @@ export default [ name: 'globalThis', message: 'Use `const { globalThis } = primordials;` instead of the global.', }, + { + name: 'localStorage', + message: "Use `const { localStorage } = reqiore('internal/webstorage');` instead of the global.", + }, { name: 'performance', message: "Use `const { performance } = require('perf_hooks');` instead of the global.", @@ -372,6 +388,10 @@ export default [ name: 'queueMicrotask', message: "Use `const { queueMicrotask } = require('internal/process/task_queues');` instead of the global.", }, + { + name: 'sessionStorage', + message: "Use `const { sessionStorage } = reqiore('internal/webstorage');` instead of the global.", + }, { name: 'setImmediate', message: "Use `const { setImmediate } = require('timers');` instead of the global.", From c6d86857ccf0fb8c78e5ba9b3c8bbdee9f5de977 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 14 Aug 2026 13:18:27 +0200 Subject: [PATCH 2/2] squash! fix typo Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> --- lib/eslint.config_partial.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/eslint.config_partial.mjs b/lib/eslint.config_partial.mjs index e1f2b935ad18..aedf74633e37 100644 --- a/lib/eslint.config_partial.mjs +++ b/lib/eslint.config_partial.mjs @@ -254,7 +254,7 @@ export default [ }, { name: 'Storage', - message: "Use `const { Storage } = reqiore('internal/webstorage');` instead of the global.", + message: "Use `const { Storage } = require('internal/webstorage');` instead of the global.", }, // Temporal is not available in primordials because it can be // disabled with --no-harmony-temporal CLI flag. @@ -378,7 +378,7 @@ export default [ }, { name: 'localStorage', - message: "Use `const { localStorage } = reqiore('internal/webstorage');` instead of the global.", + message: "Use `const { localStorage } = require('internal/webstorage');` instead of the global.", }, { name: 'performance', @@ -390,7 +390,7 @@ export default [ }, { name: 'sessionStorage', - message: "Use `const { sessionStorage } = reqiore('internal/webstorage');` instead of the global.", + message: "Use `const { sessionStorage } = require('internal/webstorage');` instead of the global.", }, { name: 'setImmediate',