|
| 1 | +// The TEST-layer type-check program (#5449, the mechanism #5286/PR #5478 set |
| 2 | +// for `packages/spec`). `tsconfig.json` above stays as it is: it is the BUILD |
| 3 | +// config, and its `**/*.test.ts` exclusion has a reason — ci.yml gates that no |
| 4 | +// test file reaches the published artifact. This sibling puts the excluded |
| 5 | +// layer back in front of tsc, and `package.json`'s `typecheck` script NAMES it |
| 6 | +// (`-p tsconfig.test.json`), because a config no script invokes is exactly the |
| 7 | +// phantom this whole change is about. |
| 8 | +// |
| 9 | +// What differs from the build config, and what deliberately does NOT: |
| 10 | +// - module semantics ONLY. The tests are written and executed as ESM by |
| 11 | +// vitest (esbuild/vite), while `client` has no `"type": "module"`, so the |
| 12 | +// build config's NodeNext compiles them as CJS and reports errors about the |
| 13 | +// CHECK rather than the code (TS2835 extensionless relative imports, TS1470 |
| 14 | +// `import.meta`, TS2550 lib). Matching vitest is fidelity. |
| 15 | +// - `rootDir` widens to the workspace root. It steers emit layout only, and |
| 16 | +// this program emits nothing; inherited as `./src` it reported TS6059 for |
| 17 | +// the four route-ledger modules `client-url-conformance.test.ts` and the |
| 18 | +// three `*-route-ledger-coverage.test.ts` files deep-import from sibling |
| 19 | +// packages (`../../runtime/src/route-ledger`, …). Those five TS6059 are the |
| 20 | +// bulk of this package's stale TEST_DEBT entry — a measurement of the |
| 21 | +// misconfigured check, not of the tests. |
| 22 | +// - STRICTNESS IS UNTOUCHED. `strict`, `noUnusedLocals`, `noUnusedParameters`, |
| 23 | +// `noImplicitReturns` and the rest are inherited from the root config. |
| 24 | +// Nothing here may loosen a type rule; if a test does not compile, that is |
| 25 | +// the finding. |
| 26 | +// |
| 27 | +// `include` deliberately stops at `src`, matching the build config's root, and |
| 28 | +// none of the files it leaves out carries a `@ts-expect-error`, so no pin is |
| 29 | +// hiding there. `tests/integration/` — the suite `vitest.integration.config.ts` |
| 30 | +// runs against a live server — is in no tsconfig at all: a second, |
| 31 | +// differently-shaped hole (1 file / 3 errors, one of them a real API drift, the |
| 32 | +// suite reading a `client.discovery` property `ObjectStackClient` does not |
| 33 | +// have) that wants its own change rather than a rider on this one. Filed as |
| 34 | +// #5544. |
| 35 | +// |
| 36 | +// The per-file ledger beside this config (`test-typecheck-debt.json`) is small |
| 37 | +// on purpose. Under the repaired config the whole test layer came to 13 errors; |
| 38 | +// eight were the tests' own and are fixed in this same change (two unused |
| 39 | +// imports, an unused parameter, two possibly-undefined reads, an `unknown` |
| 40 | +// payload asserted structurally, a `reference_to` key the field schema never |
| 41 | +// had, and the phantom pin itself). Re-spelling that key uncovered one more of |
| 42 | +// the remaining kind, and all six that stay are ONE producer-side defect |
| 43 | +// wearing three files' clothes: objectql's `registerObject` takes the schema's |
| 44 | +// OUTPUT type (`z.infer`) where it should take the INPUT one, so a perfectly |
| 45 | +// good authored literal reads as missing nine defaulted keys (#5543). Holding |
| 46 | +// them EXACT and shrink-only means fixing #5543 turns the ledger red until the |
| 47 | +// entries are deleted, instead of letting it rot. Every file NOT listed there — |
| 48 | +// `client.test.ts`, the pin file, first among them — must have no errors at |
| 49 | +// all. |
| 50 | +{ |
| 51 | + "extends": "./tsconfig.json", |
| 52 | + "compilerOptions": { |
| 53 | + "noEmit": true, |
| 54 | + "rootDir": "../..", |
| 55 | + "module": "esnext", |
| 56 | + "moduleResolution": "bundler", |
| 57 | + "lib": ["ES2022", "DOM", "DOM.Iterable"], |
| 58 | + "types": ["node"] |
| 59 | + }, |
| 60 | + "include": ["src/**/*"], |
| 61 | + "exclude": ["node_modules", "dist"] |
| 62 | +} |
0 commit comments