Files
ever-gauzy/tools/jest-config-globals.d.ts
Ruslan KonviserandClaude Opus 5 be59bce929 CI: add a jest-config typecheck gate and a non-blocking lint report (#10119)
Nothing in CI ran `tsc --noEmit` or ESLint. That is why a duplicated `transformIgnorePatterns`
key sat in `packages/core/jest.config.ts` undetected (TS1117, fixed in #10116), and why ESLint
had been broken repo-wide long enough for 93 of 93 projects to fail (fixed in #10117). Both
gaps are now covered, deliberately with very different postures.

`typecheck-configs` is a real gate. `tools/tsconfig.jest-configs.json` type-checks all 95
jest.config.ts files and is green today, so the job fails if that stops being true. It is built
to need nothing but the compiler — no `extends`, `types: []`, `noResolve`, and a small shim in
`tools/jest-config-globals.d.ts` for the 53 CommonJS configs plus the one `@nx/jest` import in
the root config. The compile is 0.5s across all 95 files; the whole job measured 68s in CI,
dominated by runner provisioning. A cold `yarn install` on this fleet is measured in hours, so
avoiding one is the entire design constraint.

Proven, not assumed: exit 0 on the current tree, and exit 2 with TS1117 when a duplicate key is
reintroduced.

`lint` is NOT a gate. It runs `nx run-many -t lint` and writes the outcome to the run summary.
The repair in #10117 left roughly 2,650 errors and 6,100 warnings, all predating the job, so a
blocking lint gate would wedge every PR on day one. Non-blocking at both the step level (so the
summary still runs) and the job level (so a cache miss or install failure on the fleet cannot
redden the check either). Verified end to end on this PR: ESLint exited 1 with real findings,
the summary step ran, and the check reported green.

TypeScript is installed pinned with `--ignore-scripts` rather than fetched through `npx --yes`,
which SonarCloud correctly flagged as a vulnerability twice (S6505/S8543) for running a
network-fetched package's lifecycle scripts in CI. It is also faster.

Neither job is wired into branch protection; `develop` has no required status checks at all, so
these are visible signals rather than hard gates. The tracking task for burning down the ESLint
backlog lives in the agent workspace at `knowledge/TASKS.md`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-05 16:44:16 +02:00

27 lines
1.3 KiB
TypeScript

/**
* Minimal ambient declarations for `tools/tsconfig.jest-configs.json`.
*
* That project deliberately sets `"types": []` so it can run with nothing installed but
* TypeScript itself — a CI job that needed `yarn install` first would cost minutes instead of
* seconds, and the whole point of the check is that it is cheap enough to run on every PR.
*
* `@types/node` is therefore unavailable, but 53 of the workspace's jest configs are CommonJS
* (`module.exports = { ... }`). These two declarations are all they need. Do not grow this file
* into a general-purpose Node shim — if a config needs more than this, it probably belongs in a
* project that has real types.
*/
declare const module: { exports: unknown };
declare const require: (id: string) => unknown;
/**
* The root `jest.config.ts` is the only one of the 95 that imports anything; the other 94 are
* self-contained data literals. Declaring the module here keeps the check at 95/95 with no
* exclusion to remember, without resolving into `node_modules`.
*
* This deliberately does not describe `@nx/jest`'s real API — the point of the check is the
* syntax and shape of the config files themselves, not the types of a third-party package.
*/
declare module '@nx/jest' {
export function getJestProjectsAsync(): Promise<unknown>;
}