Skip to content

Commit 552e963

Browse files
committed
move var declarations to top
1 parent 534fed4 commit 552e963

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/vitest.setup.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import { vi } from "vitest";
22

3+
declare global {
4+
interface Window {
5+
media: "dark" | "light";
6+
}
7+
var cookies: Record<string, { value: string }>; // eslint-disable-line no-var -- let is not supported in defining global due to block scope
8+
var path: string; // eslint-disable-line no-var -- let is not supported in defining global due to block scope
9+
}
310
// mock matchMedia
411
Object.defineProperty(window, "matchMedia", {
512
writable: true,
@@ -13,13 +20,6 @@ Object.defineProperty(window, "matchMedia", {
1320
})),
1421
});
1522

16-
declare global {
17-
interface Window {
18-
media: "dark" | "light";
19-
}
20-
var cookies: Record<string, { value: string }>; // eslint-disable-line no-var -- let is not supported in defining global due to block scope
21-
var path: string; // eslint-disable-line no-var -- let is not supported in defining global due to block scope
22-
}
2323
Object.defineProperty(window, "media", {
2424
writable: true,
2525
value: "dark",

0 commit comments

Comments
 (0)