@hailstails/hone 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ADOPTING.md +33 -7
- package/CHANGELOG.md +19 -0
- package/MIGRATING.md +31 -6
- package/README.md +64 -17
- package/api/audit.d.ts +7 -1
- package/api/audit.js +9 -1
- package/api/testing.js +36 -8
- package/chunks/{chunk-XE6RNNZB.js → chunk-5VXHQC4A.js} +1395 -1339
- package/chunks/{chunk-5X2BR42Y.js → chunk-FR4FASVM.js} +15 -24
- package/chunks/{chunk-RNXPEK2U.js → chunk-H4V72FCW.js} +2 -2
- package/chunks/chunk-MXSIQPCV.js +13 -0
- package/chunks/chunk-NA5L6PUE.js +15 -0
- package/chunks/{chunk-OVEQ37JQ.js → chunk-PL2PNPAR.js} +42 -17
- package/chunks/chunk-RWQ4UNKY.js +24 -0
- package/chunks/{chunk-OKQHVZLO.js → chunk-T32FOWZA.js} +1 -1
- package/chunks/{chunk-LHVFZMXD.js → chunk-Y2KPZDDV.js} +80 -20
- package/chunks/{chunk-YL6WR3QW.js → chunk-Y4SMWOD2.js} +1 -1
- package/chunks/chunk-YLZ73C7O.js +0 -0
- package/chunks/{chunk-NILRE23T.js → chunk-Z4UBS7WI.js} +1 -1
- package/core/check/tool-command.js +702 -22
- package/core/conformance/conformance-testing-types.d.ts +2 -0
- package/core/mechanism-port/runner-module-types.d.ts +2 -0
- package/core/rule-set-reader/authored-rule-set-types.d.ts +2 -0
- package/core/values/edition-types.d.ts +16 -0
- package/docs/extending.md +32 -10
- package/docs/output-contract.md +101 -15
- package/mechanisms/audit/CD-19/import-boundaries.js +3 -2
- package/mechanisms/audit/CD-27/piece.json +5 -1
- package/mechanisms/audit/CD-27/test-body-logic.js +55 -4
- package/mechanisms/audit/CD-3/compiler-overrides.js +193 -29
- package/mechanisms/audit/CD-3/piece.json +35 -7
- package/mechanisms/audit/CD-5/comments-directives.js +4 -3
- package/mechanisms/audit/runner/README.md +3 -2
- package/mechanisms/audit/runner/runner.js +45 -8
- package/mechanisms/audit/runner/walker-piece.d.ts +12 -0
- package/mechanisms/eslint/runner/runner.js +8 -4
- package/package.json +1 -1
- package/rules/CD-27/CHECKS.md +31 -1
- package/rules/CD-27/discipline.json +74 -0
- package/rules/CD-3/CHECKS.md +33 -9
- package/rules/CD-3/discipline.json +278 -0
|
@@ -45,6 +45,60 @@
|
|
|
45
45
|
"expectedLines": [
|
|
46
46
|
2
|
|
47
47
|
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "nullish fallback",
|
|
51
|
+
"fileName": "fallback.test.ts",
|
|
52
|
+
"source": "const given: number | undefined = undefined;\nconst expected = given ?? 1;\n",
|
|
53
|
+
"expectedLines": [
|
|
54
|
+
2
|
|
55
|
+
],
|
|
56
|
+
"edition": "2"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "logical operator",
|
|
60
|
+
"fileName": "logical.test.ts",
|
|
61
|
+
"source": "const ready = true;\nconst expected = ready && 1;\n",
|
|
62
|
+
"expectedLines": [
|
|
63
|
+
2
|
|
64
|
+
],
|
|
65
|
+
"edition": "2"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "optional call",
|
|
69
|
+
"fileName": "optional.test.ts",
|
|
70
|
+
"source": "const observers: { enter?: () => void } = {};\nobservers.enter?.();\n",
|
|
71
|
+
"expectedLines": [
|
|
72
|
+
2
|
|
73
|
+
],
|
|
74
|
+
"edition": "2"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "switch statement",
|
|
78
|
+
"fileName": "switch.test.ts",
|
|
79
|
+
"source": "const kind = \"a\";\nswitch (kind) {\n case \"a\":\n break;\n}\n",
|
|
80
|
+
"expectedLines": [
|
|
81
|
+
2
|
|
82
|
+
],
|
|
83
|
+
"edition": "2"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "computing namespace call",
|
|
87
|
+
"fileName": "serialise.test.ts",
|
|
88
|
+
"source": "const row = { id: 1 };\nconst expected = JSON.stringify(row);\n",
|
|
89
|
+
"expectedLines": [
|
|
90
|
+
2
|
|
91
|
+
],
|
|
92
|
+
"edition": "2"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "branching under the second edition",
|
|
96
|
+
"fileName": "branch-second.test.ts",
|
|
97
|
+
"source": "const ok = true;\nif (ok) {\n expect(ok).toBe(true);\n}\n",
|
|
98
|
+
"expectedLines": [
|
|
99
|
+
2
|
|
100
|
+
],
|
|
101
|
+
"edition": "2"
|
|
48
102
|
}
|
|
49
103
|
],
|
|
50
104
|
"allow": [
|
|
@@ -65,6 +119,26 @@
|
|
|
65
119
|
"fileName": "throws.test.ts",
|
|
66
120
|
"source": "throw new Error(\"bad\");\n",
|
|
67
121
|
"expectedLines": []
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"name": "nullish fallback under the first edition",
|
|
125
|
+
"fileName": "fallback.test.ts",
|
|
126
|
+
"source": "const given: number | undefined = undefined;\nconst expected = given ?? 1;\n",
|
|
127
|
+
"expectedLines": []
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"name": "hardcoded expectations under the second edition",
|
|
131
|
+
"fileName": "straight-second.test.ts",
|
|
132
|
+
"source": "const rows = [1, 2];\nexpect(rows).toEqual([1, 2]);\n",
|
|
133
|
+
"expectedLines": [],
|
|
134
|
+
"edition": "2"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "element access under the second edition",
|
|
138
|
+
"fileName": "index.test.ts",
|
|
139
|
+
"source": "const calls = [[1]];\nexpect(calls[0]).toEqual([1]);\n",
|
|
140
|
+
"expectedLines": [],
|
|
141
|
+
"edition": "2"
|
|
68
142
|
}
|
|
69
143
|
]
|
|
70
144
|
}
|
package/rules/CD-3/CHECKS.md
CHANGED
|
@@ -6,19 +6,30 @@ Read [the rule and its spirit](README.md) first. This page is the mechanics: how
|
|
|
6
6
|
|
|
7
7
|
| Clause | Mechanism | Checks |
|
|
8
8
|
| --- | --- | --- |
|
|
9
|
-
| `CD-3#strict` | audit | `strict` is set in a `tsconfig.json
|
|
10
|
-
| `CD-3#no-unchecked-indexed-access` | audit | `noUncheckedIndexedAccess` is set |
|
|
11
|
-
| `CD-3#exact-optional-property-types` | audit | `exactOptionalPropertyTypes` is set |
|
|
12
|
-
| `CD-3#no-implicit-override` | audit | `noImplicitOverride` is set |
|
|
13
|
-
| `CD-3#no-fallthrough-cases-in-switch` | audit | `noFallthroughCasesInSwitch` is set |
|
|
14
|
-
| `CD-3#no-property-access-from-index-signature` | audit | `noPropertyAccessFromIndexSignature` is set |
|
|
15
|
-
| `CD-3#use-unknown-in-catch-variables` | audit | `useUnknownInCatchVariables` is set |
|
|
9
|
+
| `CD-3#strict` | audit | `strict` is set in a `tsconfig.json`; edition 2 adds that it resolves to on |
|
|
10
|
+
| `CD-3#no-unchecked-indexed-access` | audit | `noUncheckedIndexedAccess` is set; edition 2 adds that it resolves to on |
|
|
11
|
+
| `CD-3#exact-optional-property-types` | audit | `exactOptionalPropertyTypes` is set; edition 2 adds that it resolves to on |
|
|
12
|
+
| `CD-3#no-implicit-override` | audit | `noImplicitOverride` is set; edition 2 adds that it resolves to on |
|
|
13
|
+
| `CD-3#no-fallthrough-cases-in-switch` | audit | `noFallthroughCasesInSwitch` is set; edition 2 adds that it resolves to on |
|
|
14
|
+
| `CD-3#no-property-access-from-index-signature` | audit | `noPropertyAccessFromIndexSignature` is set; edition 2 adds that it resolves to on |
|
|
15
|
+
| `CD-3#use-unknown-in-catch-variables` | audit | `useUnknownInCatchVariables` is set; edition 2 adds that it resolves to on |
|
|
16
16
|
|
|
17
17
|
## What the check flags
|
|
18
|
+
Each CD-3 clause has two editions. Edition 1 runs by default. Edition 2 also judges what each `tsconfig.json` inherits, and becomes the default in the next major release; see [Settings](#settings) to run it now.
|
|
19
|
+
|
|
20
|
+
Edition 1:
|
|
18
21
|
- `tsconfig.json` files, named exactly, at any depth. `tsconfig.base.json` and other names are not read. Generated folders such as `node_modules`, `dist`, `build` and `coverage` are skipped.
|
|
19
|
-
- For each selected clause, the matching option present in that file's `compilerOptions`. Presence is enough: `true` is flagged as well as `false
|
|
22
|
+
- For each selected clause, the matching option present in that file's `compilerOptions`. Presence is enough: `true` is flagged as well as `false`.
|
|
20
23
|
- Options in `extends`-ed files are not seen. A file that cannot be parsed, or whose root or `compilerOptions` is not an object, fails the run.
|
|
21
24
|
|
|
25
|
+
Edition 2 also flags, for each selected option a `tsconfig.json` does not set itself, an option its resolved configuration leaves off:
|
|
26
|
+
- The configuration is resolved by the repository's installed TypeScript, as `tsc` would resolve it: every file in the `extends` chain, a relative path, a package such as `@tsconfig/strictest` or a workspace package under `node_modules`, and an array of bases on TypeScript 5.0 or later, later bases winning. An option a base turns on and a later file turns off is off.
|
|
27
|
+
- `strict` and `useUnknownInCatchVariables` take TypeScript's defaults: TypeScript 6 treats `strict` as on when nothing sets it, and `useUnknownInCatchVariables` follows `strict` unless it is set.
|
|
28
|
+
- The finding names the file to edit. `= false, inherited from <base>` names each base that turns the option off. `= false, turned off in <file>` names this `tsconfig.json` when its own `"strict": false` turns `useUnknownInCatchVariables` off. `unset here and in <bases>` lists every file in the chain, none of which sets the option; `unset, and this file extends no base` says there is no chain.
|
|
29
|
+
- A configuration TypeScript cannot resolve, such as a base file that is missing, a package that is not installed, or bases that extend each other, is flagged for each selected option the file does not set as `unknown`, followed by TypeScript's own diagnostic. An `extends` holding `${configDir}` resolves however the installed TypeScript resolves it, and is flagged the same way when TypeScript cannot find it. Fix the chain, and the options are judged.
|
|
30
|
+
- The base files are judged through the `tsconfig.json` files that extend them, not on their own.
|
|
31
|
+
- A `tsconfig.json` from which TypeScript would compile no file is not judged on what it resolves to, since its options apply to no file. After resolving the chain, TypeScript has no `files` entry, and no `include` entry that names a path outright or a folder or pattern it would search. Examples: an empty `files` list, its own or inherited, with no `include`, such as the solution-style root with only `references` that `npm create vite` writes; an empty `include`; an `exclude` of every file. Any non-empty `include` that names a file or a folder is still judged, such as `"include": ["vite.config.ts"]` or `["src"]`, and so is a config that sets neither `files` nor `include`, since TypeScript then includes every file. An option a skipped file sets itself is still flagged, as in edition 1. The configs it references are not judged through it; only files named `tsconfig.json` are read.
|
|
32
|
+
|
|
22
33
|
## Example violation
|
|
23
34
|
```json
|
|
24
35
|
{ "compilerOptions": { "strict": false } }
|
|
@@ -28,7 +39,20 @@ Read [the rule and its spirit](README.md) first. This page is the mechanics: how
|
|
|
28
39
|
```json
|
|
29
40
|
{ "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "dist" } }
|
|
30
41
|
```
|
|
31
|
-
Put the flags in a shared base file that is not named `tsconfig.json`, and leave them out of every `tsconfig.json`.
|
|
42
|
+
Put the flags in a shared base file that is not named `tsconfig.json`, and leave them out of every `tsconfig.json`. Under edition 1, that the base file turns them on is left to review. Under edition 2 the check reads the base: turn every selected flag on in it.
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{ "compilerOptions": { "strict": true, "noUncheckedIndexedAccess": true, "exactOptionalPropertyTypes": true, "noImplicitOverride": true, "noFallthroughCasesInSwitch": true, "noPropertyAccessFromIndexSignature": true, "useUnknownInCatchVariables": true } }
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Settings
|
|
49
|
+
- `edition`: the edition this clause runs, `"1"` or `"2"`. Without it, the clause runs edition 1, or the latest edition when `checkEditions` in `disciplines.json` is `"latest"`.
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
"clauseSettings": {
|
|
53
|
+
"CD-3#no-unchecked-indexed-access": { "edition": "2" }
|
|
54
|
+
}
|
|
55
|
+
```
|
|
32
56
|
|
|
33
57
|
## Exceptions
|
|
34
58
|
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a package must set the flag itself. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
@@ -29,6 +29,24 @@
|
|
|
29
29
|
"expectedLines": [
|
|
30
30
|
1
|
|
31
31
|
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "strict set to false under the second edition",
|
|
35
|
+
"fileName": "packages/a/tsconfig.json",
|
|
36
|
+
"source": "{\n \"compilerOptions\": {\n \"strict\": false\n }\n}\n",
|
|
37
|
+
"expectedLines": [
|
|
38
|
+
1
|
|
39
|
+
],
|
|
40
|
+
"edition": "2"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "a base that cannot be read",
|
|
44
|
+
"fileName": "packages/a/tsconfig.json",
|
|
45
|
+
"source": "{ \"extends\": \"../../tsconfig.base.json\", \"compilerOptions\": { \"target\": \"ESNext\" } }\n",
|
|
46
|
+
"expectedLines": [
|
|
47
|
+
1
|
|
48
|
+
],
|
|
49
|
+
"edition": "2"
|
|
32
50
|
}
|
|
33
51
|
],
|
|
34
52
|
"allow": [
|
|
@@ -49,6 +67,20 @@
|
|
|
49
67
|
"fileName": "tsconfig.base.json",
|
|
50
68
|
"source": "{ \"compilerOptions\": { \"strict\": true } }\n",
|
|
51
69
|
"expectedLines": []
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "tsconfig.base.json is not read under the second edition",
|
|
73
|
+
"fileName": "tsconfig.base.json",
|
|
74
|
+
"source": "{ \"compilerOptions\": { \"strict\": false } }\n",
|
|
75
|
+
"expectedLines": [],
|
|
76
|
+
"edition": "2"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "a solution-style config that compiles no files",
|
|
80
|
+
"fileName": "tsconfig.json",
|
|
81
|
+
"source": "{ \"files\": [], \"references\": [{ \"path\": \"./tsconfig.app.json\" }, { \"path\": \"./tsconfig.node.json\" }] }\n",
|
|
82
|
+
"expectedLines": [],
|
|
83
|
+
"edition": "2"
|
|
52
84
|
}
|
|
53
85
|
]
|
|
54
86
|
}
|
|
@@ -80,6 +112,33 @@
|
|
|
80
112
|
"expectedLines": [
|
|
81
113
|
1
|
|
82
114
|
]
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"name": "noUncheckedIndexedAccess set to false under the second edition",
|
|
118
|
+
"fileName": "packages/a/tsconfig.json",
|
|
119
|
+
"source": "{\n \"compilerOptions\": {\n \"noUncheckedIndexedAccess\": false\n }\n}\n",
|
|
120
|
+
"expectedLines": [
|
|
121
|
+
1
|
|
122
|
+
],
|
|
123
|
+
"edition": "2"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "a base that cannot be read",
|
|
127
|
+
"fileName": "packages/a/tsconfig.json",
|
|
128
|
+
"source": "{ \"extends\": \"../../tsconfig.base.json\", \"compilerOptions\": { \"target\": \"ESNext\" } }\n",
|
|
129
|
+
"expectedLines": [
|
|
130
|
+
1
|
|
131
|
+
],
|
|
132
|
+
"edition": "2"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"name": "noUncheckedIndexedAccess unset with no base",
|
|
136
|
+
"fileName": "packages/b/tsconfig.json",
|
|
137
|
+
"source": "{ \"compilerOptions\": { \"outDir\": \"dist\", \"target\": \"ESNext\" } }\n",
|
|
138
|
+
"expectedLines": [
|
|
139
|
+
1
|
|
140
|
+
],
|
|
141
|
+
"edition": "2"
|
|
83
142
|
}
|
|
84
143
|
],
|
|
85
144
|
"allow": [
|
|
@@ -100,6 +159,20 @@
|
|
|
100
159
|
"fileName": "tsconfig.base.json",
|
|
101
160
|
"source": "{ \"compilerOptions\": { \"noUncheckedIndexedAccess\": true } }\n",
|
|
102
161
|
"expectedLines": []
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"name": "tsconfig.base.json is not read under the second edition",
|
|
165
|
+
"fileName": "tsconfig.base.json",
|
|
166
|
+
"source": "{ \"compilerOptions\": { \"noUncheckedIndexedAccess\": false } }\n",
|
|
167
|
+
"expectedLines": [],
|
|
168
|
+
"edition": "2"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "a solution-style config that compiles no files",
|
|
172
|
+
"fileName": "tsconfig.json",
|
|
173
|
+
"source": "{ \"files\": [], \"references\": [{ \"path\": \"./tsconfig.app.json\" }, { \"path\": \"./tsconfig.node.json\" }] }\n",
|
|
174
|
+
"expectedLines": [],
|
|
175
|
+
"edition": "2"
|
|
103
176
|
}
|
|
104
177
|
]
|
|
105
178
|
}
|
|
@@ -131,6 +204,33 @@
|
|
|
131
204
|
"expectedLines": [
|
|
132
205
|
1
|
|
133
206
|
]
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"name": "exactOptionalPropertyTypes set to false under the second edition",
|
|
210
|
+
"fileName": "packages/a/tsconfig.json",
|
|
211
|
+
"source": "{\n \"compilerOptions\": {\n \"exactOptionalPropertyTypes\": false\n }\n}\n",
|
|
212
|
+
"expectedLines": [
|
|
213
|
+
1
|
|
214
|
+
],
|
|
215
|
+
"edition": "2"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"name": "a base that cannot be read",
|
|
219
|
+
"fileName": "packages/a/tsconfig.json",
|
|
220
|
+
"source": "{ \"extends\": \"../../tsconfig.base.json\", \"compilerOptions\": { \"target\": \"ESNext\" } }\n",
|
|
221
|
+
"expectedLines": [
|
|
222
|
+
1
|
|
223
|
+
],
|
|
224
|
+
"edition": "2"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"name": "exactOptionalPropertyTypes unset with no base",
|
|
228
|
+
"fileName": "packages/b/tsconfig.json",
|
|
229
|
+
"source": "{ \"compilerOptions\": { \"outDir\": \"dist\", \"target\": \"ESNext\" } }\n",
|
|
230
|
+
"expectedLines": [
|
|
231
|
+
1
|
|
232
|
+
],
|
|
233
|
+
"edition": "2"
|
|
134
234
|
}
|
|
135
235
|
],
|
|
136
236
|
"allow": [
|
|
@@ -151,6 +251,20 @@
|
|
|
151
251
|
"fileName": "tsconfig.base.json",
|
|
152
252
|
"source": "{ \"compilerOptions\": { \"exactOptionalPropertyTypes\": true } }\n",
|
|
153
253
|
"expectedLines": []
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"name": "tsconfig.base.json is not read under the second edition",
|
|
257
|
+
"fileName": "tsconfig.base.json",
|
|
258
|
+
"source": "{ \"compilerOptions\": { \"exactOptionalPropertyTypes\": false } }\n",
|
|
259
|
+
"expectedLines": [],
|
|
260
|
+
"edition": "2"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"name": "a solution-style config that compiles no files",
|
|
264
|
+
"fileName": "tsconfig.json",
|
|
265
|
+
"source": "{ \"files\": [], \"references\": [{ \"path\": \"./tsconfig.app.json\" }, { \"path\": \"./tsconfig.node.json\" }] }\n",
|
|
266
|
+
"expectedLines": [],
|
|
267
|
+
"edition": "2"
|
|
154
268
|
}
|
|
155
269
|
]
|
|
156
270
|
}
|
|
@@ -182,6 +296,33 @@
|
|
|
182
296
|
"expectedLines": [
|
|
183
297
|
1
|
|
184
298
|
]
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"name": "noImplicitOverride set to false under the second edition",
|
|
302
|
+
"fileName": "packages/a/tsconfig.json",
|
|
303
|
+
"source": "{\n \"compilerOptions\": {\n \"noImplicitOverride\": false\n }\n}\n",
|
|
304
|
+
"expectedLines": [
|
|
305
|
+
1
|
|
306
|
+
],
|
|
307
|
+
"edition": "2"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"name": "a base that cannot be read",
|
|
311
|
+
"fileName": "packages/a/tsconfig.json",
|
|
312
|
+
"source": "{ \"extends\": \"../../tsconfig.base.json\", \"compilerOptions\": { \"target\": \"ESNext\" } }\n",
|
|
313
|
+
"expectedLines": [
|
|
314
|
+
1
|
|
315
|
+
],
|
|
316
|
+
"edition": "2"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"name": "noImplicitOverride unset with no base",
|
|
320
|
+
"fileName": "packages/b/tsconfig.json",
|
|
321
|
+
"source": "{ \"compilerOptions\": { \"outDir\": \"dist\", \"target\": \"ESNext\" } }\n",
|
|
322
|
+
"expectedLines": [
|
|
323
|
+
1
|
|
324
|
+
],
|
|
325
|
+
"edition": "2"
|
|
185
326
|
}
|
|
186
327
|
],
|
|
187
328
|
"allow": [
|
|
@@ -202,6 +343,20 @@
|
|
|
202
343
|
"fileName": "tsconfig.base.json",
|
|
203
344
|
"source": "{ \"compilerOptions\": { \"noImplicitOverride\": true } }\n",
|
|
204
345
|
"expectedLines": []
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"name": "tsconfig.base.json is not read under the second edition",
|
|
349
|
+
"fileName": "tsconfig.base.json",
|
|
350
|
+
"source": "{ \"compilerOptions\": { \"noImplicitOverride\": false } }\n",
|
|
351
|
+
"expectedLines": [],
|
|
352
|
+
"edition": "2"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"name": "a solution-style config that compiles no files",
|
|
356
|
+
"fileName": "tsconfig.json",
|
|
357
|
+
"source": "{ \"files\": [], \"references\": [{ \"path\": \"./tsconfig.app.json\" }, { \"path\": \"./tsconfig.node.json\" }] }\n",
|
|
358
|
+
"expectedLines": [],
|
|
359
|
+
"edition": "2"
|
|
205
360
|
}
|
|
206
361
|
]
|
|
207
362
|
}
|
|
@@ -233,6 +388,33 @@
|
|
|
233
388
|
"expectedLines": [
|
|
234
389
|
1
|
|
235
390
|
]
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
"name": "noFallthroughCasesInSwitch set to false under the second edition",
|
|
394
|
+
"fileName": "packages/a/tsconfig.json",
|
|
395
|
+
"source": "{\n \"compilerOptions\": {\n \"noFallthroughCasesInSwitch\": false\n }\n}\n",
|
|
396
|
+
"expectedLines": [
|
|
397
|
+
1
|
|
398
|
+
],
|
|
399
|
+
"edition": "2"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"name": "a base that cannot be read",
|
|
403
|
+
"fileName": "packages/a/tsconfig.json",
|
|
404
|
+
"source": "{ \"extends\": \"../../tsconfig.base.json\", \"compilerOptions\": { \"target\": \"ESNext\" } }\n",
|
|
405
|
+
"expectedLines": [
|
|
406
|
+
1
|
|
407
|
+
],
|
|
408
|
+
"edition": "2"
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
"name": "noFallthroughCasesInSwitch unset with no base",
|
|
412
|
+
"fileName": "packages/b/tsconfig.json",
|
|
413
|
+
"source": "{ \"compilerOptions\": { \"outDir\": \"dist\", \"target\": \"ESNext\" } }\n",
|
|
414
|
+
"expectedLines": [
|
|
415
|
+
1
|
|
416
|
+
],
|
|
417
|
+
"edition": "2"
|
|
236
418
|
}
|
|
237
419
|
],
|
|
238
420
|
"allow": [
|
|
@@ -253,6 +435,20 @@
|
|
|
253
435
|
"fileName": "tsconfig.base.json",
|
|
254
436
|
"source": "{ \"compilerOptions\": { \"noFallthroughCasesInSwitch\": true } }\n",
|
|
255
437
|
"expectedLines": []
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"name": "tsconfig.base.json is not read under the second edition",
|
|
441
|
+
"fileName": "tsconfig.base.json",
|
|
442
|
+
"source": "{ \"compilerOptions\": { \"noFallthroughCasesInSwitch\": false } }\n",
|
|
443
|
+
"expectedLines": [],
|
|
444
|
+
"edition": "2"
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
"name": "a solution-style config that compiles no files",
|
|
448
|
+
"fileName": "tsconfig.json",
|
|
449
|
+
"source": "{ \"files\": [], \"references\": [{ \"path\": \"./tsconfig.app.json\" }, { \"path\": \"./tsconfig.node.json\" }] }\n",
|
|
450
|
+
"expectedLines": [],
|
|
451
|
+
"edition": "2"
|
|
256
452
|
}
|
|
257
453
|
]
|
|
258
454
|
}
|
|
@@ -284,6 +480,33 @@
|
|
|
284
480
|
"expectedLines": [
|
|
285
481
|
1
|
|
286
482
|
]
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"name": "noPropertyAccessFromIndexSignature set to false under the second edition",
|
|
486
|
+
"fileName": "packages/a/tsconfig.json",
|
|
487
|
+
"source": "{\n \"compilerOptions\": {\n \"noPropertyAccessFromIndexSignature\": false\n }\n}\n",
|
|
488
|
+
"expectedLines": [
|
|
489
|
+
1
|
|
490
|
+
],
|
|
491
|
+
"edition": "2"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"name": "a base that cannot be read",
|
|
495
|
+
"fileName": "packages/a/tsconfig.json",
|
|
496
|
+
"source": "{ \"extends\": \"../../tsconfig.base.json\", \"compilerOptions\": { \"target\": \"ESNext\" } }\n",
|
|
497
|
+
"expectedLines": [
|
|
498
|
+
1
|
|
499
|
+
],
|
|
500
|
+
"edition": "2"
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
"name": "noPropertyAccessFromIndexSignature unset with no base",
|
|
504
|
+
"fileName": "packages/b/tsconfig.json",
|
|
505
|
+
"source": "{ \"compilerOptions\": { \"outDir\": \"dist\", \"target\": \"ESNext\" } }\n",
|
|
506
|
+
"expectedLines": [
|
|
507
|
+
1
|
|
508
|
+
],
|
|
509
|
+
"edition": "2"
|
|
287
510
|
}
|
|
288
511
|
],
|
|
289
512
|
"allow": [
|
|
@@ -304,6 +527,20 @@
|
|
|
304
527
|
"fileName": "tsconfig.base.json",
|
|
305
528
|
"source": "{ \"compilerOptions\": { \"noPropertyAccessFromIndexSignature\": true } }\n",
|
|
306
529
|
"expectedLines": []
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"name": "tsconfig.base.json is not read under the second edition",
|
|
533
|
+
"fileName": "tsconfig.base.json",
|
|
534
|
+
"source": "{ \"compilerOptions\": { \"noPropertyAccessFromIndexSignature\": false } }\n",
|
|
535
|
+
"expectedLines": [],
|
|
536
|
+
"edition": "2"
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
"name": "a solution-style config that compiles no files",
|
|
540
|
+
"fileName": "tsconfig.json",
|
|
541
|
+
"source": "{ \"files\": [], \"references\": [{ \"path\": \"./tsconfig.app.json\" }, { \"path\": \"./tsconfig.node.json\" }] }\n",
|
|
542
|
+
"expectedLines": [],
|
|
543
|
+
"edition": "2"
|
|
307
544
|
}
|
|
308
545
|
]
|
|
309
546
|
}
|
|
@@ -335,6 +572,33 @@
|
|
|
335
572
|
"expectedLines": [
|
|
336
573
|
1
|
|
337
574
|
]
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
"name": "useUnknownInCatchVariables set to false under the second edition",
|
|
578
|
+
"fileName": "packages/a/tsconfig.json",
|
|
579
|
+
"source": "{\n \"compilerOptions\": {\n \"useUnknownInCatchVariables\": false\n }\n}\n",
|
|
580
|
+
"expectedLines": [
|
|
581
|
+
1
|
|
582
|
+
],
|
|
583
|
+
"edition": "2"
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
"name": "a base that cannot be read",
|
|
587
|
+
"fileName": "packages/a/tsconfig.json",
|
|
588
|
+
"source": "{ \"extends\": \"../../tsconfig.base.json\", \"compilerOptions\": { \"target\": \"ESNext\" } }\n",
|
|
589
|
+
"expectedLines": [
|
|
590
|
+
1
|
|
591
|
+
],
|
|
592
|
+
"edition": "2"
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
"name": "turned off by strict set to false in the same file",
|
|
596
|
+
"fileName": "packages/b/tsconfig.json",
|
|
597
|
+
"source": "{ \"compilerOptions\": { \"strict\": false } }\n",
|
|
598
|
+
"expectedLines": [
|
|
599
|
+
1
|
|
600
|
+
],
|
|
601
|
+
"edition": "2"
|
|
338
602
|
}
|
|
339
603
|
],
|
|
340
604
|
"allow": [
|
|
@@ -355,6 +619,20 @@
|
|
|
355
619
|
"fileName": "tsconfig.base.json",
|
|
356
620
|
"source": "{ \"compilerOptions\": { \"useUnknownInCatchVariables\": true } }\n",
|
|
357
621
|
"expectedLines": []
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
"name": "tsconfig.base.json is not read under the second edition",
|
|
625
|
+
"fileName": "tsconfig.base.json",
|
|
626
|
+
"source": "{ \"compilerOptions\": { \"useUnknownInCatchVariables\": false } }\n",
|
|
627
|
+
"expectedLines": [],
|
|
628
|
+
"edition": "2"
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
"name": "a solution-style config that compiles no files",
|
|
632
|
+
"fileName": "tsconfig.json",
|
|
633
|
+
"source": "{ \"files\": [], \"references\": [{ \"path\": \"./tsconfig.app.json\" }, { \"path\": \"./tsconfig.node.json\" }] }\n",
|
|
634
|
+
"expectedLines": [],
|
|
635
|
+
"edition": "2"
|
|
358
636
|
}
|
|
359
637
|
]
|
|
360
638
|
}
|