`local/layers` (eslint.config.js) resolves every import to its file and refuses one that goes up (lib/ → components/ui/ → features/ → modules/ → shell/) or that reaches into another module's own files. A module's index.ts is its public face: the stores, mounted at the root and read app-wide, which features/ may read too; a page is still opened lazily by import(). Its contract test probes every edge, and three mutants of the rule (off, no face check, a door for everyone) each turn it red. Six modules got that face; the shared channel UI (about, tags, tag manager) moved to features/channel, the filter chips and the saved-views context to features/filters, and the prefs store's controller type moved next to the store instead of importing it from its own page. The header's per-module controls and the eagerly loaded rails keep eight inline suppressions, each naming why: they go when the header gets slots and every rail loads lazily. `chunkGuard` fails the production build when a lazily imported module lands in a boot chunk (the entry, the shell, what they import) — e.g. a page re-exported from an index.ts, which makes its import() a silent no-op. Proved on a build with that mutant; today's build has none.
52 lines
2.4 KiB
JSON
52 lines
2.4 KiB
JSON
{
|
|
// The build-tool configs run in Node, not the browser: they need node types and must NOT be
|
|
// checked against the app's DOM lib. Split out because tsconfig.json's `include` is ["src"],
|
|
// so until now nothing type-checked these files at all. `npm run typecheck`
|
|
// runs this project alongside src and e2e.
|
|
"compilerOptions": {
|
|
// composite: required to be the target of tsconfig.json's `references` (which is what makes
|
|
// editors check these files under THIS config instead of an inferred one). A composite project
|
|
// may not disable emit (TS6310), so it emits declarations only, into node_modules — nothing
|
|
// lands in the repo and nothing reaches the bundle. Hence `tsc -p` without --noEmit below.
|
|
"composite": true,
|
|
"declaration": true,
|
|
"emitDeclarationOnly": true,
|
|
"outDir": "./node_modules/.tmp/tsconfig-node",
|
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig-node/.tsbuildinfo",
|
|
"target": "ES2022",
|
|
"module": "ESNext",
|
|
"moduleResolution": "bundler",
|
|
"lib": ["ES2022"],
|
|
"types": ["node"],
|
|
"strict": true,
|
|
"skipLibCheck": true,
|
|
"noUnusedLocals": true,
|
|
"noUnusedParameters": true,
|
|
"noFallthroughCasesInSwitch": true,
|
|
// An index read is `T | undefined` here, as it really is (0 errors when switched on).
|
|
"noUncheckedIndexedAccess": true,
|
|
"resolveJsonModule": true,
|
|
// The build-tool configs include a hand-written .js file (postcss; tailwind 4 needs no config
|
|
// file, and the stale `tailwind.config.js` entry pointed at nothing). checkJs runs
|
|
// the type checker over it via its `@type` JSDoc, so a bad option is caught by the gate instead
|
|
// of silently mis-building CSS. Was the last unchecked file.
|
|
"allowJs": true,
|
|
"checkJs": true
|
|
},
|
|
// reactPlugin.ts is the ONE React transform both configs import — it is build tooling,
|
|
// not app source, so it belongs here and not under tsconfig.json's ["src"]. A file imported by a
|
|
// listed one but absent from `include` is TS6307, not a silent pass. playwright.config.ts is
|
|
// here as well as in e2e/tsconfig.json because eslint's typed rules find a file's project
|
|
// through tsconfig.json's `references`, which name this project and not the e2e one.
|
|
"include": [
|
|
"vite.config.ts",
|
|
"vitest.config.ts",
|
|
"reactPlugin.ts",
|
|
"devOnlyGuard.ts",
|
|
"chunkGuard.ts",
|
|
"src/lib/chunkLeaks.ts",
|
|
"playwright.config.ts",
|
|
"postcss.config.js"
|
|
]
|
|
}
|