Files
civitai__civitai/tsconfig.json
T
Justin Maier 622770f6bd fix: resolve TypeScript timer type errors after pnpm migration
The pnpm migration exposed type conflicts between @types/node and DOM
timer types that were previously masked by npm's flat hoisting.

Root cause: tsconfig.json had a broken type configuration:
- typeRoots pointed to non-existent "./types" directory
- @types/node was explicitly excluded

Fix:
- Replace typeRoots with explicit "types": ["node"]
- Remove @types/node from exclude list
- Update @types/node to 20.19.9 (matches Node 20.x)
- Add .npmrc with public-hoist-pattern for @types
- Use ReturnType<typeof setInterval> for server timer types
- Use window.setInterval/clearInterval for browser components

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 17:27:10 -07:00

51 lines
1.1 KiB
JSON

{
"compilerOptions": {
"target": "ES2018",
"lib": ["dom", "dom.iterable", "esnext"],
// "types": ["offscreencanvas"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"noUncheckedIndexedAccess": false, // TODO swap to true
"baseUrl": "src",
"paths": {
"~/*": ["./*"]
},
"types": ["node"],
"noErrorTruncation": true,
"plugins": [
{
"name": "next"
}
]
},
"include": [
// "next-env.d.ts",
// "**/*.ts",
// "**/*.tsx",
// "**/*.cjs",
// "**/*.mjs",
"scripts/local-dev/*.ts",
"src",
"tests",
".next/types/**/*.ts"
],
"exclude": [
"node_modules",
"./node_modules",
"./node_modules/*",
"src/pages/api/dev-local/*.ts",
"scripts/local-dev/*.ts"
]
}