import { fileURLToPath } from "node:url"; import { ESLint } from "eslint"; import { beforeAll } from "vitest"; // The one ESLint the lint-rule contract tests probe with (`*.contract.test.ts` that pin a selector in // eslint.config.js). Its first lint loads the whole config and every plugin: ~1.5 s warm, measured at // 8 s cold, past vitest's 5 s per test, so the first probe of a file timed out once (E28 audit). The // hook below pays that cost once per test file, under its own budget; importing this registers it. const FRONTEND = fileURLToPath(new URL("../../", import.meta.url)); export const eslint = new ESLint({ cwd: FRONTEND }); beforeAll(async () => { await eslint.lintText("", { filePath: "src/components/__probe.tsx" }); }, 60_000);