Skip to content

Type check with vp check - #2419

Merged
kmcginnes merged 1 commit into
mainfrom
vp-type-check
Oct 14, 2026
Merged

kmcginnes merged 1 commit into
mainfrom
vp-type-check

Conversation

@kmcginnes

@kmcginnes kmcginnes commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Before tsc can go, we need to know whether Vite+'s type check catches everything it does. This turns on lint.options.typeCheck, so vp check and vp lint also report TypeScript errors through tsgolint. pnpm checks still runs tsc afterwards, so CI runs both side by side until Retire tsc now that vp check type checks (#2420) lands.

     options: {
       typeAware: true,
+      typeCheck: true,
     },

AGENTS.md and docs/development.md no longer say vp check skips type checks.

Evidence

I planted each error below in a new or existing file, then ran vp lint and pnpm check:types. Both exit 1, with the same TypeScript code, for:

  • All 3 packages: a plain type error (TS2322), an implicit any (TS7006), an unused parameter and an unused local (TS6133, even with no-unused-vars disabled)
  • graph-explorer: Object.groupBy outside lib: ES2023 (TS2550), a bad @/ or @shared/ path (TS2307), a .tsx prop type error, and a type error in a .test.ts file
  • shared: Promise.withResolvers outside lib (TS2550), a .ts import without allowImportingTsExtensions (TS5097), a missing override (TS4114), an enum under erasableSyntaxOnly (TS1294), and unreachable code
  • proxy server: an extensionless relative import under nodenext (TS2835)
  • Config files: a type error in the root and graph-explorer vite.config.ts

vp check also catches a type error in packages/shared/vite.config.ts and packages/graph-explorer-proxy-server/vite.config.ts. tsc misses both, because no tsconfig includes those files.

Timing: vp check takes 12.8s for the whole repo, with lint and types together in 8.7s of that. pnpm check:types takes 3.4s. The pre-commit hook on a single file takes 3 to 6s whether typeCheck is on or off.

Merge Danger

Door: two-way

Impact: contributors

Type errors now also fail the pre-commit hook for the files being committed.

Related

@kmcginnes
kmcginnes added this pull request to stack #2421 October 14, 2026 23:07

@kmcginnes kmcginnes left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@kmcginnes
kmcginnes merged commit a212fce into main Oct 14, 2026
3 checks passed
@kmcginnes
kmcginnes deleted the vp-type-check branch October 14, 2026 23:10
kmcginnes added a commit that referenced this pull request Oct 14, 2026
## Summary

Before `tsc` can go, we need to know whether Vite+'s type check catches
everything it does. This turns on `lint.options.typeCheck`, so `vp
check` and `vp lint` also report TypeScript errors through tsgolint.
`pnpm checks` still runs `tsc` afterwards, so CI runs both side by side
until [Retire tsc now that vp check type checks
(#2420)](#2420) lands.

```diff
     options: {
       typeAware: true,
+      typeCheck: true,
     },
```

`AGENTS.md` and `docs/development.md` no longer say `vp check` skips
type checks.

## Evidence

I planted each error below in a new or existing file, then ran `vp lint`
and `pnpm check:types`. Both exit 1, with the same TypeScript code, for:

- **All 3 packages:** a plain type error (TS2322), an implicit `any`
(TS7006), an unused parameter and an unused local (TS6133, even with
`no-unused-vars` disabled)
- **graph-explorer:** `Object.groupBy` outside `lib: ES2023` (TS2550), a
bad `@/` or `@shared/` path (TS2307), a `.tsx` prop type error, and a
type error in a `.test.ts` file
- **shared:** `Promise.withResolvers` outside `lib` (TS2550), a `.ts`
import without `allowImportingTsExtensions` (TS5097), a missing
`override` (TS4114), an `enum` under `erasableSyntaxOnly` (TS1294), and
unreachable code
- **proxy server:** an extensionless relative import under `nodenext`
(TS2835)
- **Config files:** a type error in the root and graph-explorer
`vite.config.ts`

`vp check` also catches a type error in `packages/shared/vite.config.ts`
and `packages/graph-explorer-proxy-server/vite.config.ts`. `tsc` misses
both, because no tsconfig includes those files.

**Timing:** `vp check` takes 12.8s for the whole repo, with lint and
types together in 8.7s of that. `pnpm check:types` takes 3.4s. The
pre-commit hook on a single file takes 3 to 6s whether `typeCheck` is on
or off.

## Merge Danger

**Door:** two-way

**Impact:** contributors

Type errors now also fail the pre-commit hook for the files being
committed.

## Related

- Related to #2305
kmcginnes added a commit that referenced this pull request Oct 14, 2026
## Summary

Now that `vp check` type checks, the `tsc` scripts run the same check a
second time. This removes them, so `pnpm checks` is `vp check`.

```diff
-    "check:types": "pnpm -r --include-workspace-root --parallel --stream run typecheck",
-    "typecheck": "tsc --noEmit",
-    "checks": "vp check && pnpm run check:types",
+    "checks": "vp check",
```

The `typecheck` script is also gone from all 3 packages. `AGENTS.md`,
`REVIEW.md`, and `docs/agents/testing.md` now point at `pnpm checks` or
the type check in `vp check` instead of `tsc`. The `typescript` dev
dependency stays, because editors and tsgolint use it.

Stacked on [Type check with vp check
(#2419)](#2419), which has the
parity evidence.

## Evidence

**Before:** `pnpm checks` ran `vp check`, then `tsc --noEmit` in the
root and each package.
**After:** `pnpm checks` runs `vp check` only. A planted `const x:
number = "s"` in `packages/shared` still fails it with TS2322, and a
clean tree passes: `Found no warnings, lint errors, or type errors in
917 files`.

## Merge Danger

**Door:** two-way

**Impact:** contributors

`pnpm check:types` and the package `typecheck` scripts no longer exist.
Use `pnpm checks`.

## Related

- Related to #2305
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant