Repository navigation
Expand file tree
/
Copy pathtsconfig.typecheck.json
More file actions
40 lines (36 loc) · 2.19 KB
/
Copy pathtsconfig.typecheck.json
File metadata and controls
40 lines (36 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{
// Type-checks the whole package INCLUDING test/, which tsconfig.json excludes because it is
// the build config and must not emit test files into dist/.
//
// Why this file exists: `bun test` transpiles without type-checking, so nothing ever
// type-checked test/. A test could reference a symbol the source had already deleted, get
// `undefined` back and still pass. See Asena/tsconfig.typecheck.json for the incident.
"extends": "./tsconfig.json",
"compilerOptions": {
// Check only. `build` (tsc -p tsconfig.json) still owns dist/.
"noEmit": true,
"declaration": false,
"sourceMap": false,
// --- Relaxations, test-tree only. The build config keeps all of these on. ---
// Tests declare classes and fields for no reason other than to run a decorator over them,
// and take callback parameters they do not use in order to match a framework signature.
// Both are correct test code and neither says anything about whether an API still exists.
"noUnusedLocals": false,
"noUnusedParameters": false,
// Route tables, container service maps and metadata records are `{ [key: string]: T }`.
// Tests read them with dot access. Index-signature style is a lint preference; a property
// that no longer exists is still reported as TS2339.
"noPropertyAccessFromIndexSignature": false,
// Set semantics, not define semantics - what `bun test` actually runs the tree under, and
// what stops TS2612 firing on AsenaJS's documented idiom of a subclass redeclaring a
// decorated field (`@Inject() public override foo: Foo`). The overwrite is the point.
"useDefineForClassFields": false
},
"include": ["lib/**/*.ts", "bin/**/*.ts", "test/**/*.ts"],
// test/fixtures/** is not part of this package's program: it is a throwaway project the
// CLI *scans* from disk (componentDetection.test.ts points the scanner at it). It imports
// "@asenajs/asena-cli" by package name - a self-reference that cannot resolve from inside
// the package - and is written against a pre-0.9 Asena API. Type-checking it would report
// the fixture's own project, not this one. Its staleness is noted in the report.
"exclude": ["node_modules", "dist", "test/fixtures"]
}