Spaces:
Running
Running
fix type-check for test files (bun:test types + ES2020 BigInt support)
Browse files- Exclude __tests__ dirs from the main tsconfig (ES2017 target)
- Add tsconfig.test.json extending the main config with ES2020 target
and bun-types so BigInt literals and bun:test imports type-check cleanly
- Install @types /bun devDependency
- Update type-check script to also run tsc -p tsconfig.test.json --noEmit
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- bun.lock +6 -1
- package.json +3 -2
- tsconfig.json +1 -1
- tsconfig.test.json +10 -0
bun.lock
CHANGED
|
@@ -7,7 +7,6 @@
|
|
| 7 |
"dependencies": {
|
| 8 |
"@react-three/drei": "^10.7.7",
|
| 9 |
"@react-three/fiber": "^9.5.0",
|
| 10 |
-
"@types/three": "^0.182.0",
|
| 11 |
"hyparquet": "^1.12.1",
|
| 12 |
"next": "15.3.6",
|
| 13 |
"react": "^19.0.0",
|
|
@@ -20,9 +19,11 @@
|
|
| 20 |
"devDependencies": {
|
| 21 |
"@eslint/eslintrc": "^3",
|
| 22 |
"@tailwindcss/postcss": "^4",
|
|
|
|
| 23 |
"@types/node": "^20",
|
| 24 |
"@types/react": "^19",
|
| 25 |
"@types/react-dom": "^19",
|
|
|
|
| 26 |
"eslint": "^9",
|
| 27 |
"eslint-config-next": "15.3.1",
|
| 28 |
"prettier": "^3.5.3",
|
|
@@ -210,6 +211,8 @@
|
|
| 210 |
|
| 211 |
"@tybys/wasm-util": ["@tybys/wasm-util@0.10.1", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg=="],
|
| 212 |
|
|
|
|
|
|
|
| 213 |
"@types/d3-array": ["@types/d3-array@3.2.2", "", {}, "sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw=="],
|
| 214 |
|
| 215 |
"@types/d3-color": ["@types/d3-color@3.1.3", "", {}, "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A=="],
|
|
@@ -366,6 +369,8 @@
|
|
| 366 |
|
| 367 |
"buffer": ["buffer@6.0.3", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" } }, "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA=="],
|
| 368 |
|
|
|
|
|
|
|
| 369 |
"busboy": ["busboy@1.6.0", "", { "dependencies": { "streamsearch": "^1.1.0" } }, "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA=="],
|
| 370 |
|
| 371 |
"call-bind": ["call-bind@1.0.8", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", "get-intrinsic": "^1.2.4", "set-function-length": "^1.2.2" } }, "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww=="],
|
|
|
|
| 7 |
"dependencies": {
|
| 8 |
"@react-three/drei": "^10.7.7",
|
| 9 |
"@react-three/fiber": "^9.5.0",
|
|
|
|
| 10 |
"hyparquet": "^1.12.1",
|
| 11 |
"next": "15.3.6",
|
| 12 |
"react": "^19.0.0",
|
|
|
|
| 19 |
"devDependencies": {
|
| 20 |
"@eslint/eslintrc": "^3",
|
| 21 |
"@tailwindcss/postcss": "^4",
|
| 22 |
+
"@types/bun": "^1.3.10",
|
| 23 |
"@types/node": "^20",
|
| 24 |
"@types/react": "^19",
|
| 25 |
"@types/react-dom": "^19",
|
| 26 |
+
"@types/three": "^0.182.0",
|
| 27 |
"eslint": "^9",
|
| 28 |
"eslint-config-next": "15.3.1",
|
| 29 |
"prettier": "^3.5.3",
|
|
|
|
| 211 |
|
| 212 |
"@tybys/wasm-util": ["@tybys/wasm-util@0.10.1", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg=="],
|
| 213 |
|
| 214 |
+
"@types/bun": ["@types/bun@1.3.10", "", { "dependencies": { "bun-types": "1.3.10" } }, "sha512-0+rlrUrOrTSskibryHbvQkDOWRJwJZqZlxrUs1u4oOoTln8+WIXBPmAuCF35SWB2z4Zl3E84Nl/D0P7803nigQ=="],
|
| 215 |
+
|
| 216 |
"@types/d3-array": ["@types/d3-array@3.2.2", "", {}, "sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw=="],
|
| 217 |
|
| 218 |
"@types/d3-color": ["@types/d3-color@3.1.3", "", {}, "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A=="],
|
|
|
|
| 369 |
|
| 370 |
"buffer": ["buffer@6.0.3", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" } }, "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA=="],
|
| 371 |
|
| 372 |
+
"bun-types": ["bun-types@1.3.10", "", { "dependencies": { "@types/node": "*" } }, "sha512-tcpfCCl6XWo6nCVnpcVrxQ+9AYN1iqMIzgrSKYMB/fjLtV2eyAVEg7AxQJuCq/26R6HpKWykQXuSOq/21RYcbg=="],
|
| 373 |
+
|
| 374 |
"busboy": ["busboy@1.6.0", "", { "dependencies": { "streamsearch": "^1.1.0" } }, "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA=="],
|
| 375 |
|
| 376 |
"call-bind": ["call-bind@1.0.8", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", "get-intrinsic": "^1.2.4", "set-function-length": "^1.2.2" } }, "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww=="],
|
package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
"lint": "next lint",
|
| 10 |
"format": "prettier --write .",
|
| 11 |
"format:check": "prettier --check .",
|
| 12 |
-
"type-check": "tsc --noEmit",
|
| 13 |
"type-check:watch": "tsc --noEmit --watch",
|
| 14 |
"test": "bun test",
|
| 15 |
"validate": "bun run type-check && bun run lint && bun run format:check"
|
|
@@ -28,11 +28,12 @@
|
|
| 28 |
},
|
| 29 |
"devDependencies": {
|
| 30 |
"@eslint/eslintrc": "^3",
|
| 31 |
-
"@types/three": "^0.182.0",
|
| 32 |
"@tailwindcss/postcss": "^4",
|
|
|
|
| 33 |
"@types/node": "^20",
|
| 34 |
"@types/react": "^19",
|
| 35 |
"@types/react-dom": "^19",
|
|
|
|
| 36 |
"eslint": "^9",
|
| 37 |
"eslint-config-next": "15.3.1",
|
| 38 |
"prettier": "^3.5.3",
|
|
|
|
| 9 |
"lint": "next lint",
|
| 10 |
"format": "prettier --write .",
|
| 11 |
"format:check": "prettier --check .",
|
| 12 |
+
"type-check": "tsc --noEmit && tsc -p tsconfig.test.json --noEmit",
|
| 13 |
"type-check:watch": "tsc --noEmit --watch",
|
| 14 |
"test": "bun test",
|
| 15 |
"validate": "bun run type-check && bun run lint && bun run format:check"
|
|
|
|
| 28 |
},
|
| 29 |
"devDependencies": {
|
| 30 |
"@eslint/eslintrc": "^3",
|
|
|
|
| 31 |
"@tailwindcss/postcss": "^4",
|
| 32 |
+
"@types/bun": "^1.3.10",
|
| 33 |
"@types/node": "^20",
|
| 34 |
"@types/react": "^19",
|
| 35 |
"@types/react-dom": "^19",
|
| 36 |
+
"@types/three": "^0.182.0",
|
| 37 |
"eslint": "^9",
|
| 38 |
"eslint-config-next": "15.3.1",
|
| 39 |
"prettier": "^3.5.3",
|
tsconfig.json
CHANGED
|
@@ -23,5 +23,5 @@
|
|
| 23 |
}
|
| 24 |
},
|
| 25 |
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
| 26 |
-
"exclude": ["node_modules"]
|
| 27 |
}
|
|
|
|
| 23 |
}
|
| 24 |
},
|
| 25 |
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
| 26 |
+
"exclude": ["node_modules", "**/__tests__/**"]
|
| 27 |
}
|
tsconfig.test.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"extends": "./tsconfig.json",
|
| 3 |
+
"compilerOptions": {
|
| 4 |
+
"target": "ES2020",
|
| 5 |
+
"lib": ["ES2020", "dom"],
|
| 6 |
+
"types": ["bun-types"],
|
| 7 |
+
"incremental": false
|
| 8 |
+
},
|
| 9 |
+
"include": ["**/__tests__/**/*.ts", "src/**/*.ts"]
|
| 10 |
+
}
|