|
| 1 | +// The TEST-layer type-check program (issue #14173 — wired per the triage ruling on |
| 2 | +// that card, comment 5502888897, 2026-09-02: "onboard by *wiring* to whichever of |
| 3 | +// the two in-repo routes #14062 lands on"). #14062 landed in PR #14420 on the |
| 4 | +// `scripts/check-test-typecheck.mts` instrument, so that is the route this file |
| 5 | +// follows. `tsconfig.json` beside this one stays exactly as it is: it is the BUILD |
| 6 | +// config. This sibling puts the test layer in front of tsc under the module |
| 7 | +// semantics vitest really executes it with, and `package.json`'s `typecheck` |
| 8 | +// script NAMES it (via `check:test-typecheck --project`), because a config no |
| 9 | +// script invokes is exactly the phantom this whole change is about. |
| 10 | +// |
| 11 | +// This is a CONVERSION, not a new debt-opening decision: the coverage gate |
| 12 | +// already carried a `@objectstack/lint` TEST_DEBT entry (`scripts/check-type-check- |
| 13 | +// coverage.mjs`, `errors: 16`) recording this package's untyped test layer at the |
| 14 | +// per-PACKAGE approximation. That entry's own authority is what this file converts |
| 15 | +// to per-file/per-signature form — exactly as PR #14420's graduation docblock |
| 16 | +// describes for the plugin family ("None of them was PAID DOWN … the same errors |
| 17 | +// are now held one level finer"). |
| 18 | +// |
| 19 | +// What differs from the build config, and what deliberately does NOT: |
| 20 | +// - MODULE SEMANTICS ONLY, plus `lib`. The tests are written and executed as |
| 21 | +// ESM by vitest (esbuild/vite). Matching that is FIDELITY, not laxity: it is |
| 22 | +// the same subtraction `packages/spec`, `packages/rest` and the `packages/ |
| 23 | +// plugins/**` family each made, and it removes a config-tier error pile that |
| 24 | +// says nothing about the tests. |
| 25 | +// - ⛔ STRICTNESS IS UNTOUCHED. `strict`, `noUnusedLocals`, `noUnusedParameters`, |
| 26 | +// `noImplicitReturns`, `noFallthroughCasesInSwitch`, `rootDir`, `paths` and |
| 27 | +// `types` (this package's `types: ["node"]` included) are all INHERITED from |
| 28 | +// `tsconfig.json` (and through it the root config), and none of them is |
| 29 | +// re-declared here. ⚠️ A child that declared its own `paths` would REPLACE the |
| 30 | +// parent map rather than merge into it, silently sending a source-resolved |
| 31 | +// specifier back to `dist/` — a BUILD ARTIFACT — so this file declares none. |
| 32 | +// Nothing here may loosen a type rule; if a test does not compile, that is the |
| 33 | +// finding. |
| 34 | +// - `lib: ["ES2022"]`, for the same reason `packages/rest` and `plugin-auth` |
| 35 | +// state: the root config's `lib` is ES2020 and vitest runs on a Node that has |
| 36 | +// ES2022 builtins, so the gap is reported as TS2550 about the CHECK. No `DOM`: |
| 37 | +// nothing in this layer touches a browser global. |
| 38 | +// |
| 39 | +// MEASURED at 6aea1f559, workspace closure built first (`tsc --noEmit --pretty |
| 40 | +// false --listFiles -p tsconfig.test.json`, and the same command without |
| 41 | +// `--listFiles`): |
| 42 | +// |
| 43 | +// files in this program 627 |
| 44 | +// own `src/**/*.test.ts` in it 93 |
| 45 | +// errors under BUILD semantics 22 |
| 46 | +// errors under THIS config 6 |
| 47 | +// |
| 48 | +// The two readings DISAGREE by exactly the recorded coverage-gate debt this |
| 49 | +// change converts: under BUILD semantics (NodeNext, tests included, no other |
| 50 | +// change) the total is 11 TS7006 + 5 TS2835 + 6 TS6059 = 22. The TS7006 and |
| 51 | +// TS2835 — 16 in all, the coverage gate's whole recorded `@objectstack/lint` |
| 52 | +// TEST_DEBT entry — dissolve under `bundler` resolution: TS2835 is "relative |
| 53 | +// import missing `.js`", which `bundler` does not require, and the TS7006s are |
| 54 | +// downstream implicit-`any` parameters whose callback types resolve once the |
| 55 | +// import does. Config tier, not the tests, same as `packages/spec` measured. |
| 56 | +// The 6 TS6059 that remain are `rootDir` violations from two test files |
| 57 | +// importing example-app fixtures (`examples/app-showcase`) outside this |
| 58 | +// package's `rootDir`, which this config inherits untouched (see above) — real, |
| 59 | +// pre-existing, and explicitly NOT part of the original 16 by that entry's own |
| 60 | +// prior note ("never this package's debt ... reporting on its own inherited |
| 61 | +// rootDir"). |
| 62 | +// |
| 63 | +// BEFORE THIS FILE: the build config's `exclude` NAMED `**/*.test.ts` and |
| 64 | +// `**/*.spec.ts`, so none of the test files here reached any tsc program the |
| 65 | +// `typecheck` script runs (#14173). |
| 66 | +// |
| 67 | +// The residual error(s), if any, are PRE-EXISTING — this change edits no test |
| 68 | +// file, and every one of them would have been reported on `origin/main` had this |
| 69 | +// program always existed. They are ledgered per file in `test-typecheck-debt.json` |
| 70 | +// beside this config, EXACT and shrink-only: a file that gains an error is red, |
| 71 | +// one that loses an error is red until re-recorded, one that reaches zero is red |
| 72 | +// until its entry is deleted, a signature that ARRIVES or VANISHES is red even at |
| 73 | +// an unchanged file total, and a file NOT listed there may have no errors at all. |
| 74 | +// ⛔ The ruling is explicit that this PR does not REPAIR them — it makes the |
| 75 | +// ratchet able to see them; paydown follows the ratchet's own shrink-only |
| 76 | +// discipline, on its own cards. |
| 77 | +{ |
| 78 | + "extends": "./tsconfig.json", |
| 79 | + "compilerOptions": { |
| 80 | + "noEmit": true, |
| 81 | + "module": "esnext", |
| 82 | + "moduleResolution": "bundler", |
| 83 | + "lib": ["ES2022"] |
| 84 | + }, |
| 85 | + "include": ["src/**/*"], |
| 86 | + "exclude": ["node_modules", "dist"] |
| 87 | +} |
0 commit comments