@stateward/core 1.2.2 → 1.3.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/dist/analyses.d.ts +37 -0
- package/dist/analyses.js +57 -0
- package/dist/backend/program-record.d.ts +7 -0
- package/dist/backend/typescript6.d.ts +33 -32
- package/dist/backend/typescript6.js +1438 -139
- package/dist/baseline.d.ts +1 -1
- package/dist/baseline.js +14 -10
- package/dist/cache.d.ts +74 -4
- package/dist/cache.js +211 -37
- package/dist/checker.d.ts +6 -1
- package/dist/checker.js +10 -0
- package/dist/class-id.d.ts +34 -0
- package/dist/class-id.js +93 -0
- package/dist/code-text.d.ts +8 -0
- package/dist/code-text.js +66 -0
- package/dist/config-file.js +7 -5
- package/dist/config.d.ts +10 -2
- package/dist/config.js +490 -48
- package/dist/define.d.ts +8 -2
- package/dist/disk-cache.d.ts +2 -0
- package/dist/disk-cache.js +77 -11
- package/dist/engine.d.ts +33 -1
- package/dist/engine.js +344 -24
- package/dist/fact-lines.d.ts +31 -0
- package/dist/fact-lines.js +197 -0
- package/dist/facts-versions.d.ts +27 -0
- package/dist/facts-versions.js +99 -0
- package/dist/fixes.js +4 -1
- package/dist/ignores.d.ts +11 -0
- package/dist/ignores.js +74 -27
- package/dist/implementation.d.ts +0 -6
- package/dist/implementation.js +0 -17
- package/dist/index.d.ts +8 -9
- package/dist/index.js +10 -7
- package/dist/internal.d.ts +7 -4
- package/dist/internal.js +5 -3
- package/dist/lazy.d.ts +8 -1
- package/dist/lazy.js +27 -2
- package/dist/ledger.d.ts +2 -2
- package/dist/ledger.js +2 -2
- package/dist/off-by-default.d.ts +13 -0
- package/dist/off-by-default.js +15 -0
- package/dist/options.d.ts +21 -5
- package/dist/options.js +22 -7
- package/dist/package-facts.d.ts +211 -17
- package/dist/package-facts.js +520 -38
- package/dist/plan.d.ts +1 -1
- package/dist/plan.js +7 -2
- package/dist/release.d.ts +12 -21
- package/dist/release.js +26 -38
- package/dist/renamed.d.ts +22 -3
- package/dist/renamed.js +50 -16
- package/dist/rollout.js +7 -4
- package/dist/severity.d.ts +1 -1
- package/dist/severity.js +17 -3
- package/dist/test-runner.d.ts +18 -0
- package/dist/test-runner.js +483 -0
- package/dist/testing.d.ts +3 -3
- package/dist/testing.js +5 -5
- package/dist/timing.d.ts +8 -0
- package/dist/timing.js +35 -1
- package/dist/types.d.ts +692 -19
- package/dist/unread.d.ts +90 -0
- package/dist/unread.js +405 -0
- package/dist/vocabulary.d.ts +1 -1
- package/dist/vocabulary.js +1 -1
- package/package.json +4 -2
package/dist/types.d.ts
CHANGED
|
@@ -151,6 +151,10 @@ export type Finding = {
|
|
|
151
151
|
* checked" at this place, whatever `shown` says.
|
|
152
152
|
*/
|
|
153
153
|
guarantees?: readonly string[];
|
|
154
|
+
/** The `facts` lines that would decide it, each a package call no line states. */
|
|
155
|
+
needs?: readonly FactNeed[];
|
|
156
|
+
/** The package calls that decide it and that no `facts` key can name, with why. */
|
|
157
|
+
unnamed?: readonly UnnamedFact[];
|
|
154
158
|
}
|
|
155
159
|
/** A rule threw: the check is incomplete, so it fails CI. */
|
|
156
160
|
| {
|
|
@@ -165,13 +169,26 @@ export type Json = null | boolean | number | string | readonly Json[] | {
|
|
|
165
169
|
};
|
|
166
170
|
/**
|
|
167
171
|
* Where a rule sits in its pack: `core` carries the guarantee, `coverage` finds
|
|
168
|
-
* code outside the pack's standard, `
|
|
172
|
+
* code outside the pack's standard, `convention` checks a team convention rather than a fact
|
|
173
|
+
* about the code (off in every preset; on with the config's `conventions: true` or by its id),
|
|
174
|
+
* `addon` is opt-in by name.
|
|
169
175
|
*/
|
|
170
176
|
export type RuleTier = (typeof RULE_TIERS)[number];
|
|
171
177
|
export type BooleanOption = {
|
|
172
178
|
kind: "boolean";
|
|
173
179
|
default: boolean;
|
|
174
180
|
description: string;
|
|
181
|
+
/**
|
|
182
|
+
* The option turns on a check of a team convention rather than a fact about the code: it is
|
|
183
|
+
* true when the config sets `conventions: true` and does not set the option itself. Only on an
|
|
184
|
+
* option whose `default` is false.
|
|
185
|
+
*/
|
|
186
|
+
convention?: true;
|
|
187
|
+
/**
|
|
188
|
+
* Set by stateward from the config, never by it (`asked`: the config names the rule): it is
|
|
189
|
+
* not documented, and a config that sets it gets an error.
|
|
190
|
+
*/
|
|
191
|
+
internal?: true;
|
|
175
192
|
};
|
|
176
193
|
export type NumberOption = {
|
|
177
194
|
kind: "number";
|
|
@@ -251,6 +268,13 @@ export type RuleInfo<S extends OptionSpecs = OptionSpecs, G extends string = str
|
|
|
251
268
|
group: G;
|
|
252
269
|
/** The add-on this rule belongs to (kebab-case); present exactly when `tier` is "addon". */
|
|
253
270
|
addon?: string;
|
|
271
|
+
/**
|
|
272
|
+
* Only for tier `addon`: the rule was on by default until release `since`, and was made an
|
|
273
|
+
* add-on because too few of its findings were right on real projects. Its page says so
|
|
274
|
+
* (`offByDefaultText`), and a config that turns it on in `rules` gets a note with the same
|
|
275
|
+
* figure.
|
|
276
|
+
*/
|
|
277
|
+
offByDefault?: OffByDefault;
|
|
254
278
|
/**
|
|
255
279
|
* Add-ons (kebab-case) that widen what this core or coverage rule checks. The rule reads which
|
|
256
280
|
* are on from `FileContext.addons`; they count as add-ons of the plugin, so a config may list them.
|
|
@@ -258,6 +282,12 @@ export type RuleInfo<S extends OptionSpecs = OptionSpecs, G extends string = str
|
|
|
258
282
|
widenedBy?: readonly string[];
|
|
259
283
|
/** A guess, never an error: its severity is capped at "warning" unless the config sets it. */
|
|
260
284
|
heuristic?: true;
|
|
285
|
+
/**
|
|
286
|
+
* Only for tier `convention`: the convention is the project's to state, and the rule reads only
|
|
287
|
+
* what the project states, so it reports nothing until the project states something. It is on
|
|
288
|
+
* like a core rule, without `conventions: true`; the config can still turn it off by its id.
|
|
289
|
+
*/
|
|
290
|
+
whenStated?: true;
|
|
261
291
|
/**
|
|
262
292
|
* The rule reads JSDoc in TypeScript files (`@throws`). Files are parsed as tsc parses them,
|
|
263
293
|
* without the JSDoc of TypeScript files, unless a rule that is on asks for it: parsing it costs
|
|
@@ -308,6 +338,13 @@ export type RuleInfo<S extends OptionSpecs = OptionSpecs, G extends string = str
|
|
|
308
338
|
*/
|
|
309
339
|
proves?: RuleProves;
|
|
310
340
|
};
|
|
341
|
+
/** Why a rule is off by default: the release that made it so, and its findings checked on real projects. */
|
|
342
|
+
export type OffByDefault = {
|
|
343
|
+
/** The release that made it off by default: `"1.3"`. */
|
|
344
|
+
readonly since: string;
|
|
345
|
+
readonly right: number;
|
|
346
|
+
readonly checked: number;
|
|
347
|
+
};
|
|
311
348
|
/** A library a rule reads by its types: its name as people say it, and the modules that give them. */
|
|
312
349
|
export type LibraryTypes = {
|
|
313
350
|
/** As people say it: "React". */
|
|
@@ -324,6 +361,8 @@ export type Literal = {
|
|
|
324
361
|
value: string | number | boolean | null | undefined;
|
|
325
362
|
label: string;
|
|
326
363
|
};
|
|
364
|
+
/** A type that is one of TypeScript's own, read from the type's flags (`TypeQueries.builtinTypeOf`). */
|
|
365
|
+
export type BuiltinType = "any" | "unknown" | "never" | "void" | "undefined" | "null";
|
|
327
366
|
/**
|
|
328
367
|
* A test that narrows a reference by the kind of value it holds rather than by a literal:
|
|
329
368
|
* `typeof x === "string"`, `"p" in x`, `x instanceof C` and a call to a user type guard.
|
|
@@ -427,7 +466,7 @@ export type RuleProves = {
|
|
|
427
466
|
/** Traits a value, property or parameter states by its written type (`Owned<T>`). */
|
|
428
467
|
readonly traits?: readonly string[];
|
|
429
468
|
/**
|
|
430
|
-
* Traits a function states by its written return type (`():
|
|
469
|
+
* Traits a function states by its written return type (`(): Marker<…>`, or a promise of one): the
|
|
431
470
|
* function is the stated declaration, and each call a reference to it.
|
|
432
471
|
*/
|
|
433
472
|
readonly returns?: readonly string[];
|
|
@@ -468,7 +507,7 @@ export type StatedReference = {
|
|
|
468
507
|
readonly declaration: string;
|
|
469
508
|
/** The declaration as a symbol: `declarationOf` finds it. */
|
|
470
509
|
readonly symbol: SymbolRef;
|
|
471
|
-
/** The declaration's name, and its marker type as written (`
|
|
510
|
+
/** The declaration's name, and its marker type as written (`Owned`). */
|
|
472
511
|
readonly name: string;
|
|
473
512
|
readonly marker: string;
|
|
474
513
|
/** The trait the reference is listed for: one entry per trait the declaration states. */
|
|
@@ -562,6 +601,45 @@ export type TypeQueries = {
|
|
|
562
601
|
* through the program, so a renamed package changes the dependency fingerprints.
|
|
563
602
|
*/
|
|
564
603
|
packageOf(file: string): string | undefined;
|
|
604
|
+
/**
|
|
605
|
+
* What a `facts` key names (0041): `module` resolved as an import of it from the project would
|
|
606
|
+
* (`node:path`, `typeorm`, `@acme/kit/lib/x`), then the dotted `name` through its exports and
|
|
607
|
+
* their members (`Repository.find`), to the declarations of the symbol it reaches. Two keys
|
|
608
|
+
* that resolve to one symbol name the same declarations, however the module's types are
|
|
609
|
+
* written.
|
|
610
|
+
*/
|
|
611
|
+
factTarget(module: string, name: string): FactTarget;
|
|
612
|
+
/**
|
|
613
|
+
* The names `factTarget` resolves in `module` up to two levels deep (`join`, `Repository.find`),
|
|
614
|
+
* shortest first: what a "did you mean" chooses from.
|
|
615
|
+
*/
|
|
616
|
+
factNames(module: string): readonly string[];
|
|
617
|
+
/**
|
|
618
|
+
* `factTarget` in reverse: the shortest name in `module` that resolves to `declaration`, so a
|
|
619
|
+
* hint's `facts` line names what the call calls. The names tried are the last parts of the
|
|
620
|
+
* declaration's own path in its types (`join`, then `PlatformPath.join`), then `default`, each
|
|
621
|
+
* resolved forward; undefined when none resolves to it.
|
|
622
|
+
*/
|
|
623
|
+
factNameOf(module: string, declaration: ts.Node): string | undefined;
|
|
624
|
+
/**
|
|
625
|
+
* The module a `facts` key for `declaration`, a declaration outside the project, is written
|
|
626
|
+
* from, and its name there (`factNameOf`), as `reference` reaches it: the module the project
|
|
627
|
+
* imports it from, as written (a deep path stays deep), followed through the project's own
|
|
628
|
+
* re-exports and aliases to the first module outside the project; else a module the project's
|
|
629
|
+
* files import, the module or package that declares it, or a module of its package the program
|
|
630
|
+
* loads (a global such as `Buffer`, named from a module that exports it). `platform`: the
|
|
631
|
+
* module's types are the platform's. `unnamed` when no such module names it.
|
|
632
|
+
*/
|
|
633
|
+
factModuleOf(declaration: ts.Node, reference: ts.Node): FactModule;
|
|
634
|
+
/**
|
|
635
|
+
* The class a module of a package exports under `name` (`QueryFailedError` of `typeorm`), as
|
|
636
|
+
* the project would import it: its declaration, from the package's types. Undefined when the
|
|
637
|
+
* module's types are not in the program or export no class by that name.
|
|
638
|
+
*/
|
|
639
|
+
exportedClassOf(module: string, name: string): {
|
|
640
|
+
file: string;
|
|
641
|
+
node: ts.Node;
|
|
642
|
+
} | undefined;
|
|
565
643
|
/**
|
|
566
644
|
* The finite literal union of the node's type (a type parameter is widened to its constraint),
|
|
567
645
|
* sorted by label so the order does not depend on what TypeScript checked earlier.
|
|
@@ -586,6 +664,8 @@ export type TypeQueries = {
|
|
|
586
664
|
canBeUndefined(node: ts.Node): boolean;
|
|
587
665
|
/** Whether the type of an expression includes `null`; `any` and `unknown` count as yes. */
|
|
588
666
|
canBeNull(node: ts.Node): boolean;
|
|
667
|
+
/** Whether the type of an expression includes `false` (`boolean` does); `any` and `unknown` count as yes. */
|
|
668
|
+
canBeFalse(node: ts.Node): boolean;
|
|
589
669
|
/**
|
|
590
670
|
* Whether `propertyName` discriminates the type of the object expression (a type parameter
|
|
591
671
|
* widened to its constraint): the type is a union, every member is an object type (an
|
|
@@ -626,6 +706,13 @@ export type TypeQueries = {
|
|
|
626
706
|
* nothing gives one.
|
|
627
707
|
*/
|
|
628
708
|
expectsPromiseReturn(node: ts.Expression): boolean;
|
|
709
|
+
/**
|
|
710
|
+
* Whether the type the surrounding code expects for an expression is a function that may return
|
|
711
|
+
* a function: some call signature's return type has a callable member (`() => void | Destructor`,
|
|
712
|
+
* as an effect callback is typed). What such a function returns may be called later, as a
|
|
713
|
+
* cleanup, by code stateward does not read. False when nothing gives one.
|
|
714
|
+
*/
|
|
715
|
+
expectsCallableReturn(node: ts.Expression): boolean;
|
|
629
716
|
/**
|
|
630
717
|
* Whether argument `argumentIndex` of the call goes to a parameter that the called function's
|
|
631
718
|
* declaration types as the `never` keyword. A rest parameter or a missing declaration is false.
|
|
@@ -664,6 +751,13 @@ export type TypeQueries = {
|
|
|
664
751
|
* with `contextual`, of the type the surrounding code expects for the expression. Undefined when
|
|
665
752
|
* the type does not state the trait; `"not-finite"` when the property's type is not literals.
|
|
666
753
|
*/
|
|
754
|
+
/**
|
|
755
|
+
* The literal values of an optional marker property on the type of a node, sorted: `"startsAt"`
|
|
756
|
+
* and `"endsAt"` for `LocalTimestamp<"startsAt" | "endsAt">` declaring
|
|
757
|
+
* `readonly __localTimestamp?: K`. Undefined when no member of the type has the property as an
|
|
758
|
+
* optional property; `"not-finite"` when its type is not literals.
|
|
759
|
+
*/
|
|
760
|
+
markerValuesOf(node: ts.Node, property: string): readonly Literal[] | "not-finite" | undefined;
|
|
667
761
|
guaranteeValuesOf(target: ts.Node | SymbolRef, name: string, contextual?: boolean): readonly Literal[] | "not-finite" | undefined;
|
|
668
762
|
/**
|
|
669
763
|
* How a value is disposed when its type is a standard `Disposable` or `AsyncDisposable`: it has
|
|
@@ -800,6 +894,15 @@ export type TypeQueries = {
|
|
|
800
894
|
* are assignable to everything and so prove nothing.
|
|
801
895
|
*/
|
|
802
896
|
isAssignableWithoutNullish(from: ts.Node, to: ts.Node): boolean;
|
|
897
|
+
/**
|
|
898
|
+
* Whether a value of `output`, and `undefined` too when `orUndefined`, is assignable to the
|
|
899
|
+
* declared type of `target` (a declaration's name). `output` is a type node, read awaited (a
|
|
900
|
+
* `Promise<T>` gives `T`), or one of TypeScript's own types by name; `"array"` is an array of any
|
|
901
|
+
* items. A brand on the target (`string & { __brand: "Uuid" }`) counts as the type it brands:
|
|
902
|
+
* it adds no runtime value. Undefined when the type node is `any` or `unknown`, which states
|
|
903
|
+
* nothing.
|
|
904
|
+
*/
|
|
905
|
+
valueAssignableTo(output: ts.TypeNode | "string" | "number" | "boolean" | "array", orUndefined: boolean, target: ts.Node): boolean | undefined;
|
|
803
906
|
/**
|
|
804
907
|
* Whether argument `argumentIndex` of the call goes to a parameter through which the callee
|
|
805
908
|
* cannot add, change or remove a key: `Readonly<Record<string, V>>`, a type with a `readonly`
|
|
@@ -830,6 +933,24 @@ export type TypeQueries = {
|
|
|
830
933
|
* says the type is unknown here, so a rule must not read it as `string` or as anything else.
|
|
831
934
|
*/
|
|
832
935
|
isErrorType(node: ts.Node): boolean;
|
|
936
|
+
/**
|
|
937
|
+
* Whether the type of an expression is `any`: written so, the value of an untyped `require`, or
|
|
938
|
+
* the error type. No type states what such a value is or what calling it does.
|
|
939
|
+
*/
|
|
940
|
+
hasNoType(node: ts.Node): boolean;
|
|
941
|
+
/**
|
|
942
|
+
* Whether the type of an expression, or the type a type node names, is `any` or `unknown`
|
|
943
|
+
* (read from the type's flags, not its text): it states nothing about the value. Unlike
|
|
944
|
+
* `hasNoType`, `unknown` counts, and so does the error type.
|
|
945
|
+
*/
|
|
946
|
+
isOpenType(node: ts.Node): boolean;
|
|
947
|
+
/**
|
|
948
|
+
* Which of TypeScript's own types the type of an expression, or the type a type node names, is,
|
|
949
|
+
* read from the type's flags, not its text (`type Nothing = void` is `void`); undefined for any
|
|
950
|
+
* other type, a union included. `"awaited"` reads what awaiting it gives (`Promise<void>` is
|
|
951
|
+
* `void`).
|
|
952
|
+
*/
|
|
953
|
+
builtinTypeOf(node: ts.Node, read: "as-is" | "awaited"): BuiltinType | undefined;
|
|
833
954
|
/**
|
|
834
955
|
* Whether the type of an expression is promise-like: awaiting it gives another type
|
|
835
956
|
* (`Promise<T>`, a thenable, `Promise<T> | undefined`). `any` and `unknown` are false.
|
|
@@ -837,6 +958,19 @@ export type TypeQueries = {
|
|
|
837
958
|
isPromiseLike(node: ts.Node): boolean;
|
|
838
959
|
/** As `isPromiseLike`, for what a function declaration, function expression, arrow or method returns (declared or inferred). */
|
|
839
960
|
returnsPromiseLike(fn: ts.SignatureDeclaration): boolean;
|
|
961
|
+
/**
|
|
962
|
+
* Whether what a function declaration returns can be a promise: a promise-like type, `any`,
|
|
963
|
+
* `unknown`, a type parameter (`<T>(): T`), a type `Promise` is assignable to (`object`), or a
|
|
964
|
+
* union with such a member. False only for a type that cannot be one (`string`, `void`, a class
|
|
965
|
+
* without `then`).
|
|
966
|
+
*/
|
|
967
|
+
mayReturnPromise(fn: ts.SignatureDeclaration): boolean;
|
|
968
|
+
/**
|
|
969
|
+
* Whether the type of an expression has a method `name` whose every call signature returns a
|
|
970
|
+
* promise-like type, as `isPromiseLike` reads it (`release(): Promise<void>`, and
|
|
971
|
+
* `Promise<void> | void`). False when it has no such method.
|
|
972
|
+
*/
|
|
973
|
+
methodReturnsPromiseLike(node: ts.Node, name: string): boolean;
|
|
840
974
|
/**
|
|
841
975
|
* Whether the type of an expression surely has property `name` with a value: every member of
|
|
842
976
|
* its type (a type parameter widened to its constraint) declares it, not optional, and its type
|
|
@@ -953,6 +1087,13 @@ export type TypeQueries = {
|
|
|
953
1087
|
* (`Iterable<T>`, a `Set`, a union with one).
|
|
954
1088
|
*/
|
|
955
1089
|
arrayElementsOf(node: ts.Node): "primitives" | "values" | undefined;
|
|
1090
|
+
/**
|
|
1091
|
+
* For an expression whose type is the platform's array or a tuple (every member of a union):
|
|
1092
|
+
* whether a value of it can have no element. True for `T[]`, `readonly T[]` and a tuple whose
|
|
1093
|
+
* elements are all optional or rest (`[T?]`, `[...T[]]`); false when every member is a tuple
|
|
1094
|
+
* with a required element (`[T, ...T[]]`). Undefined when the type is anything else.
|
|
1095
|
+
*/
|
|
1096
|
+
arrayCanBeEmpty(node: ts.Node): boolean | undefined;
|
|
956
1097
|
/**
|
|
957
1098
|
* Whether a property read, an element read or a destructured property runs no code and cannot
|
|
958
1099
|
* throw, as far as the declared types say: the member is declared a property (never an accessor)
|
|
@@ -971,10 +1112,17 @@ export type TypeQueries = {
|
|
|
971
1112
|
*/
|
|
972
1113
|
readMayRunAccessor(node: ts.PropertyAccessExpression): boolean;
|
|
973
1114
|
/**
|
|
974
|
-
* Whether a name is declared by the platform only: TypeScript's lib
|
|
975
|
-
* project or
|
|
1115
|
+
* Whether a name is declared by the platform only: TypeScript's lib, Node's types or a package
|
|
1116
|
+
* the config's `platform` names, not the project or another package (`String`, `setTimeout`).
|
|
976
1117
|
*/
|
|
977
1118
|
isPlatformName(node: ts.Node): boolean;
|
|
1119
|
+
/**
|
|
1120
|
+
* The packages outside the platform that declare a global name (`setInterval` in a
|
|
1121
|
+
* `declare global` of a package's types), sorted; empty for a name the platform alone declares,
|
|
1122
|
+
* an imported name, or one no package declares. A name some package declares is not the
|
|
1123
|
+
* platform's (`isPlatformName`) until the config's `platform` lists that package.
|
|
1124
|
+
*/
|
|
1125
|
+
globalPackagesOf(node: ts.Node): readonly string[];
|
|
978
1126
|
/**
|
|
979
1127
|
* Whether the type of the right side of `instanceof` is a class the test cannot run code of: a
|
|
980
1128
|
* constructor of the platform, or a class of the project with no static `Symbol.hasInstance`.
|
|
@@ -1024,7 +1172,7 @@ export type TypeQueries = {
|
|
|
1024
1172
|
* an optional parameter the call leaves out counts (`fetch(url)`). Undefined when no parameter
|
|
1025
1173
|
* takes one, the call does not resolve, or the parameter is a rest parameter.
|
|
1026
1174
|
*/
|
|
1027
|
-
signalParameterOf(call: ts.CallExpression): SignalParameter | undefined;
|
|
1175
|
+
signalParameterOf(call: ts.CallExpression | ts.NewExpression): SignalParameter | undefined;
|
|
1028
1176
|
/**
|
|
1029
1177
|
* Whether TypeScript reports that the end of a function can be reached although the function
|
|
1030
1178
|
* must return a value: TS2366 (the return type does not include `undefined`), TS2355 (a
|
|
@@ -1034,6 +1182,182 @@ export type TypeQueries = {
|
|
|
1034
1182
|
* those in its body. Asks for the type errors of the function's file, once per file.
|
|
1035
1183
|
*/
|
|
1036
1184
|
reportsReachableEnd(fn: ts.FunctionLikeDeclaration): boolean;
|
|
1185
|
+
/**
|
|
1186
|
+
* The constructor TypeScript writes into the decorator metadata of a parameter
|
|
1187
|
+
* (`design:paramtypes`) or a property (`design:type`), following the compiler's rules: unions
|
|
1188
|
+
* and intersections are `Object` unless every member gives the same, literal types give their
|
|
1189
|
+
* primitive, enums give the kind of their members, type aliases are resolved. `not-emitted` when
|
|
1190
|
+
* the file's tsconfig does not emit decorator metadata.
|
|
1191
|
+
*/
|
|
1192
|
+
metadataTypeOf(node: ts.ParameterDeclaration | ts.PropertyDeclaration): DecoratorMetadata;
|
|
1193
|
+
/**
|
|
1194
|
+
* The classes whose instances the value of an expression can hold, after awaiting a promise:
|
|
1195
|
+
* each member of a union or an intersection, the elements of an array or a tuple, and, up to
|
|
1196
|
+
* `depth` levels, the properties of an object type that is not a class instance (a wrapper such
|
|
1197
|
+
* as `{ data: User[] }`). A class's own properties are not entered. `path` says where the
|
|
1198
|
+
* instance sits (`""` for the value itself, `"data[]"` for the elements of its `data`). `any` is
|
|
1199
|
+
* true when one of the types met is `any` or `unknown`: what it holds is not known.
|
|
1200
|
+
*/
|
|
1201
|
+
instanceClassesOf(node: ts.Node, depth: number): InstanceClasses;
|
|
1202
|
+
/**
|
|
1203
|
+
* The nearest generic class or interface of a package that the type of an expression is, or
|
|
1204
|
+
* extends, with the type arguments it is given there: for `pkg` `typeorm` and the names
|
|
1205
|
+
* `Repository` and `MongoRepository`, a value typed `UserRepository` (which extends
|
|
1206
|
+
* `Repository<User>`) gives `Repository` and `User`. Read from the type and its base types,
|
|
1207
|
+
* nearest first, after removing `null` and `undefined`, up to 8 levels; `this` and a type
|
|
1208
|
+
* parameter are read as their constraint, and an intersection (`Repository<User> & { … }`, what
|
|
1209
|
+
* TypeORM's `extend` returns) as its members. Undefined when the type
|
|
1210
|
+
* is not one of them, or is a union of several types.
|
|
1211
|
+
*/
|
|
1212
|
+
genericBaseOf(node: ts.Node, pkg: string, names: ReadonlySet<string>): GenericBase | undefined;
|
|
1213
|
+
/**
|
|
1214
|
+
* Whether the type of an expression is, or extends, one of `classes` (class and interface
|
|
1215
|
+
* declarations): read from the type and its base types after removing `null` and `undefined`,
|
|
1216
|
+
* up to 8 levels. A class itself (`Store.create()`) is read as its instances. False for a union
|
|
1217
|
+
* of several types, and for a type it cannot read.
|
|
1218
|
+
*/
|
|
1219
|
+
isOrExtends(node: ts.Node, classes: ReadonlySet<ts.Node>): boolean;
|
|
1220
|
+
/**
|
|
1221
|
+
* The properties of the type of an expression or a type node (`Env` in `ConfigService<Env>`;
|
|
1222
|
+
* a type parameter widened to its constraint), each with its type as TypeScript prints it,
|
|
1223
|
+
* sorted by name. Undefined when the type is not an object type.
|
|
1224
|
+
*/
|
|
1225
|
+
propertyTypesOf(node: ts.Node): readonly PropertyTypeText[] | undefined;
|
|
1226
|
+
/**
|
|
1227
|
+
* Whether argument `argumentIndex` of the call goes to a parameter declared `unknown`, or typed
|
|
1228
|
+
* by a type parameter of the function itself with no constraint or the constraint `unknown`
|
|
1229
|
+
* (`<T>(value: T)`, not the `V` of `Map<K, V>.set`): the
|
|
1230
|
+
* callee accepts any value and so must check it. Read from the declaration of the signature
|
|
1231
|
+
* TypeScript picks for the call, before its type parameters are filled in. False for a rest
|
|
1232
|
+
* parameter, an argument after a spread, and a call that does not resolve.
|
|
1233
|
+
*/
|
|
1234
|
+
parameterTakesUnknown(call: ts.CallExpression, argumentIndex: number): boolean;
|
|
1235
|
+
/**
|
|
1236
|
+
* The type of an expression (`"type"`), the type the surrounding code expects for it
|
|
1237
|
+
* (`"contextual"`, as `contextualTypeTextOf`), or the type a type node names, as a check written
|
|
1238
|
+
* in code can test it (`TypeShape`). Undefined when such a check cannot be written from the type
|
|
1239
|
+
* alone: a generic type (other than an array), a function, a tuple, an index signature, an
|
|
1240
|
+
* intersection, an enum, a class with a private member, a type of the platform's lib other than
|
|
1241
|
+
* an array (`Date`, `Map`), `any`, `unknown`, `symbol`, or nesting deeper than 8 levels.
|
|
1242
|
+
*/
|
|
1243
|
+
typeShapeOf(node: ts.Node, from: "type" | "contextual"): TypeShape | undefined;
|
|
1244
|
+
};
|
|
1245
|
+
/**
|
|
1246
|
+
* A type as a check written in code tests it (`TypeQueries.typeShapeOf`). `boolean` is a primitive,
|
|
1247
|
+
* not the union of `true` and `false`. An object's `text` is how the code can name its type: its
|
|
1248
|
+
* alias, interface or class name, or the object type written out. A `recursive` shape is a named
|
|
1249
|
+
* object type met again inside itself.
|
|
1250
|
+
*/
|
|
1251
|
+
export type TypeShape = {
|
|
1252
|
+
readonly kind: "primitive";
|
|
1253
|
+
readonly name: "string" | "number" | "boolean" | "bigint";
|
|
1254
|
+
} | {
|
|
1255
|
+
readonly kind: "literal";
|
|
1256
|
+
readonly literal: Literal;
|
|
1257
|
+
} | {
|
|
1258
|
+
readonly kind: "union";
|
|
1259
|
+
readonly members: readonly TypeShape[];
|
|
1260
|
+
} | {
|
|
1261
|
+
readonly kind: "array";
|
|
1262
|
+
readonly element: TypeShape;
|
|
1263
|
+
} | {
|
|
1264
|
+
readonly kind: "object";
|
|
1265
|
+
/** The type's identity: where it is declared, so two types of one name differ. */
|
|
1266
|
+
readonly id: string;
|
|
1267
|
+
readonly name: string | undefined;
|
|
1268
|
+
readonly text: string;
|
|
1269
|
+
readonly properties: readonly TypeShapeProperty[];
|
|
1270
|
+
} | {
|
|
1271
|
+
readonly kind: "recursive";
|
|
1272
|
+
readonly id: string;
|
|
1273
|
+
readonly name: string;
|
|
1274
|
+
};
|
|
1275
|
+
/** One property of an object `TypeShape`, in declaration order. */
|
|
1276
|
+
export type TypeShapeProperty = {
|
|
1277
|
+
readonly name: string;
|
|
1278
|
+
readonly optional: boolean;
|
|
1279
|
+
readonly shape: TypeShape;
|
|
1280
|
+
};
|
|
1281
|
+
/** What `TypeQueries.genericBaseOf` finds: the base's name, and each type argument it is given. */
|
|
1282
|
+
export type GenericBase = {
|
|
1283
|
+
readonly name: string;
|
|
1284
|
+
readonly typeArguments: readonly TypeArgument[];
|
|
1285
|
+
};
|
|
1286
|
+
/**
|
|
1287
|
+
* A type argument: a class of the project or a package, with its declaration, or another type
|
|
1288
|
+
* (an interface, a type parameter, `any`), as TypeScript prints it.
|
|
1289
|
+
*/
|
|
1290
|
+
export type TypeArgument = {
|
|
1291
|
+
readonly kind: "class";
|
|
1292
|
+
readonly name: string;
|
|
1293
|
+
readonly declaration: ts.ClassDeclaration;
|
|
1294
|
+
} | {
|
|
1295
|
+
readonly kind: "other";
|
|
1296
|
+
readonly text: string;
|
|
1297
|
+
};
|
|
1298
|
+
/** What `TypeQueries.instanceClassesOf` finds. */
|
|
1299
|
+
export type InstanceClasses = {
|
|
1300
|
+
readonly classes: readonly {
|
|
1301
|
+
readonly name: string;
|
|
1302
|
+
readonly declaration: ts.ClassDeclaration;
|
|
1303
|
+
readonly path: string;
|
|
1304
|
+
/** The class is the value's whole type there, not a member of an intersection with it. */
|
|
1305
|
+
readonly whole: boolean;
|
|
1306
|
+
}[];
|
|
1307
|
+
readonly any: boolean;
|
|
1308
|
+
};
|
|
1309
|
+
/** One property of a type, as `TypeQueries.propertyTypesOf` gives it. */
|
|
1310
|
+
export type PropertyTypeText = {
|
|
1311
|
+
readonly name: string;
|
|
1312
|
+
readonly text: string;
|
|
1313
|
+
readonly optional: boolean;
|
|
1314
|
+
/** The property's type is `any` or `unknown`. */
|
|
1315
|
+
readonly open: boolean;
|
|
1316
|
+
/**
|
|
1317
|
+
* The platform's own type of the property, `null` and `undefined` aside, as `platformTypeOf`
|
|
1318
|
+
* names it (`AbortSignal`); null for any other type.
|
|
1319
|
+
*/
|
|
1320
|
+
readonly platform: string | null;
|
|
1321
|
+
/** The property's type includes `null` or `undefined` (an optional property's does). */
|
|
1322
|
+
readonly nullish: boolean;
|
|
1323
|
+
};
|
|
1324
|
+
/**
|
|
1325
|
+
* A constructor TypeScript writes for a declaration into the `design:type` and
|
|
1326
|
+
* `design:paramtypes` metadata under `emitDecoratorMetadata` (the compiler's `serializeTypeNode`).
|
|
1327
|
+
*/
|
|
1328
|
+
export type MetadataType = {
|
|
1329
|
+
readonly kind: "global";
|
|
1330
|
+
readonly name: "String" | "Number" | "Boolean" | "Object" | "Array" | "Promise" | "Function" | "Symbol" | "BigInt";
|
|
1331
|
+
}
|
|
1332
|
+
/** `void 0`: `undefined`, `void`, `never`, `null`. */
|
|
1333
|
+
| {
|
|
1334
|
+
readonly kind: "undefined";
|
|
1335
|
+
}
|
|
1336
|
+
/** A class (or another value with construct signatures), by the name the code writes. */
|
|
1337
|
+
| {
|
|
1338
|
+
readonly kind: "class";
|
|
1339
|
+
readonly name: string;
|
|
1340
|
+
readonly symbol: SymbolRef | undefined;
|
|
1341
|
+
}
|
|
1342
|
+
/** A name that resolves to no type: emitted as `typeof X === "function" ? X : Object`. */
|
|
1343
|
+
| {
|
|
1344
|
+
readonly kind: "unresolved";
|
|
1345
|
+
readonly name: string;
|
|
1346
|
+
};
|
|
1347
|
+
/** What the decorator metadata of a parameter or property holds (`TypeQueries.metadataTypeOf`). */
|
|
1348
|
+
export type DecoratorMetadata =
|
|
1349
|
+
/** The project's tsconfig does not turn on `experimentalDecorators` and `emitDecoratorMetadata`. */
|
|
1350
|
+
{
|
|
1351
|
+
readonly kind: "not-emitted";
|
|
1352
|
+
} | {
|
|
1353
|
+
readonly kind: "emitted";
|
|
1354
|
+
/** What TypeScript writes. */
|
|
1355
|
+
readonly type: MetadataType;
|
|
1356
|
+
/**
|
|
1357
|
+
* The same rules with `null` and `undefined` left out of unions (as TypeScript does without
|
|
1358
|
+
* `strictNullChecks`): the runtime type the declaration names, `Number` for `number | undefined`.
|
|
1359
|
+
*/
|
|
1360
|
+
readonly withoutNullish: MetadataType;
|
|
1037
1361
|
};
|
|
1038
1362
|
export type ReportProblem = {
|
|
1039
1363
|
message: string;
|
|
@@ -1094,6 +1418,41 @@ export type FunctionFacts = {
|
|
|
1094
1418
|
* property (RTK Query's `cacheEntryRemoved`). An `await` of it is not a way out.
|
|
1095
1419
|
*/
|
|
1096
1420
|
readonly neverRejects?: true;
|
|
1421
|
+
/**
|
|
1422
|
+
* The function given as argument `argument` is run by the library, and the function it returns
|
|
1423
|
+
* is called later as its cleanup (React's `useEffect`): a value released in that cleanup is
|
|
1424
|
+
* released, and what the callback starts is the library's rule's to check.
|
|
1425
|
+
*/
|
|
1426
|
+
readonly cleanup?: {
|
|
1427
|
+
readonly argument: number;
|
|
1428
|
+
};
|
|
1429
|
+
/**
|
|
1430
|
+
* For a NestJS exception filter class of the package: the error classes it catches, as
|
|
1431
|
+
* `errors/throws` names classes (`package:axios#AxiosError`, or a bare name of the package or a
|
|
1432
|
+
* platform error such as `Error`); `["*"]` catches every error.
|
|
1433
|
+
*/
|
|
1434
|
+
readonly catches?: readonly string[];
|
|
1435
|
+
/** For a NestJS guard class of the package: whether it authenticates the request. */
|
|
1436
|
+
readonly authenticates?: boolean;
|
|
1437
|
+
/**
|
|
1438
|
+
* The value comes from outside the program and is not checked: the result of a call of the
|
|
1439
|
+
* function (`Redis.get`), or the value of the property (`AxiosResponse.data`). Read like a
|
|
1440
|
+
* `JSON.parse` result by `node/external-data-not-validated`.
|
|
1441
|
+
*/
|
|
1442
|
+
readonly external?: true;
|
|
1443
|
+
/**
|
|
1444
|
+
* For an error class of the package: the class it extends, as the package exports it
|
|
1445
|
+
* (`TypeORMError`) or a platform error (`Error`), so a reader can follow its parents
|
|
1446
|
+
* (`nestjs/error-becomes-500` looks for an `HttpException` or a `statusCode` field).
|
|
1447
|
+
*/
|
|
1448
|
+
readonly extends?: string;
|
|
1449
|
+
/**
|
|
1450
|
+
* For a class of the package: `false` when a method it inherits does not do what the facts of
|
|
1451
|
+
* the class that declares it say (TypeORM's `MongoRepository` inherits `save` from `Repository`
|
|
1452
|
+
* but runs no SQL). A call on it, or on a class that extends it, then reads only its own lines
|
|
1453
|
+
* (`MongoRepository.save`).
|
|
1454
|
+
*/
|
|
1455
|
+
readonly inheritedFacts?: false;
|
|
1097
1456
|
};
|
|
1098
1457
|
/**
|
|
1099
1458
|
* How a value with the release trait is released, as a `facts` line says it: `"release"`, call the
|
|
@@ -1104,8 +1463,111 @@ export type ReleaseFact = "release" | {
|
|
|
1104
1463
|
readonly release: string;
|
|
1105
1464
|
};
|
|
1106
1465
|
export type PackageFactsConfig = Readonly<Record<string, Readonly<Record<string, FunctionFacts>>>>;
|
|
1107
|
-
/**
|
|
1108
|
-
|
|
1466
|
+
/**
|
|
1467
|
+
* The config's `facts` as written: each package's lines, and optionally under `"@versions"` the
|
|
1468
|
+
* semver range of the package's versions they were stated for (`"^3.2.0"`). For a project that
|
|
1469
|
+
* runs another version, or one whose version is not known, the package's lines are not applied.
|
|
1470
|
+
*/
|
|
1471
|
+
export type PackageFactsInput = Readonly<Record<string, PackageFactsTable>>;
|
|
1472
|
+
/** One package's lines in the config's `facts`, with the optional `"@versions"` range. */
|
|
1473
|
+
export type PackageFactsTable = {
|
|
1474
|
+
readonly "@versions"?: string;
|
|
1475
|
+
readonly [name: string]: FunctionFacts | string | undefined;
|
|
1476
|
+
};
|
|
1477
|
+
/**
|
|
1478
|
+
* The versions of a package a pack's shipped facts were verified on (`Plugin.factsVerified`): a
|
|
1479
|
+
* semver range (`">=0.3.17 <=1.1.2"`), and the evidence. For a project that runs another version,
|
|
1480
|
+
* or one whose version is not known, the pack's lines for the package are not applied.
|
|
1481
|
+
*/
|
|
1482
|
+
export type VerifiedFacts = {
|
|
1483
|
+
readonly verified: string;
|
|
1484
|
+
readonly evidence: string;
|
|
1485
|
+
};
|
|
1486
|
+
/**
|
|
1487
|
+
* A package's facts lines that are not applied in a file: the project runs a version outside the
|
|
1488
|
+
* range they are for, or its version is not known. A call they would name is "not checked", with
|
|
1489
|
+
* `reason` after "not checked: … : " and `hint`.
|
|
1490
|
+
*/
|
|
1491
|
+
export type WithheldFacts = {
|
|
1492
|
+
readonly package: string;
|
|
1493
|
+
readonly source: "config" | "shipped";
|
|
1494
|
+
readonly functions: Readonly<Record<string, FunctionFacts>>;
|
|
1495
|
+
readonly reason: string;
|
|
1496
|
+
readonly hint: string;
|
|
1497
|
+
};
|
|
1498
|
+
/** What a "not checked" finding needs a `facts` line to state of a package call. */
|
|
1499
|
+
export type FactSide = "throws" | "rejects";
|
|
1500
|
+
/**
|
|
1501
|
+
* A `facts` line that would decide a "not checked" finding (`Finding.needs`): the key that names
|
|
1502
|
+
* the call, at the function grain (`"typeorm"`, `"Repository.save"`), the package's version the
|
|
1503
|
+
* project runs, and what the line states. The editor and `check --fix` offer to write it, and
|
|
1504
|
+
* `stateward coverage --facts` ranks the calls by how many findings each would decide.
|
|
1505
|
+
*/
|
|
1506
|
+
export type FactNeed = {
|
|
1507
|
+
readonly module: string;
|
|
1508
|
+
readonly name: string;
|
|
1509
|
+
/** The package's version the project runs; absent when it is not known. */
|
|
1510
|
+
readonly version?: string;
|
|
1511
|
+
readonly states: readonly FactSide[];
|
|
1512
|
+
};
|
|
1513
|
+
/**
|
|
1514
|
+
* A `facts` key for a declaration outside the project (`TypeQueries.factModuleOf`): its module
|
|
1515
|
+
* and name, `platform` when the module's types are the platform's; `unnamed` when no module
|
|
1516
|
+
* names it, with `through`, the module the reference is imported from, when it is imported.
|
|
1517
|
+
*/
|
|
1518
|
+
export type FactModule = {
|
|
1519
|
+
readonly kind: "named";
|
|
1520
|
+
readonly module: string;
|
|
1521
|
+
readonly name: string;
|
|
1522
|
+
readonly platform: boolean;
|
|
1523
|
+
} | {
|
|
1524
|
+
readonly kind: "unnamed";
|
|
1525
|
+
readonly through?: string;
|
|
1526
|
+
};
|
|
1527
|
+
/**
|
|
1528
|
+
* The `facts` key for a call or a class outside the project (`factKeyOf`): its module, its name
|
|
1529
|
+
* there, and the version of the package that owns the module (absent for the platform's modules
|
|
1530
|
+
* and when it is not known); `unnamed` with the code as written and why no key can name it.
|
|
1531
|
+
*/
|
|
1532
|
+
export type FactKey = {
|
|
1533
|
+
readonly kind: "named";
|
|
1534
|
+
readonly module: string;
|
|
1535
|
+
readonly name: string;
|
|
1536
|
+
readonly version?: string;
|
|
1537
|
+
} | {
|
|
1538
|
+
readonly kind: "unnamed";
|
|
1539
|
+
readonly name: string;
|
|
1540
|
+
readonly reason: string;
|
|
1541
|
+
};
|
|
1542
|
+
/** A call a finding depends on that no `facts` key can name (`Finding.unnamed`), and why. */
|
|
1543
|
+
export type UnnamedFact = {
|
|
1544
|
+
readonly name: string;
|
|
1545
|
+
readonly reason: string;
|
|
1546
|
+
};
|
|
1547
|
+
/**
|
|
1548
|
+
* Where a library fact comes from: the config's `facts`, the facts a pack ships (`Plugin.facts`),
|
|
1549
|
+
* or not known. A package's code and doc comments are never read for it (0041).
|
|
1550
|
+
*/
|
|
1551
|
+
export type FactSource = "config" | "shipped" | "unknown";
|
|
1552
|
+
/**
|
|
1553
|
+
* What a `facts` key names in a program (`TypeQueries.factTarget`): the declarations of the
|
|
1554
|
+
* symbol it resolves to; `no-module` when its module does not resolve from the project;
|
|
1555
|
+
* `no-name` when the module has no such name.
|
|
1556
|
+
*
|
|
1557
|
+
* `declarations` holds what the key states on any call. A class or package key also names the
|
|
1558
|
+
* methods a class inherits: those are in `throughReceiver`, each with the class declarations its
|
|
1559
|
+
* receiver must be, or extend (`TypeQueries.isOrExtends`), for the key to state the call. A
|
|
1560
|
+
* `"Store.*"` line states `store.find()` on a `Store`, never `base.find()` on its plain `Base`.
|
|
1561
|
+
*/
|
|
1562
|
+
export type FactTarget = {
|
|
1563
|
+
readonly kind: "found";
|
|
1564
|
+
readonly declarations: ReadonlySet<ts.Node>;
|
|
1565
|
+
readonly throughReceiver: ReadonlyMap<ts.Node, ReadonlySet<ts.Node>>;
|
|
1566
|
+
} | {
|
|
1567
|
+
readonly kind: "no-module";
|
|
1568
|
+
} | {
|
|
1569
|
+
readonly kind: "no-name";
|
|
1570
|
+
};
|
|
1109
1571
|
/**
|
|
1110
1572
|
* How a plugin knows the functions of one package the project calls, for `stateward deps`: each
|
|
1111
1573
|
* function by its name, where its facts come from, and why what is unknown is unknown.
|
|
@@ -1189,7 +1651,7 @@ export type StatedGuarantee = {
|
|
|
1189
1651
|
/** The places the proof covers, in file and offset order; empty when nothing uses it. */
|
|
1190
1652
|
readonly covered: readonly CoveredPlace[];
|
|
1191
1653
|
/**
|
|
1192
|
-
* Places that use the guarantee's value in a way the rule cannot follow (a
|
|
1654
|
+
* Places that use the guarantee's value in a way the rule cannot follow (a change only in a
|
|
1193
1655
|
* closure nothing calls, an `if` chain over an open value): none is proven, so the guarantee
|
|
1194
1656
|
* reads "not checked" while one is left, never proven and never unused.
|
|
1195
1657
|
*/
|
|
@@ -1198,7 +1660,7 @@ export type StatedGuarantee = {
|
|
|
1198
1660
|
/** A place a rule cannot follow, and what is in it, as `not checked: …` says it. */
|
|
1199
1661
|
export type UncheckedPlace = {
|
|
1200
1662
|
readonly location: Location;
|
|
1201
|
-
/** After "not checked: ": "
|
|
1663
|
+
/** After "not checked: ": "changed only in `later`, which nothing calls". */
|
|
1202
1664
|
readonly reason: string;
|
|
1203
1665
|
};
|
|
1204
1666
|
export type FileContext<O extends Options = Options> = {
|
|
@@ -1210,6 +1672,12 @@ export type FileContext<O extends Options = Options> = {
|
|
|
1210
1672
|
* order. The config's own `facts` line for a function wins over a shipped one.
|
|
1211
1673
|
*/
|
|
1212
1674
|
readonly shippedFacts: PackageFactsConfig;
|
|
1675
|
+
/**
|
|
1676
|
+
* The facts lines of `facts` and `shippedFacts` left out for this file because they are for
|
|
1677
|
+
* other versions of their package than the one its project runs (`"@versions"`,
|
|
1678
|
+
* `Plugin.factsVerified`); empty for most files. A call one would name is "not checked".
|
|
1679
|
+
*/
|
|
1680
|
+
readonly withheldFacts: readonly WithheldFacts[];
|
|
1213
1681
|
/** The rule's options: the config's values with the defaults filled in; `{}` when it declares none. */
|
|
1214
1682
|
readonly options: O;
|
|
1215
1683
|
readonly sourceFile: ts.SourceFile;
|
|
@@ -1223,6 +1691,10 @@ export type FileContext<O extends Options = Options> = {
|
|
|
1223
1691
|
hint: string;
|
|
1224
1692
|
node: ts.Node;
|
|
1225
1693
|
against?: ts.Node | SymbolRef;
|
|
1694
|
+
/** The `facts` lines that would decide it (`Finding.needs`). */
|
|
1695
|
+
needs?: readonly FactNeed[];
|
|
1696
|
+
/** The calls no `facts` key can name (`Finding.unnamed`). */
|
|
1697
|
+
unnamed?: readonly UnnamedFact[];
|
|
1226
1698
|
}): void;
|
|
1227
1699
|
/**
|
|
1228
1700
|
* The references in this file to the declarations that state a trait the active rules prove
|
|
@@ -1236,10 +1708,20 @@ export type FileContext<O extends Options = Options> = {
|
|
|
1236
1708
|
*/
|
|
1237
1709
|
read(ref: LedgerRef, outcome: ReadOutcome): void;
|
|
1238
1710
|
};
|
|
1711
|
+
/**
|
|
1712
|
+
* The analyses a project rule reads (`ProjectRule.reads`), by id `"<plugin>/<name>"`: each as JSON
|
|
1713
|
+
* in the shape its publisher's package exports (`{ "errors/throws": ThrowsAnalysis }`).
|
|
1714
|
+
*/
|
|
1715
|
+
export type Analyses = Readonly<Record<string, Json>>;
|
|
1239
1716
|
/** Project rules decide from their JSON summaries alone, so their results can be cached. */
|
|
1240
|
-
export type ProjectContext<O extends Options = Options> = {
|
|
1717
|
+
export type ProjectContext<O extends Options = Options, A extends Analyses = Analyses> = {
|
|
1241
1718
|
/** The rule's options, as in `FileContext`. */
|
|
1242
1719
|
readonly options: O;
|
|
1720
|
+
/**
|
|
1721
|
+
* The analyses the rule reads (`ProjectRule.reads`), by id, computed once per check: the rule
|
|
1722
|
+
* runs only when every one of them is there. `{}` for a rule that reads none.
|
|
1723
|
+
*/
|
|
1724
|
+
readonly analyses: A;
|
|
1243
1725
|
report(problem: {
|
|
1244
1726
|
message: string;
|
|
1245
1727
|
hint: string;
|
|
@@ -1264,6 +1746,20 @@ export type ProjectContext<O extends Options = Options> = {
|
|
|
1264
1746
|
location: Location;
|
|
1265
1747
|
/** The declarations whose proof stops here, as `against` names them. */
|
|
1266
1748
|
against?: readonly Location[];
|
|
1749
|
+
/** The `facts` lines that would decide it (`Finding.needs`). */
|
|
1750
|
+
needs?: readonly FactNeed[];
|
|
1751
|
+
/** The calls no `facts` key can name (`Finding.unnamed`). */
|
|
1752
|
+
unnamed?: readonly UnnamedFact[];
|
|
1753
|
+
}): void;
|
|
1754
|
+
/**
|
|
1755
|
+
* A place the rule judged on what is known, leaving out package calls whose errors no `facts`
|
|
1756
|
+
* line states (`CheckResult.unstated`): not a finding, and not "not checked". The run counts
|
|
1757
|
+
* these places in one line, and `stateward coverage --facts` lists the lines they need.
|
|
1758
|
+
*/
|
|
1759
|
+
unstated(input: {
|
|
1760
|
+
location: Location;
|
|
1761
|
+
needs?: readonly FactNeed[];
|
|
1762
|
+
unnamed?: readonly UnnamedFact[];
|
|
1267
1763
|
}): void;
|
|
1268
1764
|
/**
|
|
1269
1765
|
* Settles a reference the rule's file side handed on (`ReadOutcome` `handed-on`), by its id and
|
|
@@ -1274,6 +1770,17 @@ export type ProjectContext<O extends Options = Options> = {
|
|
|
1274
1770
|
readonly trait: string;
|
|
1275
1771
|
}, outcome: ReadOutcome): void;
|
|
1276
1772
|
};
|
|
1773
|
+
/**
|
|
1774
|
+
* A place a rule judged on what is known, leaving out package calls whose errors no `facts` line
|
|
1775
|
+
* states (`ProjectContext.unstated`): the lines that would state them (`needs`), and the calls no
|
|
1776
|
+
* key can name (`unnamed`).
|
|
1777
|
+
*/
|
|
1778
|
+
export type UnstatedPlace = {
|
|
1779
|
+
readonly ruleId: string;
|
|
1780
|
+
readonly location: Location;
|
|
1781
|
+
readonly needs?: readonly FactNeed[];
|
|
1782
|
+
readonly unnamed?: readonly UnnamedFact[];
|
|
1783
|
+
};
|
|
1277
1784
|
export type FileRule<S extends OptionSpecs = OptionSpecs, G extends string = string> = {
|
|
1278
1785
|
kind: "file";
|
|
1279
1786
|
meta: RuleMeta<S, G>;
|
|
@@ -1286,12 +1793,36 @@ export type FileRule<S extends OptionSpecs = OptionSpecs, G extends string = str
|
|
|
1286
1793
|
*/
|
|
1287
1794
|
summarize?(ctx: FileContext<OptionsOf<S>>): Json | undefined;
|
|
1288
1795
|
};
|
|
1289
|
-
|
|
1796
|
+
/**
|
|
1797
|
+
* Every order of the keys of `K`, each once: what `reads` lists for a rule that types its
|
|
1798
|
+
* analyses (`["errors/throws"]`, or both orders of two).
|
|
1799
|
+
*/
|
|
1800
|
+
type EveryOrder<K extends string, All extends string = K> = [K] extends [never] ? [] : K extends K ? [K, ...EveryOrder<Exclude<All, K>>] : never;
|
|
1801
|
+
/**
|
|
1802
|
+
* A project rule's `reads` (`ProjectRule.reads`): any analysis ids for a rule that does not type
|
|
1803
|
+
* them; for a rule that names its analyses in its type (`{ "errors/throws": ThrowsAnalysis }`),
|
|
1804
|
+
* required and listing exactly those, so `ctx.analyses` holds every one the type promises.
|
|
1805
|
+
*/
|
|
1806
|
+
export type ReadsOf<A extends Analyses> = string extends keyof A ? {
|
|
1807
|
+
/**
|
|
1808
|
+
* The analyses this rule reads, by id `"<plugin>/<name>"` (`Plugin.analyses`): core runs
|
|
1809
|
+
* each once per check, however many rules read it, and passes it in
|
|
1810
|
+
* `ProjectContext.analyses`; the rule is checked again when one changes. Without the
|
|
1811
|
+
* publisher in the config's plugins, the rule reports one "not checked" finding that names
|
|
1812
|
+
* the missing pack.
|
|
1813
|
+
*/
|
|
1814
|
+
reads?: readonly string[];
|
|
1815
|
+
} : [keyof A] extends [never] ? {
|
|
1816
|
+
reads?: readonly [];
|
|
1817
|
+
} : {
|
|
1818
|
+
reads: Readonly<EveryOrder<Extract<keyof A, string>>>;
|
|
1819
|
+
};
|
|
1820
|
+
export type ProjectRule<Summary extends Json = Json, S extends OptionSpecs = OptionSpecs, G extends string = string, A extends Analyses = Analyses> = ReadsOf<A> & {
|
|
1290
1821
|
kind: "project";
|
|
1291
1822
|
meta: RuleMeta<S, G>;
|
|
1292
1823
|
/** Per file and cacheable, hence JSON. */
|
|
1293
1824
|
summarize(ctx: FileContext<OptionsOf<S>>): Summary | undefined;
|
|
1294
|
-
check(summaries: ReadonlyMap<string, Summary>, ctx: ProjectContext<OptionsOf<S
|
|
1825
|
+
check(summaries: ReadonlyMap<string, Summary>, ctx: ProjectContext<OptionsOf<S>, A>): void;
|
|
1295
1826
|
/**
|
|
1296
1827
|
* For `stateward plan` and `coverage`: why this rule, though on, cannot report anything in this
|
|
1297
1828
|
* project, as a short phrase after "silent: "; undefined when it can. Only for a reason that is
|
|
@@ -1414,6 +1945,51 @@ export type EditorContributions = {
|
|
|
1414
1945
|
projectSummaries(ruleId: string): ReadonlyMap<string, Json> | undefined;
|
|
1415
1946
|
}): readonly StatedGuarantee[];
|
|
1416
1947
|
};
|
|
1948
|
+
/** Where a place in a report is, as the developer reads it: a path from their folder, a 1-based line. */
|
|
1949
|
+
export type ReportPlace = {
|
|
1950
|
+
readonly file: string;
|
|
1951
|
+
readonly line: number;
|
|
1952
|
+
};
|
|
1953
|
+
/** What a plugin's report reads (`PluginReport.run`). */
|
|
1954
|
+
export type ReportInput = {
|
|
1955
|
+
/**
|
|
1956
|
+
* The summaries a project rule of the plugin produced in the check that ran just before, by
|
|
1957
|
+
* file, or undefined when that rule did not run (as in `EditorContributions.hover`).
|
|
1958
|
+
*/
|
|
1959
|
+
readonly projectSummaries: (ruleId: string) => ReadonlyMap<string, Json> | undefined;
|
|
1960
|
+
/** Where a location is, for the text and the rows. */
|
|
1961
|
+
readonly place: (location: Location) => ReportPlace;
|
|
1962
|
+
};
|
|
1963
|
+
/** What a report gives: its rows as plain data (`--format json`), and the text to print. */
|
|
1964
|
+
export type ReportOutput = {
|
|
1965
|
+
readonly rows: readonly Json[];
|
|
1966
|
+
readonly text: string;
|
|
1967
|
+
};
|
|
1968
|
+
/**
|
|
1969
|
+
* A read-only report a plugin contributes (`Plugin.reports`), run as `stateward <name>` after a
|
|
1970
|
+
* check of the project. It decides no finding: it shows what the plugin's rules read.
|
|
1971
|
+
*/
|
|
1972
|
+
export type PluginReport = {
|
|
1973
|
+
/** What it shows, in one sentence: the line of `stateward --help` and `stateward <name> --help`. */
|
|
1974
|
+
readonly help: string;
|
|
1975
|
+
readonly run: (input: ReportInput) => ReportOutput;
|
|
1976
|
+
};
|
|
1977
|
+
/**
|
|
1978
|
+
* What an analysis's `summarize` reads of a file: the file and its types, and the facts about
|
|
1979
|
+
* packages. It reports nothing: an analysis decides no finding.
|
|
1980
|
+
*/
|
|
1981
|
+
export type AnalysisContext = Pick<FileContext, "file" | "sourceFile" | "types" | "facts" | "shippedFacts" | "withheldFacts">;
|
|
1982
|
+
/**
|
|
1983
|
+
* An analysis a plugin publishes for project rules to read (`Plugin.analyses`, `ProjectRule.reads`),
|
|
1984
|
+
* of any pack. Core runs it once per check when a rule that is on reads it, whether or not the
|
|
1985
|
+
* publisher's own rules are on. Its shape is a type the publisher's package exports.
|
|
1986
|
+
*/
|
|
1987
|
+
export type PluginAnalysis<Summary extends Json = Json, Result extends Json = Json> = {
|
|
1988
|
+
/** One file in, JSON out, as a project rule's `summarize`: cached under the file's dependency fingerprint. */
|
|
1989
|
+
summarize(ctx: AnalysisContext): Summary | undefined;
|
|
1990
|
+
/** Every file's summary in (by file, in file order), the analysis out. Same summaries, same result. */
|
|
1991
|
+
solve(summaries: ReadonlyMap<string, Summary>): Result;
|
|
1992
|
+
};
|
|
1417
1993
|
/** Rule ids are "<plugin name>/<rule key>". */
|
|
1418
1994
|
export type Plugin = {
|
|
1419
1995
|
name: string;
|
|
@@ -1427,6 +2003,43 @@ export type Plugin = {
|
|
|
1427
2003
|
* Every rule reads them as `FileContext.shippedFacts`; the config's facts win over them.
|
|
1428
2004
|
*/
|
|
1429
2005
|
facts?: PackageFactsConfig;
|
|
2006
|
+
/**
|
|
2007
|
+
* The versions of each package `facts` names that the facts were verified on, by package. A
|
|
2008
|
+
* project that runs another version, or one whose version is not known, does not get the
|
|
2009
|
+
* package's lines: a call they would name is "not checked". A package not listed here gets its
|
|
2010
|
+
* lines on every version.
|
|
2011
|
+
*/
|
|
2012
|
+
factsVerified?: Readonly<Record<string, VerifiedFacts>>;
|
|
2013
|
+
/**
|
|
2014
|
+
* Read-only reports, by command name (kebab-case): the CLI runs each as `stateward <name>`
|
|
2015
|
+
* and lists it in `stateward --help`. The CLI's own commands come first: a report named like
|
|
2016
|
+
* one of them is not run.
|
|
2017
|
+
*/
|
|
2018
|
+
reports?: Readonly<Record<string, PluginReport>>;
|
|
2019
|
+
/**
|
|
2020
|
+
* Analyses for project rules of any pack to read, by name (kebab-case); a rule reads one as
|
|
2021
|
+
* `"<plugin>/<name>"` (`ProjectRule.reads`).
|
|
2022
|
+
*/
|
|
2023
|
+
analyses?: Readonly<Record<string, PluginAnalysis>>;
|
|
2024
|
+
/**
|
|
2025
|
+
* Test and fixture files the pack's library names in its own way (globs, as `exclude` writes
|
|
2026
|
+
* them), such as a framework's own fixture folder. They join the default `exclude` while the pack
|
|
2027
|
+
* is loaded, unless the config's own `exclude` leaves out one of `defaults.exclude`.
|
|
2028
|
+
*/
|
|
2029
|
+
defaultExclude?: readonly string[];
|
|
2030
|
+
/**
|
|
2031
|
+
* Rule ids a release renamed, to the id the rule has now:
|
|
2032
|
+
* `{ "unions/default-hides-cases": "unions/non-exhaustive-switch" }`. A rule that moved to
|
|
2033
|
+
* another pack is listed by both packs. A config, an ignore comment, the rollout file and the
|
|
2034
|
+
* baseline that use the old id still work, with a warning that says what to rename.
|
|
2035
|
+
*/
|
|
2036
|
+
renamed?: Readonly<Record<string, string>>;
|
|
2037
|
+
/**
|
|
2038
|
+
* Rule ids a release removed, with the add-ons of the same id that turned them on:
|
|
2039
|
+
* `["errors/narrow-try"]`. A config, an ignore comment, the rollout file and the baseline that
|
|
2040
|
+
* still name one keep working: the entry has no effect, and a warning says to delete it.
|
|
2041
|
+
*/
|
|
2042
|
+
removed?: readonly string[];
|
|
1430
2043
|
};
|
|
1431
2044
|
/** A plugin that keeps its literal name and rule keys, as `definePlugin` returns it. */
|
|
1432
2045
|
export type PluginOf<N extends string, R extends Readonly<Record<string, PluginRule>>> = {
|
|
@@ -1435,6 +2048,12 @@ export type PluginOf<N extends string, R extends Readonly<Record<string, PluginR
|
|
|
1435
2048
|
rules: R;
|
|
1436
2049
|
editor?: EditorContributions;
|
|
1437
2050
|
facts?: PackageFactsConfig;
|
|
2051
|
+
factsVerified?: Readonly<Record<string, VerifiedFacts>>;
|
|
2052
|
+
reports?: Readonly<Record<string, PluginReport>>;
|
|
2053
|
+
analyses?: Readonly<Record<string, PluginAnalysis>>;
|
|
2054
|
+
defaultExclude?: readonly string[];
|
|
2055
|
+
renamed?: Readonly<Record<string, string>>;
|
|
2056
|
+
removed?: readonly string[];
|
|
1438
2057
|
};
|
|
1439
2058
|
/** Every rule id ("<plugin>/<rule key>") a plugin type offers; any string pair for a wide `Plugin`. */
|
|
1440
2059
|
export type RuleIdOf<P extends Plugin> = P extends Plugin ? `${P["name"]}/${Extract<keyof P["rules"], string>}` : never;
|
|
@@ -1480,6 +2099,12 @@ export type Config = {
|
|
|
1480
2099
|
*/
|
|
1481
2100
|
replacesDefaultExclude: boolean;
|
|
1482
2101
|
plugins: readonly Plugin[];
|
|
2102
|
+
/**
|
|
2103
|
+
* Packages whose types are the platform, besides TypeScript's own lib and Node's types
|
|
2104
|
+
* (`@types/node`): `["bun-types", "@cloudflare/workers-types"]`. What they declare is read as
|
|
2105
|
+
* the platform's own (`TypeQueries.isPlatformName`), as Node's is. `[]` when the config adds none.
|
|
2106
|
+
*/
|
|
2107
|
+
platform: readonly string[];
|
|
1483
2108
|
/**
|
|
1484
2109
|
* The preset that turns rules on by tier, or undefined: then only what `groups`, `rules` and
|
|
1485
2110
|
* `addons` name is on (a plugin alone turns nothing on).
|
|
@@ -1487,6 +2112,12 @@ export type Config = {
|
|
|
1487
2112
|
preset: Preset | undefined;
|
|
1488
2113
|
/** Add-ons switched on, each "<plugin>/<addon>". */
|
|
1489
2114
|
addons: readonly string[];
|
|
2115
|
+
/**
|
|
2116
|
+
* True turns on every convention rule of the loaded packs (tier `convention`) and every option
|
|
2117
|
+
* marked `convention`: checks of a team convention rather than facts about the code. False by
|
|
2118
|
+
* default; a convention rule can also be turned on alone by its id under `rules`.
|
|
2119
|
+
*/
|
|
2120
|
+
conventions: boolean;
|
|
1490
2121
|
rules: Readonly<Record<string, RuleSetting>>;
|
|
1491
2122
|
/** A setting for every rule of a group, by "<plugin>/<group>"; an explicit `rules` entry wins over it. */
|
|
1492
2123
|
groups: Readonly<Record<string, RuleSetting>>;
|
|
@@ -1502,16 +2133,23 @@ export type Config = {
|
|
|
1502
2133
|
rollout: boolean;
|
|
1503
2134
|
/** Absolute folder of the config file, where `stateward.rollout.json` lives. Set by `parseConfig`. */
|
|
1504
2135
|
configDir: string;
|
|
1505
|
-
/** What the developer says about packages' functions
|
|
2136
|
+
/** What the developer says about packages' functions, without `"@versions"`. */
|
|
1506
2137
|
facts: PackageFactsConfig;
|
|
2138
|
+
/** The range of versions each package's facts are for (`"@versions"`), by package. */
|
|
2139
|
+
factVersions: Readonly<Record<string, string>>;
|
|
1507
2140
|
/** Settings for some files, in the order they apply (the later one wins). */
|
|
1508
2141
|
overrides: readonly ConfigOverride[];
|
|
1509
2142
|
ignores: IgnoreOptions;
|
|
1510
2143
|
/**
|
|
1511
|
-
* What the config should change though it still works: an old rule, group or add-on id
|
|
1512
|
-
* (`renamed.ts`), one line each. Empty for most configs; the CLI and the editor show them.
|
|
2144
|
+
* What the config should change though it still works: an old rule, group or add-on id, or a
|
|
2145
|
+
* removed one (`renamed.ts`), one line each. Empty for most configs; the CLI and the editor show them.
|
|
1513
2146
|
*/
|
|
1514
2147
|
warnings: readonly string[];
|
|
2148
|
+
/**
|
|
2149
|
+
* What the config does that the developer may not expect, though it is valid: a rule turned on
|
|
2150
|
+
* in `rules` that a release made off by default. One line each; the CLI shows them as infos.
|
|
2151
|
+
*/
|
|
2152
|
+
notes: readonly string[];
|
|
1515
2153
|
/**
|
|
1516
2154
|
* How the places stateward could not check (unknown findings) are shown: as infos (the
|
|
1517
2155
|
* default), as warnings, or "off": left out of the list and the editor but still counted in the
|
|
@@ -1544,7 +2182,12 @@ export type PluginsOf<C, Depth extends readonly unknown[] = []> = Depth["length"
|
|
|
1544
2182
|
} ? Own[number] | (C extends {
|
|
1545
2183
|
extends?: infer Parents extends readonly unknown[];
|
|
1546
2184
|
} ? PluginsOf<Parents[number], [...Depth, unknown]> : never) : never;
|
|
1547
|
-
export type UserConfig<P extends readonly Plugin[] = readonly Plugin[], E extends readonly ExtendedConfig[] = readonly ExtendedConfig[]> = Partial<Omit<Config, "plugins" | "configDir" | "rules" | "groups" | "ruleOptions" | "overrides" | "ignores" | "replacesDefaultExclude" | "tsconfig" | "tsconfigAsWritten">> & {
|
|
2185
|
+
export type UserConfig<P extends readonly Plugin[] = readonly Plugin[], E extends readonly ExtendedConfig[] = readonly ExtendedConfig[]> = Partial<Omit<Config, "plugins" | "configDir" | "rules" | "groups" | "ruleOptions" | "overrides" | "ignores" | "replacesDefaultExclude" | "tsconfig" | "tsconfigAsWritten" | "facts" | "factVersions">> & {
|
|
2186
|
+
/**
|
|
2187
|
+
* What the developer says about packages' functions, by package; `"@versions"` in a package's
|
|
2188
|
+
* lines gives the range of its versions they are for.
|
|
2189
|
+
*/
|
|
2190
|
+
facts?: PackageFactsInput;
|
|
1548
2191
|
/**
|
|
1549
2192
|
* The tsconfig to check, relative to this file's folder (`"tsconfig.json"` by default), or several,
|
|
1550
2193
|
* with globs: each one found is checked as its own project.
|
|
@@ -1573,8 +2216,9 @@ export type UserConfig<P extends readonly Plugin[] = readonly Plugin[], E extend
|
|
|
1573
2216
|
* A config another one extends. Its rule and group ids are not checked in the type (they are
|
|
1574
2217
|
* checked against the merged plugins when the config loads).
|
|
1575
2218
|
*/
|
|
1576
|
-
export type ExtendedConfig = Partial<Omit<Config, "plugins" | "configDir" | "rules" | "groups" | "ruleOptions" | "overrides" | "ignores" | "replacesDefaultExclude" | "tsconfig" | "tsconfigAsWritten">> & {
|
|
2219
|
+
export type ExtendedConfig = Partial<Omit<Config, "plugins" | "configDir" | "rules" | "groups" | "ruleOptions" | "overrides" | "ignores" | "replacesDefaultExclude" | "tsconfig" | "tsconfigAsWritten" | "facts" | "factVersions">> & {
|
|
1577
2220
|
tsconfig?: string | readonly string[];
|
|
2221
|
+
facts?: PackageFactsInput;
|
|
1578
2222
|
plugins?: readonly Plugin[];
|
|
1579
2223
|
extends?: readonly ExtendedConfig[];
|
|
1580
2224
|
rules?: Readonly<Record<string, RuleConfig>>;
|
|
@@ -1671,13 +2315,41 @@ export type CheckResult = {
|
|
|
1671
2315
|
* What the run could not check as a whole, said once (not part of the JSON contract yet).
|
|
1672
2316
|
* `missingTypes`: rules that ran where their library's types do not resolve
|
|
1673
2317
|
* (`RuleInfo.needsTypes`), by library, rule ids sorted. `looseNulls`: the tsconfigs, absolute,
|
|
1674
|
-
* whose projects check without `strictNullChecks`.
|
|
2318
|
+
* whose projects check without `strictNullChecks`. `unreadTestConfigs`: the test-runner configs,
|
|
2319
|
+
* absolute, whose test files could not be read, so those tests may be checked as code.
|
|
2320
|
+
* `unmatchedFacts`: the config's facts lines that name nothing in their package;
|
|
2321
|
+
* `factsNotChecked`: those whose package's types could not be read. Left out when there is
|
|
2322
|
+
* nothing to say.
|
|
1675
2323
|
*/
|
|
1676
2324
|
notes?: CheckNotes;
|
|
2325
|
+
/**
|
|
2326
|
+
* The places rules judged on what is known, leaving out package calls whose errors no `facts`
|
|
2327
|
+
* line states (`ProjectContext.unstated`), sorted by file, start, rule id. Not findings: the run
|
|
2328
|
+
* says how many in one line, and `stateward coverage --facts` lists the lines they need. Absent
|
|
2329
|
+
* when there are none.
|
|
2330
|
+
*/
|
|
2331
|
+
unstated?: readonly UnstatedPlace[];
|
|
1677
2332
|
};
|
|
1678
2333
|
export type CheckNotes = {
|
|
1679
2334
|
readonly missingTypes: readonly MissingTypes[];
|
|
1680
2335
|
readonly looseNulls: readonly string[];
|
|
2336
|
+
readonly unreadTestConfigs: readonly string[];
|
|
2337
|
+
/**
|
|
2338
|
+
* The config's `facts` lines whose name finds no declaration in their package's types, one
|
|
2339
|
+
* warning each, with the closest declared path when one is near; and those whose `throws` or
|
|
2340
|
+
* `rejects` fits none of the functions they name, with the kind that does.
|
|
2341
|
+
*/
|
|
2342
|
+
readonly unmatchedFacts: readonly string[];
|
|
2343
|
+
/**
|
|
2344
|
+
* The config's `facts` lines whose package's types could not be read, so whether they name a
|
|
2345
|
+
* declaration is not known: "not checked: whether `ioredis` declares `Redis.hget`: <reason>".
|
|
2346
|
+
*/
|
|
2347
|
+
readonly factsNotChecked: readonly string[];
|
|
2348
|
+
/**
|
|
2349
|
+
* The config's facts for a package that this project runs another version of than their
|
|
2350
|
+
* `"@versions"` says, or whose version is not known: they are not applied, one warning each.
|
|
2351
|
+
*/
|
|
2352
|
+
readonly factsOutOfRange: readonly string[];
|
|
1681
2353
|
};
|
|
1682
2354
|
/** Rules that could not run because a library's types do not resolve, and the reason in words. */
|
|
1683
2355
|
export type MissingTypes = {
|
|
@@ -1686,4 +2358,5 @@ export type MissingTypes = {
|
|
|
1686
2358
|
readonly reason: string;
|
|
1687
2359
|
readonly rules: readonly string[];
|
|
1688
2360
|
};
|
|
2361
|
+
export {};
|
|
1689
2362
|
//# sourceMappingURL=types.d.ts.map
|