Summary
pilo-core and pilo-server never typecheck their own test files. Nothing is broken today — both are clean at baseline — but the tests are outside every typecheck gate, so type errors in them can't be caught by CI.
Split out of #688, where this surfaced while measuring flag costs.
Where it comes from
packages/core/tsconfig.json:
"include": ["src/**/*"],
"exclude": ["node_modules", "dist", "**/*.test.ts"]
packages/server/tsconfig.json has the same shape, and packages/server/tsconfig.check.json only adds noEmit: true — so it inherits the src-only include and the typecheck-specific config doesn't widen coverage.
Coverage today:
| Package |
Test files |
Typechecked? |
How |
| core |
42 (993 tests) |
no |
tsconfig.json excludes **/*.test.ts |
| server |
2 (103 tests) |
no |
same exclusion; tsconfig.check.json doesn't widen include |
| cli |
7 |
yes |
tsconfig.check.json sets include: ["src/**/*", "test/**/*"] |
| extension |
12 + e2e |
yes |
WXT's generated config includes ../**/* |
cli already demonstrates the fix: a tsconfig.check.json that widens include for typecheck-only, leaving the build config's rootDir/declaration settings alone.
Why it's worth fixing
The tests run under vitest, which transpiles without typechecking — so a test can reference a renamed export, pass wrong argument types, or assert against a stale shape, and nothing flags it as long as the assertions happen to pass at runtime. That's the same class of silent gap as the typo'd script name in #689: green CI that isn't checking what you assume.
Both packages are clean at baseline right now, so adopting this is cheap today and gets more expensive the longer it waits.
Caveat, and the link back to #688
Enabling this interacts with #688. Core's test files carry 145 noUncheckedIndexedAccess findings — measured — versus 14 in core/src. So:
- Typechecking core's tests at current strictness: free (0 errors).
- Typechecking them after adopting
noUncheckedIndexedAccess: +145 sites.
Whichever of the two lands second pays that bill, which is an argument for deciding #688 with this in view rather than discovering it afterward.
Suggested shape
Add a tsconfig.check.json to core mirroring cli's, widen server's, and wire both into their typecheck scripts. Note core needs rootDir widened (or declaration disabled) in the check config — inheriting rootDir: "./src" while including test/ produces one TS6059 per test file, which is a config error rather than a type error and masks everything else. I hit exactly that while measuring.
Summary
pilo-coreandpilo-servernever typecheck their own test files. Nothing is broken today — both are clean at baseline — but the tests are outside every typecheck gate, so type errors in them can't be caught by CI.Split out of #688, where this surfaced while measuring flag costs.
Where it comes from
packages/core/tsconfig.json:packages/server/tsconfig.jsonhas the same shape, andpackages/server/tsconfig.check.jsononly addsnoEmit: true— so it inherits the src-onlyincludeand the typecheck-specific config doesn't widen coverage.Coverage today:
tsconfig.jsonexcludes**/*.test.tstsconfig.check.jsondoesn't widenincludetsconfig.check.jsonsetsinclude: ["src/**/*", "test/**/*"]../**/*cli already demonstrates the fix: a
tsconfig.check.jsonthat widensincludefor typecheck-only, leaving the build config'srootDir/declarationsettings alone.Why it's worth fixing
The tests run under vitest, which transpiles without typechecking — so a test can reference a renamed export, pass wrong argument types, or assert against a stale shape, and nothing flags it as long as the assertions happen to pass at runtime. That's the same class of silent gap as the typo'd script name in #689: green CI that isn't checking what you assume.
Both packages are clean at baseline right now, so adopting this is cheap today and gets more expensive the longer it waits.
Caveat, and the link back to #688
Enabling this interacts with #688. Core's test files carry 145
noUncheckedIndexedAccessfindings — measured — versus 14 incore/src. So:noUncheckedIndexedAccess: +145 sites.Whichever of the two lands second pays that bill, which is an argument for deciding #688 with this in view rather than discovering it afterward.
Suggested shape
Add a
tsconfig.check.jsonto core mirroring cli's, widen server's, and wire both into theirtypecheckscripts. Note core needsrootDirwidened (ordeclarationdisabled) in the check config — inheritingrootDir: "./src"while includingtest/produces oneTS6059per test file, which is a config error rather than a type error and masks everything else. I hit exactly that while measuring.