Repository navigation
Expand file tree
/
Copy pathtsconfig.json
More file actions
100 lines (100 loc) · 4.32 KB
/
Copy pathtsconfig.json
File metadata and controls
100 lines (100 loc) · 4.32 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"compileOnSave": false,
// No include, so this project is every file under the root, and with allowJs
// that took in the applications' built bundles in dist/ too. The type-aware
// lint resolves specs and scripts against this project, so a build could
// move its counts: the e2e embed build added 60 no-unsafe-call warnings in
// files it has nothing to do with. The built libraries stay in: their
// imports of each other resolve through `paths`, which only applies here.
"exclude": [
"node_modules",
"out-tsc",
"dist/out-tsc",
"dist/e2e",
"dist/reactome",
"dist/reactome-diagram",
"dist/website-angular",
"dist/pathway-browser"
],
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"strict": true,
"noImplicitOverride": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"noPropertyAccessFromIndexSignature": true,
"allowJs": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"sourceMap": true,
"declaration": false,
"skipLibCheck": true,
"isolatedModules": true,
"experimentalDecorators": true,
"resolveJsonModule": true,
"moduleResolution": "bundler",
"importHelpers": true,
"paths": {
"reactome-table": ["dist/reactome-table"],
"reactome-gsa-form": ["dist/reactome-gsa-form"]
},
"target": "ES2022",
"module": "ES2022",
"useDefineForClassFields": false,
"typeRoots": ["node_modules/@types", "src/types"]
},
// Strictness here is a deliberate trade: each of these was measured against
// the codebase before being switched on. strictTemplates cost 83 fixes and
// was worth it; typeCheckHostBindings, strictStandalone and the checks below
// all cost nothing. noUncheckedIndexedAccess is on (#345): an index
// out of range or a missing key is undefined, and the code is made to say so.
// It took 346 findings across the app and the libraries, handled with guards
// and destructuring rather than non-null assertions, and turned up real bugs
// among them (an icon search that threw on no results, names and dates that
// read "undefined"). A first trial had set it aside as mostly assertions.
// exactOptionalPropertyTypes is on (#337): `x?: T` means the key may be
// missing, not that it may hold undefined. Build objects that leave a value
// out by leaving the key out; write `x?: T | undefined` only where undefined
// is put there on purpose (a field reset, a value copied across that the
// source may lack). Query parameters go through httpParams(), which drops
// unset ones, rather than handing HttpClient `params: undefined`.
// strictStandalone is deliberately absent: reactome-table is still an
// NgModule library with declared, non-standalone components, and it is
// published, so converting it is not a config change.
//
// Every template diagnostic is an error, including any a later Angular adds
// (defaultCategory). The two redundancy ones, NG8107/NG8102, fire where a type
// says a value cannot be null. They were warnings while the API types were
// optimistic, so as not to push people into deleting defensive code; #344
// typed the data as it is sent, so a redundant check now means the type was
// measured and the check is the thing to question. If a response can lack the
// field, say so in its type, and the check is no longer redundant.
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true,
"typeCheckHostBindings": true,
"extendedDiagnostics": {
"defaultCategory": "error",
"checks": {
"invalidBananaInBox": "error",
"uninvokedFunctionInEventBinding": "error",
"missingControlFlowDirective": "error",
"textAttributeNotBinding": "error",
"suffixNotSupported": "error",
"skipHydrationNotStatic": "error",
"unusedStandaloneImports": "error",
"nullishCoalescingNotNullable": "error",
"optionalChainNotNullable": "error"
}
}
}
}