diff --git a/.eslintrc b/.eslintrc index 13a7f3f1d0..fd2c95b5f5 100644 --- a/.eslintrc +++ b/.eslintrc @@ -33,6 +33,9 @@ { "name": "global", "message": "Use `globalThis` instead" + }, + { + "name": "window" } ], "require-yield": 0, diff --git a/tests/utils/exec.ts b/tests/utils/exec.ts index f69117ff7b..2149122597 100644 --- a/tests/utils/exec.ts +++ b/tests/utils/exec.ts @@ -22,11 +22,11 @@ type ExecOpts = { }; const tsConfigPath = path.resolve( - path.join(global.projectDir, 'tsconfig.json'), + path.join(globalThis.projectDir, 'tsconfig.json'), ); const polykeyPath = path.resolve( - path.join(global.projectDir, 'src/bin/polykey.ts'), + path.join(globalThis.projectDir, 'src/bin/polykey.ts'), ); const generateDockerArgs = (mountPath: string) => [ @@ -114,7 +114,7 @@ async function pkStdio( }> { const cwd = opts.cwd ?? - (await fs.promises.mkdtemp(path.join(global.tmpDir, 'polykey-test-'))); + (await fs.promises.mkdtemp(path.join(globalThis.tmpDir, 'polykey-test-'))); // Recall that we attempt to connect to all specified seed nodes on agent start. // Therefore, for testing purposes only, we default the seed nodes as empty // (if not defined in the env) to ensure no attempted connections. A regular @@ -241,7 +241,7 @@ async function pkExecWithoutShell( }> { const cwd = opts.cwd ?? - (await fs.promises.mkdtemp(path.join(global.tmpDir, 'polykey-test-'))); + (await fs.promises.mkdtemp(path.join(globalThis.tmpDir, 'polykey-test-'))); const env = { ...process.env, ...opts.env, @@ -293,7 +293,9 @@ async function pkExecWithShell( }> { const cwd = path.resolve( opts.cwd ?? - (await fs.promises.mkdtemp(path.join(global.tmpDir, 'polykey-test-'))), + (await fs.promises.mkdtemp( + path.join(globalThis.tmpDir, 'polykey-test-'), + )), ); const env = { ...process.env, @@ -343,7 +345,7 @@ async function pkSpawnWithoutShell( ): Promise { const cwd = opts.cwd ?? - (await fs.promises.mkdtemp(path.join(global.tmpDir, 'polykey-test-'))); + (await fs.promises.mkdtemp(path.join(globalThis.tmpDir, 'polykey-test-'))); const env = { ...process.env, ...opts.env, @@ -383,7 +385,9 @@ async function pkSpawnWithShell( ): Promise { const cwd = path.resolve( opts.cwd ?? - (await fs.promises.mkdtemp(path.join(global.tmpDir, 'polykey-test-'))), + (await fs.promises.mkdtemp( + path.join(globalThis.tmpDir, 'polykey-test-'), + )), ); const env = { ...process.env,