From e2372d0f404bf9ee7acd22b40ce194007a2cb452 Mon Sep 17 00:00:00 2001 From: Stephen Niedzielski Date: Sun, 4 Feb 2024 16:26:39 -0700 Subject: [PATCH] Fix vitest typing https://github.com/vitejs/vite/issues/15714 --- package-lock.json | 7 ++++--- package.json | 1 + src/test/tsconfig.json | 2 +- tools/base-tsconfig.json | 3 +++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6e709e1..a2ff692 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "AGPL-3.0-only", "devDependencies": { "@types/jsdom": "21.1.6", + "@types/node": "18.19.8", "browser-fs-access": "0.35.0", "esbuild": "0.20.0", "jsdom": "24.0.0", @@ -664,9 +665,9 @@ } }, "node_modules/@types/node": { - "version": "20.11.16", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.16.tgz", - "integrity": "sha512-gKb0enTmRCzXSSUJDq6/sPcqrfCv2mkkG6Jt/clpn5eiCbKTY+SgZUxo+p8ZKMof5dCp9vHQUAB7wOUTod22wQ==", + "version": "18.19.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.8.tgz", + "integrity": "sha512-g1pZtPhsvGVTwmeVoexWZLTQaOvXwoSq//pTL0DHeNzUDrFnir4fgETdhjhIxjVnN+hKOuh98+E1eMLnUXstFg==", "dev": true, "dependencies": { "undici-types": "~5.26.4" diff --git a/package.json b/package.json index 6564e50..0ac0730 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "🗒 Graphical line-oriented text editor.", "devDependencies": { "@types/jsdom": "21.1.6", + "@types/node": "18.19.8", "browser-fs-access": "0.35.0", "esbuild": "0.20.0", "jsdom": "24.0.0", diff --git a/src/test/tsconfig.json b/src/test/tsconfig.json index 4826661..616058b 100644 --- a/src/test/tsconfig.json +++ b/src/test/tsconfig.json @@ -2,7 +2,7 @@ { "extends": "../../tools/base-tsconfig.json", "compilerOptions": { - "lib": ["ES2023"], + "lib": ["DOM", "ES2023"], // tsc is only used for type-checking. "noEmit": true, diff --git a/tools/base-tsconfig.json b/tools/base-tsconfig.json index ae1887c..d83cb0c 100644 --- a/tools/base-tsconfig.json +++ b/tools/base-tsconfig.json @@ -18,6 +18,9 @@ "resolveJsonModule": true, "strict": true, + // Projects add types needed. + "types": [], + // Improve compatibility with compilers that aren't type system aware. "isolatedModules": true,