mirror of
https://github.com/civitai/civitai.git
synced 2026-09-20 22:08:18 +08:00
8a39b7c876
Swaps the pnpm link: override for the published package (^0.3.0, currently 0.3.1) and removes the two accommodations the link needed: the turbopack.root widening (Turbopack refused files outside the repo) and the tsconfig react/react-dom paths pin (the linked checkout's own @types/react could split the program). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
122 lines
5.3 KiB
JSON
122 lines
5.3 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": "react-jsx",
|
|
"incremental": true,
|
|
"noUncheckedIndexedAccess": false, // TODO swap to true
|
|
"paths": {
|
|
"~/*": ["./src/*"],
|
|
"@civitai/db-schema": ["./packages/civitai-db-schema/src/index"],
|
|
"@civitai/db-schema/*": ["./packages/civitai-db-schema/src/*"],
|
|
"@civitai/db": ["./packages/civitai-db/src/index"],
|
|
"@civitai/db/*": ["./packages/civitai-db/src/*"],
|
|
"@civitai/redis": ["./packages/civitai-redis/src/index"],
|
|
"@civitai/redis/*": ["./packages/civitai-redis/src/*"],
|
|
"@civitai/clickhouse": ["./packages/civitai-clickhouse/src/index"],
|
|
"@civitai/clickhouse/*": ["./packages/civitai-clickhouse/src/*"],
|
|
"@civitai/axiom": ["./packages/civitai-axiom/src/index"],
|
|
"@civitai/axiom/*": ["./packages/civitai-axiom/src/*"],
|
|
"@civitai/flipt": ["./packages/civitai-flipt/src/index"],
|
|
"@civitai/flipt/*": ["./packages/civitai-flipt/src/*"],
|
|
"@civitai/telemetry": ["./packages/civitai-telemetry/src/index"],
|
|
"@civitai/telemetry/*": ["./packages/civitai-telemetry/src/*"],
|
|
"@civitai/brand": ["./packages/civitai-brand/src/index"],
|
|
"@civitai/brand/*": ["./packages/civitai-brand/src/*"],
|
|
"@civitai/notifications": ["./packages/civitai-notifications/src/index"],
|
|
"@civitai/notifications/*": ["./packages/civitai-notifications/src/*"]
|
|
},
|
|
"noErrorTruncation": true,
|
|
"plugins": [
|
|
{
|
|
"name": "next"
|
|
}
|
|
]
|
|
},
|
|
"include": [
|
|
// "next-env.d.ts",
|
|
// "**/*.ts",
|
|
// "**/*.tsx",
|
|
// "**/*.cjs",
|
|
// "**/*.mjs",
|
|
// `scripts/` used to be represented here by `scripts/local-dev/*.ts` ALONE,
|
|
// and that entry was ALSO listed in `exclude` below. Exclude wins, so the
|
|
// net effect was that NOTHING under `scripts/` was typechecked — not even
|
|
// the one directory this list appeared to name. Measured on 23cecb57c0:
|
|
// `tsc -p tsconfig.json --listFilesOnly` contained 0 files under scripts/.
|
|
// Both globs are here, and the contradicting exclude entry is gone.
|
|
//
|
|
// What this actually buys, measured: the non-test scripts — `scripts/*.ts`,
|
|
// `oneoffs/`, `local-dev/`, `metric-migration/`, `test-perf/` — go from
|
|
// unchecked to checked, in BOTH CI tiers, along with any file added to them
|
|
// later. `scripts/__tests__/**` is excluded below; read that comment before
|
|
// assuming this line covers it.
|
|
"scripts/**/*.ts",
|
|
"scripts/**/*.tsx",
|
|
"src",
|
|
"packages/*/src",
|
|
"tests",
|
|
"test",
|
|
".next/types/**/*.ts"
|
|
],
|
|
"exclude": [
|
|
"node_modules",
|
|
"./node_modules",
|
|
"./node_modules/*",
|
|
"src/pages/api/dev-local/*.ts",
|
|
"src/**/__tests__/**",
|
|
"packages/civitai-ui",
|
|
|
|
// 🔴 `scripts/__tests__/**` is NOT typechecked, exactly as `src/**/__tests__/**`
|
|
// above is not. This is a DIRECTORY exclusion on purpose, and the reason is
|
|
// structural rather than a backlog:
|
|
//
|
|
// That directory exists to test the untyped `.mjs` modules under
|
|
// `.claude/skills/` and `.claude/hooks/`, by importing them directly. None of
|
|
// those modules carries JSDoc, so under `allowJs` tsc infers their signatures
|
|
// from the implementation and the tests inherit the result. Two measured
|
|
// examples: `request({ worktree, args = [] } = {})` infers as taking
|
|
// `{ args?: never[] }` (40x TS2353 in one file) and its run object's `null`
|
|
// initializers infer as type `null` (123x TS18047/TS2531); and
|
|
// `daemonPortsGuarded(env = process.env)` infers as requiring a full
|
|
// `ProcessEnv`, so passing `{ DEV_DAEMON_PORT: '9555' }` is TS2345.
|
|
//
|
|
// Those errors are not the test author's, and they are not rare: 5 of the 15
|
|
// files there carry them, and ALL 15 were added within one month. Including
|
|
// the directory here would therefore red the root typecheck several times a
|
|
// month for a defect in a dependency, and the only quick remedy would be to
|
|
// add another exclude line — which trains exactly the reflex this comment
|
|
// exists to prevent. Typing the `.mjs` modules is the real fix; until then
|
|
// the honest statement is that this directory is unchecked.
|
|
//
|
|
// It is not unmeasured: `tsconfig.scripts.json` re-includes it and
|
|
// `scripts/ci/typecheck-scripts-gate.mjs` reports the per-file counts.
|
|
"scripts/__tests__/**",
|
|
|
|
// The one NON-test file under `scripts/` with errors, excluded by name so the
|
|
// gap stays enumerable. Its 2 errors are a genuinely broken import, not an
|
|
// inference artifact: it imports `~/server/db/notifDb`, which was deleted in
|
|
// 927e31bfee. `notifDbWrite` now lives in `apps/notifications` behind a
|
|
// different API (a function returning a pool), so restoring this script is a
|
|
// cross-workspace migration rather than a one-line fix. Delete this entry
|
|
// when that lands.
|
|
"scripts/local-dev/gen_seed.ts"
|
|
]
|
|
}
|