@starci/eslint-canon-be 3.4.57 → 3.6.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/CHANGELOG.md +19 -0
- package/README.md +11 -2
- package/dist/ambient-id.d.ts +9 -0
- package/{ambient-id.mjs → dist/ambient-id.js} +43 -39
- package/dist/app-composition.d.ts +21 -0
- package/{app-composition.mjs → dist/app-composition.js} +396 -300
- package/dist/async-discipline.d.ts +9 -0
- package/dist/async-discipline.js +77 -0
- package/dist/authorization.d.ts +12 -0
- package/{authorization.mjs → dist/authorization.js} +53 -59
- package/dist/boundary-schema.d.ts +15 -0
- package/{boundary-schema.mjs → dist/boundary-schema.js} +120 -105
- package/dist/builders.d.ts +21 -0
- package/{builders.mjs → dist/builders.js} +162 -146
- package/dist/cli.d.ts +15 -0
- package/{cli.mjs → dist/cli.js} +97 -82
- package/dist/comments.d.ts +52 -0
- package/dist/comments.js +412 -0
- package/dist/config-owner.d.ts +24 -0
- package/{config-owner.mjs → dist/config-owner.js} +256 -219
- package/dist/connections.d.ts +12 -0
- package/{connections.mjs → dist/connections.js} +138 -140
- package/dist/cookies.d.ts +9 -0
- package/{cookies.mjs → dist/cookies.js} +58 -58
- package/dist/cqrs.d.ts +27 -0
- package/{cqrs.mjs → dist/cqrs.js} +341 -282
- package/dist/data-access.d.ts +50 -0
- package/{data-access.mjs → dist/data-access.js} +238 -243
- package/dist/default-deny.d.ts +15 -0
- package/{default-deny.mjs → dist/default-deny.js} +103 -88
- package/dist/e2e-flow.d.ts +25 -0
- package/{e2e-flow.mjs → dist/e2e-flow.js} +113 -112
- package/dist/edge-hardening.d.ts +10 -0
- package/dist/edge-hardening.js +173 -0
- package/dist/error-handling.d.ts +21 -0
- package/{error-handling.mjs → dist/error-handling.js} +289 -239
- package/dist/event-bus.d.ts +14 -0
- package/{event-bus.mjs → dist/event-bus.js} +146 -129
- package/dist/feature-thin.d.ts +12 -0
- package/{feature-thin.mjs → dist/feature-thin.js} +208 -191
- package/dist/function-budget.d.ts +7 -0
- package/{function-budget.mjs → dist/function-budget.js} +24 -27
- package/dist/health-ready.d.ts +10 -0
- package/dist/health-ready.js +703 -0
- package/dist/idempotency.d.ts +10 -0
- package/{idempotency.mjs → dist/idempotency.js} +296 -226
- package/dist/index.d.ts +54 -0
- package/{index.mjs → dist/index.js} +91 -109
- package/dist/infra-owner.d.ts +18 -0
- package/{infra-owner.mjs → dist/infra-owner.js} +58 -51
- package/dist/injection.d.ts +30 -0
- package/{injection.mjs → dist/injection.js} +397 -344
- package/dist/input-bounds.d.ts +15 -0
- package/{input-bounds.mjs → dist/input-bounds.js} +143 -132
- package/dist/jobs.d.ts +17 -0
- package/{jobs.mjs → dist/jobs.js} +116 -99
- package/dist/jwt-alg.d.ts +6 -0
- package/dist/jwt-alg.js +49 -0
- package/dist/lib/app-roles.d.ts +25 -0
- package/{lib/app-roles.mjs → dist/lib/app-roles.js} +15 -17
- package/dist/lib/ast.d.ts +40 -0
- package/dist/lib/ast.js +100 -0
- package/dist/lib/client-idempotency.d.ts +3 -0
- package/{lib/client-idempotency.mjs → dist/lib/client-idempotency.js} +316 -268
- package/dist/lib/config.d.ts +36 -0
- package/{lib/config.mjs → dist/lib/config.js} +24 -27
- package/dist/lib/db-writes.d.ts +29 -0
- package/{lib/db-writes.mjs → dist/lib/db-writes.js} +27 -27
- package/dist/lib/declared.d.ts +77 -0
- package/{lib/declared.mjs → dist/lib/declared.js} +83 -78
- package/dist/lib/doors.d.ts +50 -0
- package/{lib/doors.mjs → dist/lib/doors.js} +45 -50
- package/dist/lib/edition.d.ts +25 -0
- package/{lib/edition.mjs → dist/lib/edition.js} +15 -20
- package/dist/lib/entity-writes.d.ts +7 -0
- package/{lib/entity-writes.mjs → dist/lib/entity-writes.js} +31 -22
- package/dist/lib/hfs.d.ts +34 -0
- package/{lib/hfs.mjs → dist/lib/hfs.js} +31 -29
- package/dist/lib/import-source.d.ts +63 -0
- package/dist/lib/import-source.js +134 -0
- package/dist/lib/path.d.ts +8 -0
- package/{lib/path.mjs → dist/lib/path.js} +4 -7
- package/dist/lib/persistence.d.ts +115 -0
- package/{lib/persistence.mjs → dist/lib/persistence.js} +55 -66
- package/dist/lib/ports.d.ts +70 -0
- package/{lib/ports.mjs → dist/lib/ports.js} +62 -66
- package/dist/lib/rule.d.ts +31 -0
- package/dist/lib/rule.js +2 -0
- package/dist/lib/runtime-root.d.ts +4 -0
- package/dist/lib/runtime-root.js +10 -0
- package/dist/lib/schema-values.d.ts +13 -0
- package/{lib/schema-values.mjs → dist/lib/schema-values.js} +67 -59
- package/dist/lib/specifier.d.ts +12 -0
- package/dist/lib/specifier.js +29 -0
- package/dist/lib/subject-values.d.ts +4 -0
- package/dist/lib/subject-values.js +61 -0
- package/dist/lib/transactions.d.ts +18 -0
- package/{lib/transactions.mjs → dist/lib/transactions.js} +17 -15
- package/dist/lib/transport-slots.d.ts +17 -0
- package/{lib/transport-slots.mjs → dist/lib/transport-slots.js} +2 -4
- package/dist/lib/types.d.ts +96 -0
- package/dist/lib/types.js +150 -0
- package/dist/lib/unit-spec.d.ts +48 -0
- package/{lib/unit-spec.mjs → dist/lib/unit-spec.js} +35 -44
- package/dist/lib/webhook-ack.d.ts +4 -0
- package/{lib/webhook-ack.mjs → dist/lib/webhook-ack.js} +78 -62
- package/dist/lib/webhook-handoff-inbox.d.ts +3 -0
- package/{lib/webhook-handoff-inbox.mjs → dist/lib/webhook-handoff-inbox.js} +195 -167
- package/dist/lib/webhook-handoff-intake.d.ts +4 -0
- package/{lib/webhook-handoff-intake.mjs → dist/lib/webhook-handoff-intake.js} +125 -102
- package/dist/lib/webhook-handoff.d.ts +15 -0
- package/{lib/webhook-handoff.mjs → dist/lib/webhook-handoff.js} +107 -100
- package/dist/lib/webhook-verifiers.d.ts +20 -0
- package/{lib/webhook-verifiers.mjs → dist/lib/webhook-verifiers.js} +108 -104
- package/dist/lib/why.d.ts +9 -0
- package/{lib/why.mjs → dist/lib/why.js} +6 -6
- package/dist/log-safety.d.ts +20 -0
- package/dist/log-safety.js +308 -0
- package/dist/module-layering.d.ts +42 -0
- package/dist/module-layering.js +257 -0
- package/dist/module-shape.d.ts +47 -0
- package/{module-shape.mjs → dist/module-shape.js} +278 -236
- package/dist/naming.d.ts +49 -0
- package/dist/naming.js +246 -0
- package/dist/observability.d.ts +25 -0
- package/dist/observability.js +245 -0
- package/dist/operations.d.ts +23 -0
- package/{operations.mjs → dist/operations.js} +410 -332
- package/dist/project-graph.d.ts +9 -0
- package/{project-graph.mjs → dist/project-graph.js} +8 -13
- package/dist/projections.d.ts +11 -0
- package/{projections.mjs → dist/projections.js} +60 -57
- package/dist/query-safety.d.ts +21 -0
- package/{query-safety.mjs → dist/query-safety.js} +92 -108
- package/dist/realtime.d.ts +15 -0
- package/{realtime.mjs → dist/realtime.js} +108 -106
- package/dist/resilience.d.ts +15 -0
- package/dist/resilience.js +319 -0
- package/dist/schema-authority.d.ts +15 -0
- package/{schema-authority.mjs → dist/schema-authority.js} +256 -220
- package/dist/service-deps.d.ts +17 -0
- package/{service-deps.mjs → dist/service-deps.js} +133 -130
- package/dist/service-isolation.d.ts +8 -0
- package/dist/service-isolation.js +76 -0
- package/dist/size-budget.d.ts +9 -0
- package/{size-budget.mjs → dist/size-budget.js} +27 -27
- package/dist/sonar-parity.d.ts +5 -0
- package/{sonar-parity.mjs → dist/sonar-parity.js} +7 -7
- package/dist/spec-no-skip.d.ts +9 -0
- package/dist/spec-no-skip.js +81 -0
- package/dist/spec-quality.d.ts +10 -0
- package/{spec-quality.mjs → dist/spec-quality.js} +103 -87
- package/dist/suppression.d.ts +26 -0
- package/{suppression.mjs → dist/suppression.js} +30 -45
- package/dist/temporal.d.ts +9 -0
- package/{temporal.mjs → dist/temporal.js} +75 -65
- package/dist/test-world.d.ts +28 -0
- package/{test-world.mjs → dist/test-world.js} +102 -83
- package/dist/testing.d.ts +51 -0
- package/dist/testing.js +368 -0
- package/dist/third-party-owner.d.ts +8 -0
- package/{third-party-owner.mjs → dist/third-party-owner.js} +105 -91
- package/dist/transport.d.ts +24 -0
- package/{transport.mjs → dist/transport.js} +279 -240
- package/dist/type-safety.d.ts +25 -0
- package/dist/type-safety.js +297 -0
- package/dist/unit-spec.d.ts +30 -0
- package/{unit-spec.mjs → dist/unit-spec.js} +473 -399
- package/dist/uploads.d.ts +9 -0
- package/{uploads.mjs → dist/uploads.js} +62 -54
- package/dist/user-copy.d.ts +9 -0
- package/{user-copy.mjs → dist/user-copy.js} +76 -67
- package/dist/webhooks.d.ts +16 -0
- package/{webhooks.mjs → dist/webhooks.js} +243 -231
- package/package.json +17 -8
- package/runtime/knowledge/hfs/canon-pins.yaml +22 -14
- package/runtime/knowledge/hfs/rules.yaml +23 -0
- package/runtime/scripts/lib/package-at.mjs +5 -5
- package/async-discipline.mjs +0 -83
- package/comments.mjs +0 -416
- package/edge-hardening.mjs +0 -139
- package/health-ready.mjs +0 -539
- package/jwt-alg.mjs +0 -45
- package/lib/ast.mjs +0 -88
- package/lib/import-source.mjs +0 -104
- package/lib/specifier.mjs +0 -27
- package/lib/subject-values.mjs +0 -55
- package/lib/types.mjs +0 -133
- package/log-safety.mjs +0 -303
- package/module-layering.mjs +0 -270
- package/naming.mjs +0 -251
- package/observability.mjs +0 -241
- package/resilience.mjs +0 -304
- package/service-isolation.mjs +0 -75
- package/spec-no-skip.mjs +0 -85
- package/testing.mjs +0 -384
- package/type-safety.mjs +0 -323
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { TSESLint } from "@typescript-eslint/utils";
|
|
2
|
+
import type { CanonPlugin } from "./lib/config.js";
|
|
3
|
+
import type { HfsView } from "./lib/hfs.js";
|
|
4
|
+
import type { RuleEntry, RuleModule } from "./lib/rule.js";
|
|
5
|
+
/** One (law, rule name) pair as a law declares it. */
|
|
6
|
+
interface RuleDeclaration {
|
|
7
|
+
law: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
10
|
+
/** Every gathered law. */
|
|
11
|
+
export declare const lawOwners: string[];
|
|
12
|
+
/**
|
|
13
|
+
* Every (law, rule name) pair as DECLARED, before any collapsing.
|
|
14
|
+
*
|
|
15
|
+
* This exists because `ruleOwners` and `rules` below are both built with `Object.fromEntries`, which
|
|
16
|
+
* silently keeps the last writer when two laws declare one name. A test that walks either of them
|
|
17
|
+
* therefore cannot see a collision: the duplicate is already gone by the time it looks, so every
|
|
18
|
+
* name appears exactly once BY CONSTRUCTION and the check passes forever while being blind.
|
|
19
|
+
*
|
|
20
|
+
* That is exactly what happened - three back-end rules were declared by two laws each, one copy was
|
|
21
|
+
* discarded on import, and the guard reported green the whole time. A gate that cannot fail is
|
|
22
|
+
* indistinguishable from no gate, so the raw declarations are published here and the guard walks
|
|
23
|
+
* these instead.
|
|
24
|
+
*/
|
|
25
|
+
export declare const ruleDeclarations: RuleDeclaration[];
|
|
26
|
+
/**
|
|
27
|
+
* Which law declares each rule.
|
|
28
|
+
*
|
|
29
|
+
* Exported because a failing rule is a question about a LAW, and the shortest path from a build log
|
|
30
|
+
* to the document that explains it is this map. It answers "who owns this name" for a name that
|
|
31
|
+
* SHIPPED; proving no two laws claim one name is `ruleDeclarations`' job, not this map's.
|
|
32
|
+
*/
|
|
33
|
+
export declare const ruleOwners: Record<string, string>;
|
|
34
|
+
/** Every rule this canon publishes, keyed by its published name. */
|
|
35
|
+
export declare const rules: Record<string, RuleModule>;
|
|
36
|
+
/**
|
|
37
|
+
* The levels this canon asks for: every rule at `error`. There is no `warn` and no burn-down level; a rule with
|
|
38
|
+
* debt is fixed in the repositories before it ships, never published weaker.
|
|
39
|
+
*/
|
|
40
|
+
export declare const recommended: Record<string, RuleEntry>;
|
|
41
|
+
/** The plugin object, shaped the way a flat config expects it. */
|
|
42
|
+
declare const plugin: CanonPlugin;
|
|
43
|
+
export default plugin;
|
|
44
|
+
/**
|
|
45
|
+
* The whole flat config of a back end: `export default starciBeConfig({ hfs: loadHfs(import.meta.url) })`.
|
|
46
|
+
*
|
|
47
|
+
* @param input - The HFS view of the repository.
|
|
48
|
+
* @returns The flat config.
|
|
49
|
+
*/
|
|
50
|
+
export declare const starciBeConfig: ({ hfs }: {
|
|
51
|
+
hfs?: HfsView | null | undefined;
|
|
52
|
+
}) => Promise<TSESLint.FlatConfig.ConfigArray>;
|
|
53
|
+
export { linterOptions } from "./lib/config.js";
|
|
54
|
+
export { loadHfs } from "./lib/hfs.js";
|
|
@@ -16,60 +16,59 @@
|
|
|
16
16
|
* every conversation about the failure. Aliasing one here to match a target's older spelling would
|
|
17
17
|
* leave two names for one rule and no way to tell which a message came from.
|
|
18
18
|
*/
|
|
19
|
-
import { buildBeConfig } from "./lib/config.
|
|
20
|
-
import { pluginForEdition } from "./lib/edition.
|
|
21
|
-
import { recommended as ambientIdRecommended, rules as ambientIdRules } from "./ambient-id.
|
|
22
|
-
import { recommended as appCompositionRecommended, rules as appCompositionRules } from "./app-composition.
|
|
23
|
-
import { recommended as asyncDisciplineRecommended, rules as asyncDisciplineRules } from "./async-discipline.
|
|
24
|
-
import { recommended as authorizationRecommended, rules as authorizationRules } from "./authorization.
|
|
25
|
-
import { recommended as buildersRecommended, rules as buildersRules } from "./builders.
|
|
26
|
-
import { recommended as commentsRecommended, rules as commentsRules } from "./comments.
|
|
27
|
-
import { recommended as configOwnerRecommended, rules as configOwnerRules } from "./config-owner.
|
|
28
|
-
import { recommended as connectionsRecommended, rules as connectionsRules } from "./connections.
|
|
29
|
-
import { recommended as cookiesRecommended, rules as cookiesRules } from "./cookies.
|
|
30
|
-
import { recommended as cqrsRecommended, rules as cqrsRules } from "./cqrs.
|
|
31
|
-
import { recommended as dataAccessRecommended, rules as dataAccessRules } from "./data-access.
|
|
32
|
-
import { recommended as defaultDenyRecommended, rules as defaultDenyRules } from "./default-deny.
|
|
33
|
-
import { recommended as eventBusRecommended, rules as eventBusRules } from "./event-bus.
|
|
34
|
-
import { recommended as jobsRecommended, rules as jobsRules } from "./jobs.
|
|
35
|
-
import { recommended as projectionsRecommended, rules as projectionsRules } from "./projections.
|
|
36
|
-
import { recommended as e2eFlowRecommended, rules as e2eFlowRules } from "./e2e-flow.
|
|
37
|
-
import { recommended as errorHandlingRecommended, rules as errorHandlingRules } from "./error-handling.
|
|
38
|
-
import { recommended as idempotencyRecommended, rules as idempotencyRules } from "./idempotency.
|
|
39
|
-
import { recommended as infraOwnerRecommended, rules as infraOwnerRules } from "./infra-owner.
|
|
40
|
-
import { recommended as injectionRecommended, rules as injectionRules } from "./injection.
|
|
41
|
-
import { recommended as boundarySchemaRecommended, rules as boundarySchemaRules } from "./boundary-schema.
|
|
42
|
-
import { recommended as inputBoundsRecommended, rules as inputBoundsRules } from "./input-bounds.
|
|
43
|
-
import { recommended as logSafetyRecommended, rules as logSafetyRules } from "./log-safety.
|
|
44
|
-
import { recommended as moduleLayeringRecommended, rules as moduleLayeringRules } from "./module-layering.
|
|
45
|
-
import { recommended as moduleShapeRecommended, rules as moduleShapeRules } from "./module-shape.
|
|
46
|
-
import { recommended as namingRecommended, rules as namingRules } from "./naming.
|
|
47
|
-
import { recommended as observabilityRecommended, rules as observabilityRules } from "./observability.
|
|
48
|
-
import { recommended as operationsRecommended, rules as operationsRules } from "./operations.
|
|
49
|
-
import { recommended as querySafetyRecommended, rules as querySafetyRules } from "./query-safety.
|
|
50
|
-
import { recommended as resilienceRecommended, rules as resilienceRules } from "./resilience.
|
|
51
|
-
import { recommended as schemaAuthorityRecommended, rules as schemaAuthorityRules } from "./schema-authority.
|
|
52
|
-
import { recommended as cliRecommended, rules as cliRules } from "./cli.
|
|
53
|
-
import { recommended as serviceDepsRecommended, rules as serviceDepsRules } from "./service-deps.
|
|
54
|
-
import { recommended as serviceIsolationRecommended, rules as serviceIsolationRules } from "./service-isolation.
|
|
55
|
-
import { recommended as sizeBudgetRecommended, rules as sizeBudgetRules } from "./size-budget.
|
|
56
|
-
import { recommended as specNoSkipRecommended, rules as specNoSkipRules } from "./spec-no-skip.
|
|
57
|
-
import { recommended as specQualityRecommended, rules as specQualityRules } from "./spec-quality.
|
|
58
|
-
import { recommended as suppressionRecommended, rules as suppressionRules } from "./suppression.
|
|
59
|
-
import { recommended as temporalRecommended, rules as temporalRules } from "./temporal.
|
|
60
|
-
import { recommended as testingRecommended, rules as testingRules } from "./testing.
|
|
61
|
-
import { recommended as testWorldRecommended, rules as testWorldRules } from "./test-world.
|
|
62
|
-
import { recommended as transportRecommended, rules as transportRules } from "./transport.
|
|
63
|
-
import { recommended as typeSafetyRecommended, rules as typeSafetyRules } from "./type-safety.
|
|
64
|
-
import { recommended as unitSpecRecommended, rules as unitSpecRules } from "./unit-spec.
|
|
65
|
-
import { recommended as uploadsRecommended, rules as uploadsRules } from "./uploads.
|
|
66
|
-
import { recommended as userCopyRecommended, rules as userCopyRules } from "./user-copy.
|
|
67
|
-
import { recommended as webhooksRecommended, rules as webhooksRules } from "./webhooks.
|
|
68
|
-
import { recommended as realtimeRecommended, rules as realtimeRules } from "./realtime.
|
|
69
|
-
import { recommended as featureThinRecommended, rules as featureThinRules } from "./feature-thin.
|
|
70
|
-
import { recommended as projectGraphRecommended, rules as projectGraphRules } from "./project-graph.
|
|
71
|
-
import { recommended as sonarParityRecommended, rules as sonarParityRules } from "./sonar-parity.
|
|
72
|
-
|
|
19
|
+
import { buildBeConfig } from "./lib/config.js";
|
|
20
|
+
import { pluginForEdition } from "./lib/edition.js";
|
|
21
|
+
import { recommended as ambientIdRecommended, rules as ambientIdRules } from "./ambient-id.js";
|
|
22
|
+
import { recommended as appCompositionRecommended, rules as appCompositionRules } from "./app-composition.js";
|
|
23
|
+
import { recommended as asyncDisciplineRecommended, rules as asyncDisciplineRules } from "./async-discipline.js";
|
|
24
|
+
import { recommended as authorizationRecommended, rules as authorizationRules } from "./authorization.js";
|
|
25
|
+
import { recommended as buildersRecommended, rules as buildersRules } from "./builders.js";
|
|
26
|
+
import { recommended as commentsRecommended, rules as commentsRules } from "./comments.js";
|
|
27
|
+
import { recommended as configOwnerRecommended, rules as configOwnerRules } from "./config-owner.js";
|
|
28
|
+
import { recommended as connectionsRecommended, rules as connectionsRules } from "./connections.js";
|
|
29
|
+
import { recommended as cookiesRecommended, rules as cookiesRules } from "./cookies.js";
|
|
30
|
+
import { recommended as cqrsRecommended, rules as cqrsRules } from "./cqrs.js";
|
|
31
|
+
import { recommended as dataAccessRecommended, rules as dataAccessRules } from "./data-access.js";
|
|
32
|
+
import { recommended as defaultDenyRecommended, rules as defaultDenyRules } from "./default-deny.js";
|
|
33
|
+
import { recommended as eventBusRecommended, rules as eventBusRules } from "./event-bus.js";
|
|
34
|
+
import { recommended as jobsRecommended, rules as jobsRules } from "./jobs.js";
|
|
35
|
+
import { recommended as projectionsRecommended, rules as projectionsRules } from "./projections.js";
|
|
36
|
+
import { recommended as e2eFlowRecommended, rules as e2eFlowRules } from "./e2e-flow.js";
|
|
37
|
+
import { recommended as errorHandlingRecommended, rules as errorHandlingRules } from "./error-handling.js";
|
|
38
|
+
import { recommended as idempotencyRecommended, rules as idempotencyRules } from "./idempotency.js";
|
|
39
|
+
import { recommended as infraOwnerRecommended, rules as infraOwnerRules } from "./infra-owner.js";
|
|
40
|
+
import { recommended as injectionRecommended, rules as injectionRules } from "./injection.js";
|
|
41
|
+
import { recommended as boundarySchemaRecommended, rules as boundarySchemaRules } from "./boundary-schema.js";
|
|
42
|
+
import { recommended as inputBoundsRecommended, rules as inputBoundsRules } from "./input-bounds.js";
|
|
43
|
+
import { recommended as logSafetyRecommended, rules as logSafetyRules } from "./log-safety.js";
|
|
44
|
+
import { recommended as moduleLayeringRecommended, rules as moduleLayeringRules } from "./module-layering.js";
|
|
45
|
+
import { recommended as moduleShapeRecommended, rules as moduleShapeRules } from "./module-shape.js";
|
|
46
|
+
import { recommended as namingRecommended, rules as namingRules } from "./naming.js";
|
|
47
|
+
import { recommended as observabilityRecommended, rules as observabilityRules } from "./observability.js";
|
|
48
|
+
import { recommended as operationsRecommended, rules as operationsRules } from "./operations.js";
|
|
49
|
+
import { recommended as querySafetyRecommended, rules as querySafetyRules } from "./query-safety.js";
|
|
50
|
+
import { recommended as resilienceRecommended, rules as resilienceRules } from "./resilience.js";
|
|
51
|
+
import { recommended as schemaAuthorityRecommended, rules as schemaAuthorityRules } from "./schema-authority.js";
|
|
52
|
+
import { recommended as cliRecommended, rules as cliRules } from "./cli.js";
|
|
53
|
+
import { recommended as serviceDepsRecommended, rules as serviceDepsRules } from "./service-deps.js";
|
|
54
|
+
import { recommended as serviceIsolationRecommended, rules as serviceIsolationRules } from "./service-isolation.js";
|
|
55
|
+
import { recommended as sizeBudgetRecommended, rules as sizeBudgetRules } from "./size-budget.js";
|
|
56
|
+
import { recommended as specNoSkipRecommended, rules as specNoSkipRules } from "./spec-no-skip.js";
|
|
57
|
+
import { recommended as specQualityRecommended, rules as specQualityRules } from "./spec-quality.js";
|
|
58
|
+
import { recommended as suppressionRecommended, rules as suppressionRules } from "./suppression.js";
|
|
59
|
+
import { recommended as temporalRecommended, rules as temporalRules } from "./temporal.js";
|
|
60
|
+
import { recommended as testingRecommended, rules as testingRules } from "./testing.js";
|
|
61
|
+
import { recommended as testWorldRecommended, rules as testWorldRules } from "./test-world.js";
|
|
62
|
+
import { recommended as transportRecommended, rules as transportRules } from "./transport.js";
|
|
63
|
+
import { recommended as typeSafetyRecommended, rules as typeSafetyRules } from "./type-safety.js";
|
|
64
|
+
import { recommended as unitSpecRecommended, rules as unitSpecRules } from "./unit-spec.js";
|
|
65
|
+
import { recommended as uploadsRecommended, rules as uploadsRules } from "./uploads.js";
|
|
66
|
+
import { recommended as userCopyRecommended, rules as userCopyRules } from "./user-copy.js";
|
|
67
|
+
import { recommended as webhooksRecommended, rules as webhooksRules } from "./webhooks.js";
|
|
68
|
+
import { recommended as realtimeRecommended, rules as realtimeRules } from "./realtime.js";
|
|
69
|
+
import { recommended as featureThinRecommended, rules as featureThinRules } from "./feature-thin.js";
|
|
70
|
+
import { recommended as projectGraphRecommended, rules as projectGraphRules } from "./project-graph.js";
|
|
71
|
+
import { recommended as sonarParityRecommended, rules as sonarParityRules } from "./sonar-parity.js";
|
|
73
72
|
/** Each law's contribution, kept separate so a duplicate name is detectable rather than silent. */
|
|
74
73
|
const CONTRIBUTIONS = [
|
|
75
74
|
{ law: "project-graph", rules: projectGraphRules, recommended: projectGraphRecommended },
|
|
@@ -123,11 +122,9 @@ const CONTRIBUTIONS = [
|
|
|
123
122
|
{ law: "realtime", rules: realtimeRules, recommended: realtimeRecommended },
|
|
124
123
|
{ law: "feature-thin", rules: featureThinRules, recommended: featureThinRecommended },
|
|
125
124
|
{ law: "sonar-parity", rules: sonarParityRules, recommended: sonarParityRecommended },
|
|
126
|
-
]
|
|
127
|
-
|
|
125
|
+
];
|
|
128
126
|
/** Every gathered law. */
|
|
129
|
-
export const lawOwners = CONTRIBUTIONS.map((entry) => entry.law)
|
|
130
|
-
|
|
127
|
+
export const lawOwners = CONTRIBUTIONS.map((entry) => entry.law);
|
|
131
128
|
/**
|
|
132
129
|
* Every (law, rule name) pair as DECLARED, before any collapsing.
|
|
133
130
|
*
|
|
@@ -141,10 +138,7 @@ export const lawOwners = CONTRIBUTIONS.map((entry) => entry.law)
|
|
|
141
138
|
* indistinguishable from no gate, so the raw declarations are published here and the guard walks
|
|
142
139
|
* these instead.
|
|
143
140
|
*/
|
|
144
|
-
export const ruleDeclarations = CONTRIBUTIONS.flatMap((entry) =>
|
|
145
|
-
Object.keys(entry.rules).map((name) => ({ law: entry.law, name })),
|
|
146
|
-
)
|
|
147
|
-
|
|
141
|
+
export const ruleDeclarations = CONTRIBUTIONS.flatMap((entry) => Object.keys(entry.rules).map((name) => ({ law: entry.law, name })));
|
|
148
142
|
/**
|
|
149
143
|
* Which law declares each rule.
|
|
150
144
|
*
|
|
@@ -152,75 +146,63 @@ export const ruleDeclarations = CONTRIBUTIONS.flatMap((entry) =>
|
|
|
152
146
|
* to the document that explains it is this map. It answers "who owns this name" for a name that
|
|
153
147
|
* SHIPPED; proving no two laws claim one name is `ruleDeclarations`' job, not this map's.
|
|
154
148
|
*/
|
|
155
|
-
export const ruleOwners = Object.fromEntries(
|
|
156
|
-
CONTRIBUTIONS.flatMap((entry) => Object.keys(entry.rules).map((name) => [name, entry.law])),
|
|
157
|
-
)
|
|
158
|
-
|
|
149
|
+
export const ruleOwners = Object.fromEntries(CONTRIBUTIONS.flatMap((entry) => Object.keys(entry.rules).map((name) => [name, entry.law])));
|
|
159
150
|
/** Every rule this canon publishes, keyed by its published name. */
|
|
160
|
-
export const rules = Object.fromEntries(
|
|
161
|
-
CONTRIBUTIONS.flatMap((entry) => Object.entries(entry.rules)),
|
|
162
|
-
)
|
|
163
|
-
|
|
151
|
+
export const rules = Object.fromEntries(CONTRIBUTIONS.flatMap((entry) => Object.entries(entry.rules)));
|
|
164
152
|
/**
|
|
165
153
|
* The levels this canon asks for: every rule at `error`. There is no `warn` and no burn-down level; a rule with
|
|
166
154
|
* debt is fixed in the repositories before it ships, never published weaker.
|
|
167
155
|
*/
|
|
168
|
-
export const recommended = Object.fromEntries(
|
|
169
|
-
CONTRIBUTIONS.flatMap((entry) => Object.entries(entry.recommended)),
|
|
170
|
-
)
|
|
171
|
-
|
|
156
|
+
export const recommended = Object.fromEntries(CONTRIBUTIONS.flatMap((entry) => Object.entries(entry.recommended)));
|
|
172
157
|
/** The plugin object, shaped the way a flat config expects it. */
|
|
173
158
|
const plugin = {
|
|
174
159
|
meta: { name: "eslint-plugin-starci-be" },
|
|
175
160
|
rules,
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
export default plugin
|
|
179
|
-
|
|
161
|
+
};
|
|
162
|
+
export default plugin;
|
|
180
163
|
/**
|
|
181
164
|
* The whole flat config of a back end: `export default starciBeConfig({ hfs: loadHfs(import.meta.url) })`.
|
|
182
165
|
*
|
|
183
|
-
* @param
|
|
184
|
-
* @returns
|
|
166
|
+
* @param input - The HFS view of the repository.
|
|
167
|
+
* @returns The flat config.
|
|
185
168
|
*/
|
|
186
|
-
export const starciBeConfig = ({ hfs }) => buildBeConfig({ hfs, plugin: pluginForEdition({ plugin, hfs }), recommended })
|
|
187
|
-
|
|
188
|
-
export {
|
|
189
|
-
export { loadHfs } from "./lib/hfs.mjs"
|
|
190
|
-
|
|
169
|
+
export const starciBeConfig = ({ hfs }) => buildBeConfig({ hfs, plugin: pluginForEdition({ plugin, hfs }), recommended });
|
|
170
|
+
export { linterOptions } from "./lib/config.js";
|
|
171
|
+
export { loadHfs } from "./lib/hfs.js";
|
|
191
172
|
// A12 registration is appended so the shared registry can be union-merged.
|
|
192
|
-
import { recommended as thirdPartyOwnerRecommended, rules as thirdPartyOwnerRules } from "./third-party-owner.
|
|
193
|
-
Object.assign(rules, thirdPartyOwnerRules)
|
|
194
|
-
Object.assign(recommended, thirdPartyOwnerRecommended)
|
|
195
|
-
lawOwners.push("third-party-owner")
|
|
173
|
+
import { recommended as thirdPartyOwnerRecommended, rules as thirdPartyOwnerRules } from "./third-party-owner.js";
|
|
174
|
+
Object.assign(rules, thirdPartyOwnerRules);
|
|
175
|
+
Object.assign(recommended, thirdPartyOwnerRecommended);
|
|
176
|
+
lawOwners.push("third-party-owner");
|
|
196
177
|
for (const name of Object.keys(thirdPartyOwnerRules)) {
|
|
197
|
-
ruleOwners[name] = "third-party-owner"
|
|
178
|
+
ruleOwners[name] = "third-party-owner";
|
|
198
179
|
// infra-owner also exposes these rules so the catalog's static contribution reader sees them.
|
|
199
|
-
const declaration = ruleDeclarations.find((entry) => entry.name === name)
|
|
200
|
-
if (declaration)
|
|
201
|
-
|
|
180
|
+
const declaration = ruleDeclarations.find((entry) => entry.name === name);
|
|
181
|
+
if (declaration)
|
|
182
|
+
declaration.law = "third-party-owner";
|
|
183
|
+
else
|
|
184
|
+
ruleDeclarations.push({ law: "third-party-owner", name });
|
|
202
185
|
}
|
|
203
186
|
// A21 append-only registration: keep the already exported plugin and recommendation live.
|
|
204
|
-
import { recommended as functionBudgetRecommended, rules as functionBudgetRules } from "./function-budget.
|
|
205
|
-
CONTRIBUTIONS.push({ law: "function-budget", rules: functionBudgetRules, recommended: functionBudgetRecommended })
|
|
206
|
-
lawOwners.push("function-budget")
|
|
207
|
-
ruleDeclarations.push(...Object.keys(functionBudgetRules).map((name) => ({ law: "function-budget", name })))
|
|
208
|
-
Object.assign(ruleOwners, Object.fromEntries(Object.keys(functionBudgetRules).map((name) => [name, "function-budget"])))
|
|
209
|
-
Object.assign(rules, functionBudgetRules)
|
|
210
|
-
Object.assign(recommended, functionBudgetRecommended)
|
|
187
|
+
import { recommended as functionBudgetRecommended, rules as functionBudgetRules } from "./function-budget.js";
|
|
188
|
+
CONTRIBUTIONS.push({ law: "function-budget", rules: functionBudgetRules, recommended: functionBudgetRecommended });
|
|
189
|
+
lawOwners.push("function-budget");
|
|
190
|
+
ruleDeclarations.push(...Object.keys(functionBudgetRules).map((name) => ({ law: "function-budget", name })));
|
|
191
|
+
Object.assign(ruleOwners, Object.fromEntries(Object.keys(functionBudgetRules).map((name) => [name, "function-budget"])));
|
|
192
|
+
Object.assign(rules, functionBudgetRules);
|
|
193
|
+
Object.assign(recommended, functionBudgetRecommended);
|
|
211
194
|
// A06 registrations are appended: the coordinator union-merges this shared registry.
|
|
212
|
-
import { recommended as edgeHardeningRecommended, rules as edgeHardeningRules } from "./edge-hardening.
|
|
213
|
-
import { recommended as healthReadyRecommended, rules as healthReadyRules } from "./health-ready.
|
|
214
|
-
import { recommended as jwtAlgRecommended, rules as jwtAlgRules } from "./jwt-alg.
|
|
215
|
-
|
|
195
|
+
import { recommended as edgeHardeningRecommended, rules as edgeHardeningRules } from "./edge-hardening.js";
|
|
196
|
+
import { recommended as healthReadyRecommended, rules as healthReadyRules } from "./health-ready.js";
|
|
197
|
+
import { recommended as jwtAlgRecommended, rules as jwtAlgRules } from "./jwt-alg.js";
|
|
216
198
|
for (const entry of [
|
|
217
199
|
{ law: "edge-hardening", rules: edgeHardeningRules, recommended: edgeHardeningRecommended },
|
|
218
200
|
{ law: "health-ready", rules: healthReadyRules, recommended: healthReadyRecommended },
|
|
219
201
|
{ law: "jwt-alg", rules: jwtAlgRules, recommended: jwtAlgRecommended },
|
|
220
202
|
]) {
|
|
221
|
-
lawOwners.push(entry.law)
|
|
222
|
-
ruleDeclarations.push(...Object.keys(entry.rules).map((name) => ({ law: entry.law, name })))
|
|
223
|
-
Object.assign(ruleOwners, Object.fromEntries(Object.keys(entry.rules).map((name) => [name, entry.law])))
|
|
224
|
-
Object.assign(rules, entry.rules)
|
|
225
|
-
Object.assign(recommended, entry.recommended)
|
|
203
|
+
lawOwners.push(entry.law);
|
|
204
|
+
ruleDeclarations.push(...Object.keys(entry.rules).map((name) => ({ law: entry.law, name })));
|
|
205
|
+
Object.assign(ruleOwners, Object.fromEntries(Object.keys(entry.rules).map((name) => [name, entry.law])));
|
|
206
|
+
Object.assign(rules, entry.rules);
|
|
207
|
+
Object.assign(recommended, entry.recommended);
|
|
226
208
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Recommended, RuleModule } from "./lib/rule.js";
|
|
2
|
+
/** A raw infrastructure library is used only inside the capability that owns it. */
|
|
3
|
+
export declare const infraImportOwner: RuleModule;
|
|
4
|
+
/**
|
|
5
|
+
* A provider is spoken to only by its integration (BE-INFRA-3): a call on the `HttpClient` port is made only in an
|
|
6
|
+
* `integrations` owner, in `platform/http` itself and in the test world. A domain service, a feature or another platform
|
|
7
|
+
* capability that calls an identity provider's token or admin endpoint, a mailer API or any other remote over HTTP holds a
|
|
8
|
+
* second copy of that provider's protocol, credentials and failure mapping; it calls the integration's public API instead.
|
|
9
|
+
*/
|
|
10
|
+
export declare const httpClientOnlyInIntegrations: RuleModule;
|
|
11
|
+
/** The rules this law contributes to the plugin. */
|
|
12
|
+
export declare const rules: {
|
|
13
|
+
"third-party-import-owner": RuleModule;
|
|
14
|
+
"infra-import-owner": RuleModule;
|
|
15
|
+
"http-client-only-in-integrations": RuleModule;
|
|
16
|
+
};
|
|
17
|
+
/** Every rule of this law at `error`. */
|
|
18
|
+
export declare const recommended: Recommended;
|
|
@@ -24,29 +24,27 @@
|
|
|
24
24
|
* by the receiver's TYPE) is called only in an `integrations` owner, `platform/http` itself and the test world, so an
|
|
25
25
|
* identity provider's token or admin endpoint, a mailer API or any other remote is spoken to by one integration only.
|
|
26
26
|
*/
|
|
27
|
-
import { hfsOf, inTestWorld } from "./lib/hfs.
|
|
28
|
-
import { moduleReferences } from "./lib/import-source.
|
|
29
|
-
import { isOwnedType } from "./lib/ports.
|
|
30
|
-
import { recommended as thirdPartyRecommended, rules as thirdPartyRules } from "./third-party-owner.
|
|
31
|
-
|
|
27
|
+
import { hfsOf, inTestWorld } from "./lib/hfs.js";
|
|
28
|
+
import { moduleReferences } from "./lib/import-source.js";
|
|
29
|
+
import { isOwnedType } from "./lib/ports.js";
|
|
30
|
+
import { recommended as thirdPartyRecommended, rules as thirdPartyRules } from "./third-party-owner.js";
|
|
32
31
|
/** The owner id of a file: the last two segments of its owner root (`platform/http`), or null when no owner holds it. */
|
|
33
32
|
const ownerIdOf = (hfs, filename) => {
|
|
34
|
-
const root = hfs.ownerOf(filename)
|
|
35
|
-
return root === null ? null : root.split("/").slice(-2).join("/")
|
|
36
|
-
}
|
|
37
|
-
|
|
33
|
+
const root = hfs.ownerOf(filename);
|
|
34
|
+
return root === null ? null : root.split("/").slice(-2).join("/");
|
|
35
|
+
};
|
|
38
36
|
/** The table key a module specifier falls under (the specifier itself or a subpath of it, with or without `node:`), or null. */
|
|
39
37
|
const keyOf = (table, specifier) => {
|
|
40
|
-
const variants = [specifier, specifier.startsWith("node:") ? specifier.slice(5) : `node:${specifier}`]
|
|
41
|
-
let best = null
|
|
38
|
+
const variants = [specifier, specifier.startsWith("node:") ? specifier.slice(5) : `node:${specifier}`];
|
|
39
|
+
let best = null;
|
|
42
40
|
for (const variant of variants) {
|
|
43
41
|
for (const key of Object.keys(table)) {
|
|
44
|
-
if ((variant === key || variant.startsWith(`${key}/`)) && (best === null || key.length > best.length))
|
|
42
|
+
if ((variant === key || variant.startsWith(`${key}/`)) && (best === null || key.length > best.length))
|
|
43
|
+
best = key;
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
|
-
return best
|
|
48
|
-
}
|
|
49
|
-
|
|
46
|
+
return best;
|
|
47
|
+
};
|
|
50
48
|
/** A raw infrastructure library is used only inside the capability that owns it. */
|
|
51
49
|
export const infraImportOwner = {
|
|
52
50
|
meta: {
|
|
@@ -59,42 +57,51 @@ export const infraImportOwner = {
|
|
|
59
57
|
},
|
|
60
58
|
},
|
|
61
59
|
create(context) {
|
|
62
|
-
const hfs = hfsOf(context)
|
|
63
|
-
const table = hfs.ruleParams.infraOwners
|
|
64
|
-
const here = ownerIdOf(hfs, context.filename)
|
|
65
|
-
const isWorld = inTestWorld(hfs, context.filename)
|
|
60
|
+
const hfs = hfsOf(context);
|
|
61
|
+
const table = hfs.ruleParams.infraOwners;
|
|
62
|
+
const here = ownerIdOf(hfs, context.filename);
|
|
63
|
+
const isWorld = inTestWorld(hfs, context.filename);
|
|
66
64
|
const check = (node, name, key) => {
|
|
67
|
-
const owners = table[key]
|
|
68
|
-
if (
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
const owners = table[key];
|
|
66
|
+
if (!owners)
|
|
67
|
+
return;
|
|
68
|
+
if ((here !== null && owners.includes(here)) || (isWorld && owners.length > 0 && !owners.includes("platform/logging")))
|
|
69
|
+
return;
|
|
70
|
+
if (owners.length === 0)
|
|
71
|
+
context.report({ node, messageId: "nowhere", data: { name } });
|
|
72
|
+
else
|
|
73
|
+
context.report({ node, messageId: "foreign", data: { name, owners: owners.map((owner) => `\`${owner}\``).join(", ") } });
|
|
74
|
+
};
|
|
72
75
|
return {
|
|
73
76
|
...moduleReferences(({ source, value }) => {
|
|
74
|
-
const key = keyOf(table, value)
|
|
75
|
-
if (key !== null)
|
|
77
|
+
const key = keyOf(table, value);
|
|
78
|
+
if (key !== null)
|
|
79
|
+
check(source, value, key);
|
|
76
80
|
}),
|
|
77
81
|
MemberExpression(node) {
|
|
78
|
-
if (node.computed || node.object.type !== "Identifier" || node.object.name !== "globalThis" || node.property.type !== "Identifier")
|
|
79
|
-
|
|
82
|
+
if (node.computed || node.object.type !== "Identifier" || node.object.name !== "globalThis" || node.property.type !== "Identifier")
|
|
83
|
+
return;
|
|
84
|
+
if (Object.hasOwn(table, node.property.name))
|
|
85
|
+
check(node, `globalThis.${node.property.name}`, node.property.name);
|
|
80
86
|
},
|
|
81
87
|
"Program:exit"() {
|
|
82
|
-
const globalScope = context.sourceCode.scopeManager
|
|
83
|
-
if (!globalScope)
|
|
84
|
-
|
|
88
|
+
const globalScope = context.sourceCode.scopeManager?.globalScope;
|
|
89
|
+
if (!globalScope)
|
|
90
|
+
return;
|
|
91
|
+
const references = [...globalScope.through, ...globalScope.variables.filter((variable) => variable.defs.length === 0).flatMap((variable) => variable.references)];
|
|
85
92
|
for (const reference of references) {
|
|
86
|
-
if (reference.isValueReference === false)
|
|
87
|
-
|
|
88
|
-
|
|
93
|
+
if (reference.isValueReference === false)
|
|
94
|
+
continue;
|
|
95
|
+
const name = reference.identifier.name;
|
|
96
|
+
if (Object.hasOwn(table, name))
|
|
97
|
+
check(reference.identifier, name, name);
|
|
89
98
|
}
|
|
90
99
|
},
|
|
91
|
-
}
|
|
100
|
+
};
|
|
92
101
|
},
|
|
93
|
-
}
|
|
94
|
-
|
|
102
|
+
};
|
|
95
103
|
/** The `HttpClient` port of `platform/http`: the one outbound HTTP door, judged by the receiver's TYPE. */
|
|
96
|
-
const isHttpClient = (context, node) => isOwnedType(context, node, { name: "HttpClient", capability: "http", tier: "platform" })
|
|
97
|
-
|
|
104
|
+
const isHttpClient = (context, node) => isOwnedType(context, node, { name: "HttpClient", capability: "http", tier: "platform" });
|
|
98
105
|
/**
|
|
99
106
|
* A provider is spoken to only by its integration (BE-INFRA-3): a call on the `HttpClient` port is made only in an
|
|
100
107
|
* `integrations` owner, in `platform/http` itself and in the test world. A domain service, a feature or another platform
|
|
@@ -111,29 +118,29 @@ export const httpClientOnlyInIntegrations = {
|
|
|
111
118
|
},
|
|
112
119
|
},
|
|
113
120
|
create(context) {
|
|
114
|
-
const hfs = hfsOf(context)
|
|
115
|
-
const file = context.filename
|
|
116
|
-
if (hfs.tierOf(file) === "integrations" || ownerIdOf(hfs, file) === "platform/http" || inTestWorld(hfs, file))
|
|
121
|
+
const hfs = hfsOf(context);
|
|
122
|
+
const file = context.filename;
|
|
123
|
+
if (hfs.tierOf(file) === "integrations" || ownerIdOf(hfs, file) === "platform/http" || inTestWorld(hfs, file))
|
|
124
|
+
return {};
|
|
117
125
|
return {
|
|
118
126
|
CallExpression(node) {
|
|
119
|
-
const callee = node.callee
|
|
120
|
-
if (callee.type !== "MemberExpression" || !isHttpClient(context, callee.object))
|
|
121
|
-
|
|
127
|
+
const callee = node.callee;
|
|
128
|
+
if (callee.type !== "MemberExpression" || !isHttpClient(context, callee.object))
|
|
129
|
+
return;
|
|
130
|
+
context.report({ node, messageId: "foreign", data: { call: context.sourceCode.getText(callee) } });
|
|
122
131
|
},
|
|
123
|
-
}
|
|
132
|
+
};
|
|
124
133
|
},
|
|
125
|
-
}
|
|
126
|
-
|
|
134
|
+
};
|
|
127
135
|
/** The rules this law contributes to the plugin. */
|
|
128
136
|
export const rules = {
|
|
129
137
|
"infra-import-owner": infraImportOwner,
|
|
130
138
|
"http-client-only-in-integrations": httpClientOnlyInIntegrations,
|
|
131
139
|
...thirdPartyRules,
|
|
132
|
-
}
|
|
133
|
-
|
|
140
|
+
};
|
|
134
141
|
/** Every rule of this law at `error`. */
|
|
135
142
|
export const recommended = {
|
|
136
143
|
"starci-be/infra-import-owner": "error",
|
|
137
144
|
"starci-be/http-client-only-in-integrations": "error",
|
|
138
145
|
...thirdPartyRecommended,
|
|
139
|
-
}
|
|
146
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type Recommended, type RuleModule } from "./lib/rule.js";
|
|
2
|
+
/** Raw injection lives only in `<owner>.decorators.ts`; injectors decorate constructor parameters. */
|
|
3
|
+
export declare const injectorOnly: RuleModule;
|
|
4
|
+
/** The shape of an injector, its token and the `provide:` tokens of a module. */
|
|
5
|
+
export declare const injectorShape: RuleModule;
|
|
6
|
+
/** `T` of the injector equals the parameter annotation. */
|
|
7
|
+
export declare const injectorTypeMatch: RuleModule;
|
|
8
|
+
/** A constructor parameter of an infrastructure type carries an injector. */
|
|
9
|
+
export declare const infraNeedsInjector: RuleModule;
|
|
10
|
+
/** An injected port of the table of `paramNames` is named the way every class names it. */
|
|
11
|
+
export declare const injectedParamName: RuleModule;
|
|
12
|
+
/** No service locator: `ModuleRef` is not imported, typed or called. */
|
|
13
|
+
export declare const noModuleRef: RuleModule;
|
|
14
|
+
/** No `forwardRef(`: a cycle is a layering finding, not a DI trick. */
|
|
15
|
+
export declare const noForwardRef: RuleModule;
|
|
16
|
+
/** A token is a class or a `unique symbol`, never a string. */
|
|
17
|
+
export declare const noStringToken: RuleModule;
|
|
18
|
+
/** The rules this law contributes to the plugin. */
|
|
19
|
+
export declare const rules: {
|
|
20
|
+
"injector-only": RuleModule;
|
|
21
|
+
"injector-shape": RuleModule;
|
|
22
|
+
"injector-type-match": RuleModule;
|
|
23
|
+
"infra-needs-injector": RuleModule;
|
|
24
|
+
"injected-param-name": RuleModule;
|
|
25
|
+
"no-module-ref": RuleModule;
|
|
26
|
+
"no-forward-ref": RuleModule;
|
|
27
|
+
"no-string-token": RuleModule;
|
|
28
|
+
};
|
|
29
|
+
/** All start at error: there is one way to inject and no baseline. */
|
|
30
|
+
export declare const recommended: Recommended;
|