Skip to content

apps/console/vitest.config.ts is type-checked by nothing, and tsconfig.node.json's include lists a file that doesn't exist #3476

Description

@yinlianghui

Observation-class finding, tripped over while working #3384. Nothing a user hits today — recording it so it doesn't stay invisible.

1. apps/console/vitest.config.ts is in zero tsc programs

#3305 wired apps/console/tsconfig.node.json so the console's build config gets type-checked. vitest.config.ts sits right next to it and was not picked up by either console tsconfig:

  • apps/console/tsconfig.jsoninclude: ["src", "dev", "objectstack.config.ts"]
  • apps/console/tsconfig.node.jsoninclude: ["vite.config.ts", "vitest.setup.ts"]

type-check is turbo run type-check, i.e. per package — the root tsconfig.json (whose include does list apps) is the editor config and is not what CI runs. So no program contains the file. Measured on origin/main @ 2a9513d:

$ cd apps/console
$ ../../node_modules/.bin/tsc --noEmit --listFilesOnly | grep -c 'apps/console/vitest.config.ts'
0
$ ../../node_modules/.bin/tsc -p tsconfig.node.json --noEmit --listFilesOnly | grep -c 'apps/console/vitest.config.ts'
0

This is the same shape scripts/check-type-check-coverage.mjs was written to prevent one level up: the guard asks "does every package have a type-check script", not "does every checked-in .ts land in some program", so a config file adjacent to a covered one is a blind spot.

Impact today: nil — the file is 16 lines. The cost is that it is the one console config an agent can break without any gate noticing, and it merges two configs (rootConfig and viteConfig) whose shapes are exactly what a type-checker would catch drift in.

2. tsconfig.node.json includes vitest.setup.ts, which does not exist

$ ls apps/console/vitest.setup.ts
ls: cannot access 'vitest.setup.ts': No such file or directory

A literal (glob-less) include entry that matches nothing is silently ignored by TypeScript, so this is inert — but it reads as coverage that isn't there. Likely the intended file is the repo-root vitest.setup.dom.tsx that vitest.config.ts actually references.

Note for whoever picks this up

Adding vitest.config.ts to a checked program is not free: it imports ../../vitest.config.mts, and (once #3384 lands) ./vite.config.ts with an explicit extension, so the host tsconfig needs allowImportingTsExtensions plus one of noEmit / emitDeclarationOnly / rewriteRelativeImportExtensions. See PR #3475 for the measured details on that interaction.

Related: #3305 (wired the gate), #3384 / PR #3475 (found this). Not blocked by either — the gap is independent of how #3384 is resolved.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions