Skip to content

Commit 556022a

Browse files
quisidoreidbarber
andauthored
chore: use typeof globalThis to reference global object (#9402)
* use `typeof globalThis` * add `globalThis` to ESLint for TypeScript --------- Co-authored-by: Reid Barber <reid@reidbarber.com>
1 parent 31861ad commit 556022a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

eslint.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,10 @@ export default [{
361361
},
362362

363363
languageOptions: {
364+
globals: {
365+
globalThis: "readonly",
366+
},
367+
364368
parser: tseslint.parser,
365369
ecmaVersion: 6,
366370
sourceType: "module",

packages/@react-aria/utils/src/domHelpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ export const getOwnerDocument = (el: Element | null | undefined): Document => {
33
};
44

55
export const getOwnerWindow = (
6-
el: (Window & typeof global) | Element | null | undefined
7-
): Window & typeof global => {
6+
el: (Window & typeof globalThis) | Element | null | undefined
7+
): Window & typeof globalThis => {
88
if (el && 'window' in el && el.window === el) {
99
return el;
1010
}

0 commit comments

Comments
 (0)