Skip to content

Commit 67b4db2

Browse files
build: typecheck with tsrs and Effect's rules through @effect/tsgo
Every workspace typechecks with `effect-tsgo tsrs --noEmit`, which runs the Rust TypeScript 7 checker with Effect's diagnostics built in. It replaces @tsc-rs/typescript, whose Effect rules stopped at its Oct 22 build. `typescript` remains only in apps/marketing, for Astro. Renames the deprecated preferSchemaOverJson rule, drops 32 dead suppressions, and fixes the findings the newer rules report. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent dd5f98e commit 67b4db2

91 files changed

Lines changed: 548 additions & 601 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.pnpmfile.cjs‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22
// Keep other platforms native; release scripts set their own architectures.
33
module.exports = {
44
hooks: {
5-
// `typescript` is @tsc-rs/typescript (the catalog entry). Its npm version (0.8.x) is outside
6-
// vite-plus-core's typescript peer range, so pnpm gave the vite-plus that @effect/vitest
7-
// imports apps/marketing's [email protected] instead, and tests loaded a second vitest.
8-
readPackage(pkg) {
9-
if (pkg.name === "@voidzero-dev/vite-plus-core" && pkg.peerDependencies?.typescript) {
10-
pkg.peerDependencies.typescript = "*";
11-
}
12-
return pkg;
13-
},
145
updateConfig(config) {
156
// oxlint-disable-next-line t3code/no-global-process-runtime -- pnpm loads this file before any Effect runtime exists.
167
if (process.platform !== "win32") return config;

‎.vscode/settings.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"source.fixAll.oxc": "always"
66
},
77
"oxc.unusedDisableDirectives": "warn",
8-
"js/ts.tsdk.path": "node_modules/typescript/lib",
8+
"js/ts.experimental.useTsgo": true,
9+
"js/ts.tsdk.path": ".vscode/tsdk",
910
"typescript.preferences.autoImportFileExcludePatterns": [".repos/**"],
1011
"javascript.preferences.autoImportFileExcludePatterns": [".repos/**"],
1112
"files.watcherExclude": {

‎.vscode/tsdk/tsgo‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
# VS Code's TypeScript 7 extension starts `<tsdk>/tsgo --lsp --stdio`. Exec Effect's patched tsrs
3+
# directly: through the effect-tsgo Node launcher, the LSP's stdin read intermittently fails (EAGAIN).
4+
exec "$(cd "$(dirname "$0")/../.." && node -e '
5+
const { createRequire } = require("node:module");
6+
const fs = require("node:fs");
7+
const path = require("node:path");
8+
const platform = `@effect/tsgo-${process.platform}-${process.arch}/package.json`;
9+
const dir = path.join(path.dirname(createRequire(require.resolve("@effect/tsgo/package.json")).resolve(platform)), "artifacts/tsrs");
10+
process.stdout.write(path.join(dir, fs.readdirSync(dir).sort().at(-1), "tsrs"));
11+
')" "$@"

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ An empty database is a bad test. Seed your worktree's `.t3` with a copy of real
100100

101101
- Before you push, run `vp run check:changed`. It runs CI's fast checks for changed files: format, lint, knip, typecheck of affected packages and dependents, tests beside changes, and the cross-file checks those miss. CI still runs the full test suites.
102102
- While you iterate, run `vp test run <files>`. For big files, add `-t "<name>"`.
103-
- Use `vp run typecheck`, not `npx tsc`; it caches per package. Both run tsc-rs (`typescript` is the `@tsc-rs/typescript` drop-in).
103+
- Use `vp run typecheck`; it caches per package. Each package runs `effect-tsgo tsrs --noEmit`, the Rust TypeScript 7 checker with Effect's diagnostics built in. There is no `typescript` package to run.
104104
- Run `node -e` snippets from `apps/server` or the owning package. `effect` does not resolve from the repo root.
105105
- Test behavior that can break, such as orchestration and event-sourcing, provider protocol translation, auth and permission guards, persistence and migrations, external-format parsing, race fixes, and the logic a bug fix changed. Leave out tests for what types already guarantee, trivial logic, copy text, smoke runs, mock-call mirrors, callback wiring, and props rendered to static markup.
106106
- Extend before you add. When an existing test or table covers the behavior, add a row or an assertion there. Write a new `it` only when no case fits.

‎apps/desktop/src/app/DesktopManagedPolicy.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ export const layerTest = (policy?: ManagedPolicyDocument | ManagedPolicyFileErro
5656
DesktopManagedPolicy.of({
5757
read:
5858
policy === undefined
59-
? // @effect-diagnostics-next-line effectSucceedWithVoid:off - No policy is undefined, not void.
60-
Effect.succeed(undefined)
59+
? Effect.undefined
6160
: isManagedPolicyFileError(policy)
6261
? Effect.fail(policy)
6362
: Effect.succeed({ source: "/test/policy.json", document: policy }),

‎apps/desktop/vite.config.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ export default defineConfig({
4141
dependsOn: ["t3#build"],
4242
cache: false,
4343
},
44-
// tsc (tsc-rs) rewrites the tsbuildinfo it reads, which keeps a task out of the cache.
44+
// A local tsbuildinfo is leftover build state, not a typecheck input.
4545
typecheck: {
46-
command: "tsc --noEmit",
46+
command: "effect-tsgo tsrs --noEmit",
4747
cache: { input: [{ auto: true }, "!*.tsbuildinfo"] },
4848
},
4949
},

‎apps/mobile/app.config.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ type AppVariant = "development" | "preview" | "production";
77

88
const repoEnv = loadRepoEnv();
99
Object.assign(process.env, repoEnv);
10+
// Expo's TypeScript setup otherwise installs `typescript` on every start; we typecheck with tsrs.
11+
process.env.EXPO_NO_TYPESCRIPT_SETUP = "1";
1012

1113
const APP_VARIANT = resolveAppVariant(repoEnv.APP_VARIANT);
1214
const isIosPersonalTeamBuild = repoEnv.T3CODE_IOS_PERSONAL_TEAM === "1";

‎apps/mobile/package.json‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"generate:highlights": "node scripts/generate-highlights.mts",
4949
"eas-build-on-success": "node scripts/upload-sourcemaps.mts build",
5050
"test": "vp test run --project unit --project react",
51-
"typecheck": "tsc --noEmit"
51+
"typecheck": "effect-tsgo tsrs --noEmit"
5252
},
5353
"dependencies": {
5454
"@clerk/expo": "catalog:",
@@ -150,8 +150,7 @@
150150
"aws4fetch": "1.0.20",
151151
"babel-preset-expo": "~58.0.17",
152152
"jsdom": "^30.0.1",
153-
"tailwindcss": "^4.0.0",
154-
"typescript": "catalog:"
153+
"tailwindcss": "^4.0.0"
155154
},
156155
"enriched-markdown": {
157156
"enableMath": true,
@@ -161,7 +160,6 @@
161160
"install": {
162161
"exclude": [
163162
"react-native-keyboard-controller",
164-
"typescript",
165163
"react-native-screens",
166164
"react-native-enriched-markdown"
167165
]

‎apps/server/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"build:bundle": "vp pack",
2121
"build:exe": "node scripts/cli.ts build-exe",
2222
"start": "node dist/bin.mjs",
23-
"typecheck": "tsc --noEmit",
23+
"typecheck": "effect-tsgo tsrs --noEmit",
2424
"test": "vp test run",
2525
"record:codex-replay": "bun scripts/record-codex-app-server-replay-fixture.ts",
2626
"record:claude-replay": "bun scripts/record-claude-agent-sdk-replay-fixture.ts",

‎apps/server/scripts/verify-background-live.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// @effect-diagnostics nodeBuiltinImport:off globalTimers:off globalDate:off globalFetch:off globalConsole:off preferSchemaOverJson:off - Host-side process verifier retains raw wire evidence and owns deadline timers.
1+
// @effect-diagnostics nodeBuiltinImport:off globalTimers:off globalDate:off globalFetch:off globalConsole:off globalJsonInEffect:off - Host-side process verifier retains raw wire evidence and owns deadline timers.
22
import * as NodeAssert from "node:assert/strict";
33
import * as NodeChildProcess from "node:child_process";
44
import * as NodeCrypto from "node:crypto";

0 commit comments

Comments
 (0)