@starci/eslint-canon-be 3.5.0 → 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.
Files changed (195) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +11 -2
  3. package/dist/ambient-id.d.ts +9 -0
  4. package/{ambient-id.mjs → dist/ambient-id.js} +43 -39
  5. package/dist/app-composition.d.ts +21 -0
  6. package/{app-composition.mjs → dist/app-composition.js} +396 -300
  7. package/dist/async-discipline.d.ts +9 -0
  8. package/dist/async-discipline.js +77 -0
  9. package/dist/authorization.d.ts +12 -0
  10. package/{authorization.mjs → dist/authorization.js} +53 -59
  11. package/dist/boundary-schema.d.ts +15 -0
  12. package/{boundary-schema.mjs → dist/boundary-schema.js} +120 -105
  13. package/dist/builders.d.ts +21 -0
  14. package/{builders.mjs → dist/builders.js} +162 -146
  15. package/dist/cli.d.ts +15 -0
  16. package/{cli.mjs → dist/cli.js} +97 -82
  17. package/dist/comments.d.ts +52 -0
  18. package/dist/comments.js +412 -0
  19. package/dist/config-owner.d.ts +24 -0
  20. package/{config-owner.mjs → dist/config-owner.js} +256 -219
  21. package/dist/connections.d.ts +12 -0
  22. package/{connections.mjs → dist/connections.js} +138 -140
  23. package/dist/cookies.d.ts +9 -0
  24. package/{cookies.mjs → dist/cookies.js} +58 -58
  25. package/dist/cqrs.d.ts +27 -0
  26. package/{cqrs.mjs → dist/cqrs.js} +341 -282
  27. package/dist/data-access.d.ts +50 -0
  28. package/{data-access.mjs → dist/data-access.js} +238 -243
  29. package/dist/default-deny.d.ts +15 -0
  30. package/{default-deny.mjs → dist/default-deny.js} +103 -88
  31. package/dist/e2e-flow.d.ts +25 -0
  32. package/{e2e-flow.mjs → dist/e2e-flow.js} +113 -112
  33. package/dist/edge-hardening.d.ts +10 -0
  34. package/dist/edge-hardening.js +173 -0
  35. package/dist/error-handling.d.ts +21 -0
  36. package/{error-handling.mjs → dist/error-handling.js} +289 -239
  37. package/dist/event-bus.d.ts +14 -0
  38. package/{event-bus.mjs → dist/event-bus.js} +146 -129
  39. package/dist/feature-thin.d.ts +12 -0
  40. package/{feature-thin.mjs → dist/feature-thin.js} +208 -191
  41. package/dist/function-budget.d.ts +7 -0
  42. package/{function-budget.mjs → dist/function-budget.js} +24 -27
  43. package/dist/health-ready.d.ts +10 -0
  44. package/dist/health-ready.js +703 -0
  45. package/dist/idempotency.d.ts +10 -0
  46. package/{idempotency.mjs → dist/idempotency.js} +296 -226
  47. package/dist/index.d.ts +54 -0
  48. package/{index.mjs → dist/index.js} +91 -109
  49. package/dist/infra-owner.d.ts +18 -0
  50. package/{infra-owner.mjs → dist/infra-owner.js} +58 -51
  51. package/dist/injection.d.ts +30 -0
  52. package/{injection.mjs → dist/injection.js} +397 -344
  53. package/dist/input-bounds.d.ts +15 -0
  54. package/{input-bounds.mjs → dist/input-bounds.js} +143 -132
  55. package/dist/jobs.d.ts +17 -0
  56. package/{jobs.mjs → dist/jobs.js} +116 -99
  57. package/dist/jwt-alg.d.ts +6 -0
  58. package/dist/jwt-alg.js +49 -0
  59. package/dist/lib/app-roles.d.ts +25 -0
  60. package/{lib/app-roles.mjs → dist/lib/app-roles.js} +15 -17
  61. package/dist/lib/ast.d.ts +40 -0
  62. package/dist/lib/ast.js +100 -0
  63. package/dist/lib/client-idempotency.d.ts +3 -0
  64. package/{lib/client-idempotency.mjs → dist/lib/client-idempotency.js} +316 -268
  65. package/dist/lib/config.d.ts +36 -0
  66. package/{lib/config.mjs → dist/lib/config.js} +24 -27
  67. package/dist/lib/db-writes.d.ts +29 -0
  68. package/{lib/db-writes.mjs → dist/lib/db-writes.js} +27 -27
  69. package/dist/lib/declared.d.ts +77 -0
  70. package/{lib/declared.mjs → dist/lib/declared.js} +83 -78
  71. package/dist/lib/doors.d.ts +50 -0
  72. package/{lib/doors.mjs → dist/lib/doors.js} +45 -50
  73. package/dist/lib/edition.d.ts +25 -0
  74. package/{lib/edition.mjs → dist/lib/edition.js} +15 -20
  75. package/dist/lib/entity-writes.d.ts +7 -0
  76. package/{lib/entity-writes.mjs → dist/lib/entity-writes.js} +31 -22
  77. package/dist/lib/hfs.d.ts +34 -0
  78. package/{lib/hfs.mjs → dist/lib/hfs.js} +31 -29
  79. package/dist/lib/import-source.d.ts +63 -0
  80. package/dist/lib/import-source.js +134 -0
  81. package/dist/lib/path.d.ts +8 -0
  82. package/{lib/path.mjs → dist/lib/path.js} +4 -7
  83. package/dist/lib/persistence.d.ts +115 -0
  84. package/{lib/persistence.mjs → dist/lib/persistence.js} +55 -66
  85. package/dist/lib/ports.d.ts +70 -0
  86. package/{lib/ports.mjs → dist/lib/ports.js} +62 -66
  87. package/dist/lib/rule.d.ts +31 -0
  88. package/dist/lib/rule.js +2 -0
  89. package/dist/lib/runtime-root.d.ts +4 -0
  90. package/dist/lib/runtime-root.js +10 -0
  91. package/dist/lib/schema-values.d.ts +13 -0
  92. package/{lib/schema-values.mjs → dist/lib/schema-values.js} +67 -59
  93. package/dist/lib/specifier.d.ts +12 -0
  94. package/dist/lib/specifier.js +29 -0
  95. package/dist/lib/subject-values.d.ts +4 -0
  96. package/dist/lib/subject-values.js +61 -0
  97. package/dist/lib/transactions.d.ts +18 -0
  98. package/{lib/transactions.mjs → dist/lib/transactions.js} +17 -15
  99. package/dist/lib/transport-slots.d.ts +17 -0
  100. package/{lib/transport-slots.mjs → dist/lib/transport-slots.js} +2 -4
  101. package/dist/lib/types.d.ts +96 -0
  102. package/dist/lib/types.js +150 -0
  103. package/dist/lib/unit-spec.d.ts +48 -0
  104. package/{lib/unit-spec.mjs → dist/lib/unit-spec.js} +35 -44
  105. package/dist/lib/webhook-ack.d.ts +4 -0
  106. package/{lib/webhook-ack.mjs → dist/lib/webhook-ack.js} +78 -62
  107. package/dist/lib/webhook-handoff-inbox.d.ts +3 -0
  108. package/{lib/webhook-handoff-inbox.mjs → dist/lib/webhook-handoff-inbox.js} +195 -167
  109. package/dist/lib/webhook-handoff-intake.d.ts +4 -0
  110. package/{lib/webhook-handoff-intake.mjs → dist/lib/webhook-handoff-intake.js} +125 -102
  111. package/dist/lib/webhook-handoff.d.ts +15 -0
  112. package/{lib/webhook-handoff.mjs → dist/lib/webhook-handoff.js} +107 -100
  113. package/dist/lib/webhook-verifiers.d.ts +20 -0
  114. package/{lib/webhook-verifiers.mjs → dist/lib/webhook-verifiers.js} +108 -104
  115. package/dist/lib/why.d.ts +9 -0
  116. package/{lib/why.mjs → dist/lib/why.js} +6 -6
  117. package/dist/log-safety.d.ts +20 -0
  118. package/dist/log-safety.js +308 -0
  119. package/dist/module-layering.d.ts +42 -0
  120. package/dist/module-layering.js +257 -0
  121. package/dist/module-shape.d.ts +47 -0
  122. package/{module-shape.mjs → dist/module-shape.js} +278 -236
  123. package/dist/naming.d.ts +49 -0
  124. package/dist/naming.js +246 -0
  125. package/dist/observability.d.ts +25 -0
  126. package/dist/observability.js +245 -0
  127. package/dist/operations.d.ts +23 -0
  128. package/{operations.mjs → dist/operations.js} +410 -332
  129. package/dist/project-graph.d.ts +9 -0
  130. package/{project-graph.mjs → dist/project-graph.js} +8 -13
  131. package/dist/projections.d.ts +11 -0
  132. package/{projections.mjs → dist/projections.js} +60 -57
  133. package/dist/query-safety.d.ts +21 -0
  134. package/{query-safety.mjs → dist/query-safety.js} +92 -108
  135. package/dist/realtime.d.ts +15 -0
  136. package/{realtime.mjs → dist/realtime.js} +108 -106
  137. package/dist/resilience.d.ts +15 -0
  138. package/dist/resilience.js +319 -0
  139. package/dist/schema-authority.d.ts +15 -0
  140. package/{schema-authority.mjs → dist/schema-authority.js} +256 -220
  141. package/dist/service-deps.d.ts +17 -0
  142. package/{service-deps.mjs → dist/service-deps.js} +133 -130
  143. package/dist/service-isolation.d.ts +8 -0
  144. package/dist/service-isolation.js +76 -0
  145. package/dist/size-budget.d.ts +9 -0
  146. package/{size-budget.mjs → dist/size-budget.js} +27 -27
  147. package/dist/sonar-parity.d.ts +5 -0
  148. package/{sonar-parity.mjs → dist/sonar-parity.js} +7 -7
  149. package/dist/spec-no-skip.d.ts +9 -0
  150. package/dist/spec-no-skip.js +81 -0
  151. package/dist/spec-quality.d.ts +10 -0
  152. package/{spec-quality.mjs → dist/spec-quality.js} +103 -87
  153. package/dist/suppression.d.ts +26 -0
  154. package/{suppression.mjs → dist/suppression.js} +30 -45
  155. package/dist/temporal.d.ts +9 -0
  156. package/{temporal.mjs → dist/temporal.js} +75 -65
  157. package/dist/test-world.d.ts +28 -0
  158. package/{test-world.mjs → dist/test-world.js} +102 -83
  159. package/dist/testing.d.ts +51 -0
  160. package/dist/testing.js +368 -0
  161. package/dist/third-party-owner.d.ts +8 -0
  162. package/{third-party-owner.mjs → dist/third-party-owner.js} +105 -91
  163. package/dist/transport.d.ts +24 -0
  164. package/{transport.mjs → dist/transport.js} +279 -240
  165. package/dist/type-safety.d.ts +25 -0
  166. package/dist/type-safety.js +297 -0
  167. package/dist/unit-spec.d.ts +30 -0
  168. package/{unit-spec.mjs → dist/unit-spec.js} +473 -399
  169. package/dist/uploads.d.ts +9 -0
  170. package/{uploads.mjs → dist/uploads.js} +62 -54
  171. package/dist/user-copy.d.ts +9 -0
  172. package/{user-copy.mjs → dist/user-copy.js} +76 -67
  173. package/dist/webhooks.d.ts +16 -0
  174. package/{webhooks.mjs → dist/webhooks.js} +243 -231
  175. package/package.json +17 -8
  176. package/runtime/knowledge/hfs/canon-pins.yaml +17 -10
  177. package/async-discipline.mjs +0 -83
  178. package/comments.mjs +0 -416
  179. package/edge-hardening.mjs +0 -139
  180. package/health-ready.mjs +0 -539
  181. package/jwt-alg.mjs +0 -45
  182. package/lib/ast.mjs +0 -88
  183. package/lib/import-source.mjs +0 -104
  184. package/lib/specifier.mjs +0 -27
  185. package/lib/subject-values.mjs +0 -55
  186. package/lib/types.mjs +0 -133
  187. package/log-safety.mjs +0 -303
  188. package/module-layering.mjs +0 -270
  189. package/naming.mjs +0 -251
  190. package/observability.mjs +0 -241
  191. package/resilience.mjs +0 -304
  192. package/service-isolation.mjs +0 -75
  193. package/spec-no-skip.mjs +0 -85
  194. package/testing.mjs +0 -384
  195. package/type-safety.mjs +0 -323
@@ -21,27 +21,15 @@
21
21
  * - `no-external-call-in-transaction` (R82) - inside a transaction callback, no call through a receiver typed from
22
22
  * `integrations/**`, `HttpClient` or `MessagePublisher`, and no `fetch`.
23
23
  */
24
-
25
- import ts from "typescript"
26
- import { walk } from "./lib/ast.mjs"
27
- import { hfsOf, inTestWorld } from "./lib/hfs.mjs"
28
- import { resolveVariable, transactionCallback } from "./lib/transactions.mjs"
29
- import {
30
- declaredInjectorNames,
31
- inDatabaseCapability,
32
- inCli,
33
- implementsMigration,
34
- infraTypeOf,
35
- injectionSites,
36
- isMigrationFile,
37
- } from "./lib/persistence.mjs"
38
- import { isPackageType, originsOfType, typed, typeOrigins } from "./lib/types.mjs"
39
-
24
+ import ts from "typescript";
25
+ import { nameOrValue, walk } from "./lib/ast.js";
26
+ import { hfsOf, inTestWorld } from "./lib/hfs.js";
27
+ import { resolveVariable, transactionCallback } from "./lib/transactions.js";
28
+ import { declaredInjectorNames, inDatabaseCapability, inCli, implementsMigration, infraTypeOf, injectionSites, isMigrationFile, } from "./lib/persistence.js";
29
+ import { isPackageType, originsOfType, typed, typeOrigins } from "./lib/types.js";
40
30
  /** The `typeorm` repository types no class receives. */
41
- const REPOSITORY_TYPES = ["Repository", "TreeRepository", "MongoRepository"]
42
-
31
+ const REPOSITORY_TYPES = ["Repository", "TreeRepository", "MongoRepository"];
43
32
  // -- R83: the injector ---------------------------------------------------------------------------------
44
-
45
33
  /** A constructor parameter typed `EntityManager` carries the named injector of a declared connection. */
46
34
  export const mustInjectEntityManager = {
47
35
  meta: {
@@ -49,163 +37,180 @@ export const mustInjectEntityManager = {
49
37
  docs: { description: "An injected `EntityManager` carries the named injector of a declared connection." },
50
38
  schema: [],
51
39
  messages: {
52
- undecorated:
53
- "`EntityManager` is injected without a named injector. The type alone does not say WHICH database this is; only `{{expected}}` names a declared connection (from `hfs.json`), and a lookalike or a bare `InjectEntityManager()` names none. Inject it with the injector of the connection this class reads.",
40
+ undecorated: "`EntityManager` is injected without a named injector. The type alone does not say WHICH database this is; only `{{expected}}` names a declared connection (from `hfs.json`), and a lookalike or a bare `InjectEntityManager()` names none. Inject it with the injector of the connection this class reads.",
54
41
  },
55
42
  },
56
43
  create(context) {
57
- const hfs = hfsOf(context)
58
- const expected = declaredInjectorNames(hfs)
44
+ const hfs = hfsOf(context);
45
+ const expected = declaredInjectorNames(hfs);
59
46
  return injectionSites(({ node, kind, decorators, annotation }) => {
60
- if (kind !== "param" || !annotation || infraTypeOf(context, annotation) !== "EntityManager") return
61
- if (decorators.some((name) => expected.includes(name))) return
62
- context.report({ node, messageId: "undecorated", data: { expected: expected.join("` or `") || "no injector (declare the connection in hfs.json)" } })
63
- })
47
+ if (kind !== "param" || !annotation || infraTypeOf(context, annotation) !== "EntityManager")
48
+ return;
49
+ if (decorators.some((name) => expected.includes(name)))
50
+ return;
51
+ context.report({ node, messageId: "undecorated", data: { expected: expected.join("` or `") || "no injector (declare the connection in hfs.json)" } });
52
+ });
64
53
  },
65
- }
66
-
54
+ };
67
55
  /** The shared manager is injected by name, as a constructor parameter, and called directly. */
68
56
  export const namedEntityManagerOnly = {
69
57
  meta: {
70
58
  type: "problem",
71
59
  docs: {
72
- description:
73
- "No property injection of an `EntityManager`, `DataSource` or `QueryRunner`; a `DataSource` or `QueryRunner` only in the platform database capability, the cli app and the test world (`src/tests/world`); no `getRepository`.",
60
+ description: "No property injection of an `EntityManager`, `DataSource` or `QueryRunner`; a `DataSource` or `QueryRunner` only in the platform database capability, the cli app and the test world (`src/tests/world`); no `getRepository`.",
74
61
  },
75
62
  schema: [],
76
63
  messages: {
77
- property:
78
- "`{{type}}` is injected as a class property. Property injection hides the dependency from the constructor and the app module. Receive the named-injector `EntityManager` as a constructor parameter.",
79
- infra:
80
- "`{{type}}` is injected here. A `DataSource` or `QueryRunner` is built and held only by the platform database capability, the cli app and the test world in `src/tests/world`; specs take `world.db.<connection>`; everything else injects the shared `EntityManager` through its named injector and calls it directly.",
81
- exposed:
82
- "`{{type}}` is written here outside the platform database capability, the cli app and the test world. A wrapper service that returns, holds or hands out a connection is the same door as injecting it: the connection is opened and held only by `platform/database`, and everything else calls the shared EntityManager through its named injector.",
83
- token:
84
- "This provider is bound to a `{{type}}`. A token that resolves to a connection object is a second door to the database: only `platform/database`, the cli app and the test world provide one.",
85
- wrapper:
86
- "`{{wrapper}}` exposes a `{{type}}` through `{{member}}`, and this class receives it. A connection wrapper is not a service dependency: inject the shared EntityManager with its named injector and call it directly.",
87
- getRepository:
88
- "`.getRepository(...)` binds a handle to ONE entity and hides which connection it came from. Call the shared manager directly: `manager.find(Entity, ...)`, `manager.save(Entity, ...)`, `tx.insert(Entity, ...)`.",
64
+ property: "`{{type}}` is injected as a class property. Property injection hides the dependency from the constructor and the app module. Receive the named-injector `EntityManager` as a constructor parameter.",
65
+ infra: "`{{type}}` is injected here. A `DataSource` or `QueryRunner` is built and held only by the platform database capability, the cli app and the test world in `src/tests/world`; specs take `world.db.<connection>`; everything else injects the shared `EntityManager` through its named injector and calls it directly.",
66
+ exposed: "`{{type}}` is written here outside the platform database capability, the cli app and the test world. A wrapper service that returns, holds or hands out a connection is the same door as injecting it: the connection is opened and held only by `platform/database`, and everything else calls the shared EntityManager through its named injector.",
67
+ token: "This provider is bound to a `{{type}}`. A token that resolves to a connection object is a second door to the database: only `platform/database`, the cli app and the test world provide one.",
68
+ wrapper: "`{{wrapper}}` exposes a `{{type}}` through `{{member}}`, and this class receives it. A connection wrapper is not a service dependency: inject the shared EntityManager with its named injector and call it directly.",
69
+ getRepository: "`.getRepository(...)` binds a handle to ONE entity and hides which connection it came from. Call the shared manager directly: `manager.find(Entity, ...)`, `manager.save(Entity, ...)`, `tx.insert(Entity, ...)`.",
89
70
  },
90
71
  },
91
72
  create(context) {
92
- const hfs = hfsOf(context)
93
- const filename = context.filename || context.getFilename()
94
- const mayHoldConnections = inDatabaseCapability(hfs, filename) || inCli(hfs, filename) || inTestWorld(hfs, filename) || isMigrationFile(hfs, filename)
95
- const CONNECTION_TYPES = new Set(["DataSource", "QueryRunner"])
73
+ const hfs = hfsOf(context);
74
+ const filename = context.filename || context.getFilename();
75
+ const mayHoldConnections = inDatabaseCapability(hfs, filename) || inCli(hfs, filename) || inTestWorld(hfs, filename) || isMigrationFile(hfs, filename);
76
+ const CONNECTION_TYPES = new Set(["DataSource", "QueryRunner"]);
96
77
  /** The connection type (DataSource / QueryRunner) a value or written type is declared as, else null. */
97
78
  const connectionTypeOf = (node) => {
98
- const type = infraTypeOf(context, node)
99
- return type !== null && CONNECTION_TYPES.has(type) ? type : null
100
- }
79
+ const type = infraTypeOf(context, node);
80
+ return type !== null && CONNECTION_TYPES.has(type) ? type : null;
81
+ };
101
82
  /** The connection type of a checker type (awaited), else null. */
102
83
  const connectionOfType = (type) => {
103
- if (!type) return null
104
- const { checker } = typed(context)
105
- const awaited = checker.getAwaitedType(type) ?? type
106
- const origin = originsOfType(checker, awaited).find((entry) => entry.module === "typeorm" && CONNECTION_TYPES.has(entry.name))
107
- return origin ? origin.name : null
108
- }
84
+ if (!type)
85
+ return null;
86
+ const { checker } = typed(context);
87
+ const awaited = checker.getAwaitedType(type) ?? type;
88
+ const origin = originsOfType(checker, awaited).find((entry) => entry.module === "typeorm" && CONNECTION_TYPES.has(entry.name));
89
+ return origin ? origin.name : null;
90
+ };
109
91
  /** True when the node sits inside a class that implements typeorm's `MigrationInterface` (it receives a `QueryRunner` by contract). */
110
92
  const insideMigrationClass = (node) => {
111
93
  for (let current = node.parent; current; current = current.parent) {
112
- if ((current.type === "ClassDeclaration" || current.type === "ClassExpression") && implementsMigration(context, current)) return true
94
+ if ((current.type === "ClassDeclaration" || current.type === "ClassExpression") && implementsMigration(context, current))
95
+ return true;
113
96
  }
114
- return false
115
- }
97
+ return false;
98
+ };
116
99
  /** The annotation of the constructor parameter or class property that contains this type node, else null. */
117
100
  const siteAnnotationOf = (node) => {
118
101
  for (let current = node.parent; current; current = current.parent) {
119
- if (current.type !== "TSTypeAnnotation") continue
120
- const owner = current.parent
121
- const isProperty = owner?.type === "PropertyDefinition"
102
+ if (current.type !== "TSTypeAnnotation")
103
+ continue;
104
+ const owner = current.parent;
105
+ const isProperty = owner?.type === "PropertyDefinition";
122
106
  const isParam = owner?.type === "Identifier" && (owner.parent?.type === "TSParameterProperty"
123
- || (owner.parent?.type === "FunctionExpression" && owner.parent.parent?.type === "MethodDefinition" && owner.parent.parent.kind === "constructor"))
124
- return isProperty || isParam ? current.typeAnnotation : null
107
+ || (owner.parent?.type === "FunctionExpression" && owner.parent.parent?.type === "MethodDefinition" && owner.parent.parent.kind === "constructor"));
108
+ return isProperty || isParam ? current.typeAnnotation : null;
125
109
  }
126
- return null
127
- }
110
+ return null;
111
+ };
128
112
  /** The member of a repository-declared class type that hands out a connection: `{ member, type, wrapper }`, else null. */
129
113
  const exposedConnection = (annotation) => {
130
- const { checker, toTs } = typed(context)
131
- const tsNode = toTs(annotation)
132
- if (!tsNode) return null
133
- const type = checker.getTypeFromTypeNode(tsNode)
134
- const symbol = type.getSymbol()
135
- const declaration = symbol && symbol.flags & ts.SymbolFlags.Class ? symbol.declarations?.[0] : null
136
- if (!declaration || declaration.getSourceFile().fileName.replace(/\\/g, "/").includes("/node_modules/")) return null
114
+ const { checker, toTs } = typed(context);
115
+ const tsNode = toTs(annotation);
116
+ // every type annotation maps to a TypeScript type node; the kind check only tells the compiler so
117
+ if (!tsNode || !ts.isTypeNode(tsNode))
118
+ return null;
119
+ const type = checker.getTypeFromTypeNode(tsNode);
120
+ const symbol = type.getSymbol();
121
+ const declaration = symbol && symbol.flags & ts.SymbolFlags.Class ? symbol.declarations?.[0] : null;
122
+ if (!symbol || !declaration || declaration.getSourceFile().fileName.replace(/\\/g, "/").includes("/node_modules/"))
123
+ return null;
137
124
  for (const property of checker.getPropertiesOfType(type)) {
138
- if (property.declarations?.some((entry) => ts.getCombinedModifierFlags(entry) & (ts.ModifierFlags.Private | ts.ModifierFlags.Protected))) continue
139
- const memberType = checker.getTypeOfSymbolAtLocation(property, tsNode)
125
+ if (property.declarations?.some((entry) => ts.getCombinedModifierFlags(entry) & (ts.ModifierFlags.Private | ts.ModifierFlags.Protected)))
126
+ continue;
127
+ const memberType = checker.getTypeOfSymbolAtLocation(property, tsNode);
140
128
  for (const candidate of [memberType, ...memberType.getCallSignatures().map((signature) => signature.getReturnType())]) {
141
- const found = connectionOfType(candidate)
142
- if (found) return { member: property.getName(), type: found, wrapper: symbol.getName() }
129
+ const found = connectionOfType(candidate);
130
+ if (found)
131
+ return { member: property.getName(), type: found, wrapper: symbol.getName() };
143
132
  }
144
133
  }
145
- return null
146
- }
134
+ return null;
135
+ };
147
136
  return {
148
137
  ...injectionSites(({ node, kind, annotation }) => {
149
- if (!annotation) return
150
- const type = infraTypeOf(context, annotation)
138
+ if (!annotation)
139
+ return;
140
+ const type = infraTypeOf(context, annotation);
151
141
  if (!type) {
152
- const wrapper = kind === "param" && !mayHoldConnections ? exposedConnection(annotation) : null
153
- if (wrapper) context.report({ node, messageId: "wrapper", data: wrapper })
154
- return
142
+ const wrapper = kind === "param" && !mayHoldConnections ? exposedConnection(annotation) : null;
143
+ if (wrapper)
144
+ context.report({ node, messageId: "wrapper", data: wrapper });
145
+ return;
155
146
  }
156
- if (kind === "property") context.report({ node, messageId: "property", data: { type } })
157
- else if (type !== "EntityManager" && !mayHoldConnections) context.report({ node, messageId: "infra", data: { type } })
147
+ if (kind === "property")
148
+ context.report({ node, messageId: "property", data: { type } });
149
+ else if (type !== "EntityManager" && !mayHoldConnections)
150
+ context.report({ node, messageId: "infra", data: { type } });
158
151
  }),
159
152
  TSTypeReference(node) {
160
- if (mayHoldConnections) return
161
- const type = connectionTypeOf(node)
162
- if (!type || insideMigrationClass(node)) return
163
- const site = siteAnnotationOf(node)
164
- if (site && infraTypeOf(context, site)) return
165
- context.report({ node, messageId: "exposed", data: { type } })
153
+ if (mayHoldConnections)
154
+ return;
155
+ const type = connectionTypeOf(node);
156
+ if (!type || insideMigrationClass(node))
157
+ return;
158
+ const site = siteAnnotationOf(node);
159
+ if (site && infraTypeOf(context, site))
160
+ return;
161
+ context.report({ node, messageId: "exposed", data: { type } });
166
162
  },
167
163
  AwaitExpression(node) {
168
- if (mayHoldConnections || insideMigrationClass(node)) return
169
- const { checker, toTs } = typed(context)
170
- const tsNode = toTs(node)
171
- const type = tsNode ? connectionOfType(checker.getTypeAtLocation(tsNode)) : null
172
- if (type) context.report({ node, messageId: "exposed", data: { type } })
164
+ if (mayHoldConnections || insideMigrationClass(node))
165
+ return;
166
+ const { checker, toTs } = typed(context);
167
+ const tsNode = toTs(node);
168
+ const type = tsNode ? connectionOfType(checker.getTypeAtLocation(tsNode)) : null;
169
+ if (type)
170
+ context.report({ node, messageId: "exposed", data: { type } });
173
171
  },
174
172
  Property(node) {
175
- if (mayHoldConnections || node.parent?.type !== "ObjectExpression" || node.computed) return
176
- if ((node.key.type === "Identifier" ? node.key.name : node.key.value) !== "provide") return
177
- const { checker, toTs } = typed(context)
173
+ if (mayHoldConnections || node.parent?.type !== "ObjectExpression" || node.computed)
174
+ return;
175
+ if ((node.key.type === "Identifier" ? node.key.name : node.key.value) !== "provide")
176
+ return;
177
+ const { checker, toTs } = typed(context);
178
178
  for (const sibling of node.parent.properties) {
179
- if (sibling.type !== "Property" || sibling.computed || sibling.key.type !== "Identifier") continue
180
- const tsNode = toTs(sibling.value)
181
- if (!tsNode) continue
182
- const type = checker.getTypeAtLocation(tsNode)
183
- const provided = sibling.key.name === "useValue" ? type : sibling.key.name === "useFactory" ? type.getCallSignatures()[0]?.getReturnType() : null
184
- const found = connectionOfType(provided)
185
- if (found) context.report({ node, messageId: "token", data: { type: found } })
179
+ if (sibling.type !== "Property" || sibling.computed || sibling.key.type !== "Identifier")
180
+ continue;
181
+ const tsNode = toTs(sibling.value);
182
+ if (!tsNode)
183
+ continue;
184
+ const type = checker.getTypeAtLocation(tsNode);
185
+ const provided = sibling.key.name === "useValue" ? type : sibling.key.name === "useFactory" ? type.getCallSignatures()[0]?.getReturnType() : null;
186
+ const found = connectionOfType(provided);
187
+ if (found)
188
+ context.report({ node, messageId: "token", data: { type: found } });
186
189
  }
187
190
  },
188
191
  CallExpression(node) {
189
- const callee = node.callee
190
- if (callee.type !== "MemberExpression" || callee.computed || callee.property.type !== "Identifier") return
191
- if (callee.property.name !== "getRepository") return
192
- if (infraTypeOf(context, callee.object)) context.report({ node, messageId: "getRepository" })
192
+ const callee = node.callee;
193
+ if (callee.type !== "MemberExpression" || callee.computed || callee.property.type !== "Identifier")
194
+ return;
195
+ if (callee.property.name !== "getRepository")
196
+ return;
197
+ if (infraTypeOf(context, callee.object))
198
+ context.report({ node, messageId: "getRepository" });
193
199
  },
194
- }
200
+ };
195
201
  },
196
- }
197
-
202
+ };
198
203
  // -- R83: repositories ---------------------------------------------------------------------------------
199
-
200
204
  /** Whether a type reference sits on a parameter or property already reported through its `@InjectRepository` decorator. */
201
205
  const carriesInjectRepository = (node) => {
202
206
  for (let owner = node.parent; owner && owner.type !== "ClassBody"; owner = owner.parent) {
203
- const decorated = (owner.decorators ?? []).some((decorator) => decorator.expression.type === "CallExpression" && decorator.expression.callee.name === "InjectRepository")
204
- if (decorated) return true
207
+ const decorators = "decorators" in owner ? owner.decorators : undefined;
208
+ const decorated = (decorators ?? []).some((decorator) => decorator.expression.type === "CallExpression" && decorator.expression.callee.type === "Identifier" && decorator.expression.callee.name === "InjectRepository");
209
+ if (decorated)
210
+ return true;
205
211
  }
206
- return false
207
- }
208
-
212
+ return false;
213
+ };
209
214
  /** Persistence never arrives as a repository. */
210
215
  export const noInjectedRepository = {
211
216
  meta: {
@@ -213,37 +218,36 @@ export const noInjectedRepository = {
213
218
  docs: { description: "Persistence goes through the shared `EntityManager`, never a repository." },
214
219
  schema: [],
215
220
  messages: {
216
- repo:
217
- "Inject the shared EntityManager with the named injector and call it directly. A repository is bound to ONE entity, so it cannot carry a transaction into a second table - and a use case that grows a second write then has to be rewritten rather than extended.",
218
- forFeature:
219
- "`TypeOrmModule.forFeature(...)` registers repositories, and this back end has none. Register the entities once on the connection in the platform database capability and call the shared EntityManager.",
221
+ repo: "Inject the shared EntityManager with the named injector and call it directly. A repository is bound to ONE entity, so it cannot carry a transaction into a second table - and a use case that grows a second write then has to be rewritten rather than extended.",
222
+ forFeature: "`TypeOrmModule.forFeature(...)` registers repositories, and this back end has none. Register the entities once on the connection in the platform database capability and call the shared EntityManager.",
220
223
  },
221
224
  },
222
225
  create(context) {
223
226
  return {
224
227
  Decorator(node) {
225
- const expression = node.expression
228
+ const expression = node.expression;
226
229
  if (expression.type === "CallExpression" && expression.callee.type === "Identifier" && expression.callee.name === "InjectRepository") {
227
- context.report({ node, messageId: "repo" })
230
+ context.report({ node, messageId: "repo" });
228
231
  }
229
232
  },
230
233
  TSTypeReference(node) {
231
- if (!REPOSITORY_TYPES.some((name) => isPackageType(context, node, name, "typeorm"))) return
232
- if (!carriesInjectRepository(node)) context.report({ node, messageId: "repo" })
234
+ if (!REPOSITORY_TYPES.some((name) => isPackageType(context, node, name, "typeorm")))
235
+ return;
236
+ if (!carriesInjectRepository(node))
237
+ context.report({ node, messageId: "repo" });
233
238
  },
234
239
  CallExpression(node) {
235
- const callee = node.callee
236
- if (callee.type !== "MemberExpression" || callee.computed || callee.property.type !== "Identifier") return
240
+ const callee = node.callee;
241
+ if (callee.type !== "MemberExpression" || callee.computed || callee.property.type !== "Identifier")
242
+ return;
237
243
  if (callee.property.name === "forFeature" && isPackageType(context, callee.object, "TypeOrmModule", "@nestjs/typeorm")) {
238
- context.report({ node, messageId: "forFeature" })
244
+ context.report({ node, messageId: "forFeature" });
239
245
  }
240
246
  },
241
- }
247
+ };
242
248
  },
243
- }
244
-
249
+ };
245
250
  // -- DATA-3 ----------------------------------------------------------------------------------------
246
-
247
251
  /** An entity names its table, so a class rename cannot become a dropped table. */
248
252
  export const requireEntityTableName = {
249
253
  meta: {
@@ -251,57 +255,51 @@ export const requireEntityTableName = {
251
255
  docs: { description: "`@Entity()` names its table explicitly." },
252
256
  schema: [],
253
257
  messages: {
254
- inferred:
255
- "`@Entity()` here lets the ORM infer the table name from the class name, so renaming the class renames the table - which `synchronize` performs as a DROP and CREATE rather than a migration. A class rename is a refactor; a dropped table is an outage. Name the table.",
258
+ inferred: "`@Entity()` here lets the ORM infer the table name from the class name, so renaming the class renames the table - which `synchronize` performs as a DROP and CREATE rather than a migration. A class rename is a refactor; a dropped table is an outage. Name the table.",
256
259
  },
257
260
  },
258
261
  create(context) {
259
262
  /** Both `@Entity("t")` and `@Entity({ name: "t" })` name the table. */
260
- const isTableName = (argument) =>
261
- (argument.type === "Literal" && typeof argument.value === "string") || argument.type === "TemplateLiteral"
263
+ const isTableName = (argument) => (argument.type === "Literal" && typeof argument.value === "string") || argument.type === "TemplateLiteral";
262
264
  return {
263
265
  Decorator(node) {
264
- const expression = node.expression
265
- if (expression.type !== "CallExpression") return
266
- if (expression.callee.type !== "Identifier" || expression.callee.name !== "Entity") return
266
+ const expression = node.expression;
267
+ if (expression.type !== "CallExpression")
268
+ return;
269
+ if (expression.callee.type !== "Identifier" || expression.callee.name !== "Entity")
270
+ return;
267
271
  // The options form is not a stylistic variant to discourage: it is the ONLY form that can
268
272
  // also carry a schema qualifier, so rejecting it would push an author to delete the schema
269
273
  // to satisfy the rule - a worse outcome than the inferred name this exists to prevent.
270
- const named = expression.arguments.some(
271
- (argument) =>
272
- isTableName(argument)
273
- || (argument.type === "ObjectExpression"
274
- && argument.properties.some(
275
- (property) =>
276
- property.type === "Property"
277
- && !property.computed
278
- && (property.key.name === "name" || property.key.value === "name")
279
- && isTableName(property.value),
280
- )),
281
- )
282
- if (!named) context.report({ node, messageId: "inferred" })
274
+ const named = expression.arguments.some((argument) => isTableName(argument)
275
+ || (argument.type === "ObjectExpression"
276
+ && argument.properties.some((property) => property.type === "Property"
277
+ && !property.computed
278
+ && nameOrValue(property.key) === "name"
279
+ && isTableName(property.value))));
280
+ if (!named)
281
+ context.report({ node, messageId: "inferred" });
283
282
  },
284
- }
283
+ };
285
284
  },
286
- }
287
-
285
+ };
288
286
  // -- transactions ----------------------------------------------------------------------------------
289
-
290
287
  /** The leftmost expression of a member chain: `this.deps.em` gives the `this`. */
291
288
  const rootOf = (expression) => {
292
- let current = expression
293
- while (current.type === "MemberExpression" || current.type === "TSNonNullExpression") current = current.type === "MemberExpression" ? current.object : current.expression
294
- return current
295
- }
296
-
289
+ let current = expression;
290
+ while (current.type === "MemberExpression" || current.type === "TSNonNullExpression")
291
+ current = current.type === "MemberExpression" ? current.object : current.expression;
292
+ return current;
293
+ };
297
294
  /** Whether an identifier position reads a value (a property name, a key or a type name does not). */
298
295
  const readsValue = (node) => {
299
- const parent = node.parent
300
- if (parent.type === "MemberExpression" && parent.property === node && !parent.computed) return false
301
- if (parent.type === "Property" && parent.key === node && !parent.computed && !parent.shorthand) return false
302
- return !parent.type.startsWith("TS")
303
- }
304
-
296
+ const parent = node.parent;
297
+ if (parent.type === "MemberExpression" && parent.property === node && !parent.computed)
298
+ return false;
299
+ if (parent.type === "Property" && parent.key === node && !parent.computed && !parent.shorthand)
300
+ return false;
301
+ return !parent.type.startsWith("TS");
302
+ };
305
303
  /** Everything inside a transaction receives the transactional manager, not one declared outside it. */
306
304
  export const noOuterManagerInTransaction = {
307
305
  meta: {
@@ -309,40 +307,41 @@ export const noOuterManagerInTransaction = {
309
307
  docs: { description: "Inside `<manager>.transaction(async (tx) => ...)`, every call uses `tx`, never another `EntityManager` declared outside the callback." },
310
308
  schema: [],
311
309
  messages: {
312
- outerManager:
313
- "`{{name}}` is an EntityManager from OUTSIDE this transaction callback. A call through it runs and commits on its own, which is how half a write survives a rollback. Use the manager the callback received.",
310
+ outerManager: "`{{name}}` is an EntityManager from OUTSIDE this transaction callback. A call through it runs and commits on its own, which is how half a write survives a rollback. Use the manager the callback received.",
314
311
  },
315
312
  },
316
313
  create(context) {
317
- const sourceCode = context.sourceCode || context.getSourceCode()
314
+ const sourceCode = context.sourceCode || context.getSourceCode();
318
315
  /** Whether the value written at `node` was declared outside the callback spanning `range`. */
319
316
  const declaredOutside = (node, range) => {
320
- const root = rootOf(node)
321
- if (root.type === "ThisExpression") return true
322
- if (root.type !== "Identifier") return false
323
- const variable = resolveVariable(sourceCode, root)
324
- const declaration = variable?.defs[0]?.name
325
- return Boolean(declaration) && (declaration.range[0] < range[0] || declaration.range[1] > range[1])
326
- }
317
+ const root = rootOf(node);
318
+ if (root.type === "ThisExpression")
319
+ return true;
320
+ if (root.type !== "Identifier")
321
+ return false;
322
+ const variable = resolveVariable(sourceCode, root);
323
+ const declaration = variable?.defs[0]?.name;
324
+ return declaration ? (declaration.range[0] < range[0] || declaration.range[1] > range[1]) : false;
325
+ };
327
326
  return {
328
327
  CallExpression(node) {
329
- const callback = transactionCallback(context, node)
330
- if (!callback) return
328
+ const callback = transactionCallback(context, node);
329
+ if (!callback)
330
+ return;
331
331
  walk(callback.body, (child) => {
332
- const isReference = child.type === "MemberExpression" || (child.type === "Identifier" && readsValue(child))
333
- if (!isReference || infraTypeOf(context, child) !== "EntityManager") return
334
- if (declaredOutside(child, callback.range)) context.report({ node: child, messageId: "outerManager", data: { name: sourceCode.getText(child) } })
335
- })
332
+ const isReference = child.type === "MemberExpression" || (child.type === "Identifier" && readsValue(child));
333
+ if (!isReference || infraTypeOf(context, child) !== "EntityManager")
334
+ return;
335
+ if (declaredOutside(child, callback.range))
336
+ context.report({ node: child, messageId: "outerManager", data: { name: sourceCode.getText(child) } });
337
+ });
336
338
  },
337
- }
339
+ };
338
340
  },
339
- }
340
-
341
+ };
341
342
  // -- DATA-5 (Rule 6) --------------------------------------------------------------------------------
342
-
343
343
  /** Relation decorators whose `eager` option can grant the relation to every caller. */
344
- const RELATION_DECORATORS = /^(?:ManyToOne|OneToOne|OneToMany|ManyToMany)$/
345
-
344
+ const RELATION_DECORATORS = /^(?:ManyToOne|OneToOne|OneToMany|ManyToMany)$/;
346
345
  /** A relation is asked for by the call site that needs it; the entity grants no relation eagerly. */
347
346
  export const noEagerRelation = {
348
347
  meta: {
@@ -352,53 +351,53 @@ export const noEagerRelation = {
352
351
  },
353
352
  schema: [],
354
353
  messages: {
355
- eager:
356
- "`@{{decorator}}(..., { eager: true })` grants this relation to every caller whether it asked for it or not, so a query that wants one column now pays for the whole tree. State the relation in the `relations` the call site writes, and drop `eager` here.",
354
+ eager: "`@{{decorator}}(..., { eager: true })` grants this relation to every caller whether it asked for it or not, so a query that wants one column now pays for the whole tree. State the relation in the `relations` the call site writes, and drop `eager` here.",
357
355
  },
358
356
  },
359
357
  create(context) {
360
358
  return {
361
359
  Decorator(node) {
362
- const expression = node.expression
363
- if (expression.type !== "CallExpression") return
364
- if (expression.callee.type !== "Identifier" || !RELATION_DECORATORS.test(expression.callee.name)) return
360
+ const expression = node.expression;
361
+ if (expression.type !== "CallExpression")
362
+ return;
363
+ if (expression.callee.type !== "Identifier" || !RELATION_DECORATORS.test(expression.callee.name))
364
+ return;
365
365
  for (const argument of expression.arguments) {
366
- if (argument.type !== "ObjectExpression") continue
367
- const eagerProperty = argument.properties.find(
368
- (property) =>
369
- property.type === "Property"
370
- && !property.computed
371
- && (property.key.name === "eager" || property.key.value === "eager"),
372
- )
373
- if (!eagerProperty) continue
366
+ if (argument.type !== "ObjectExpression")
367
+ continue;
368
+ const eagerProperty = argument.properties.find((property) => property.type === "Property"
369
+ && !property.computed
370
+ && nameOrValue(property.key) === "eager");
371
+ if (!eagerProperty)
372
+ continue;
374
373
  if (eagerProperty.value.type === "Literal" && eagerProperty.value.value === true) {
375
- context.report({ node, messageId: "eager", data: { decorator: expression.callee.name } })
374
+ context.report({ node, messageId: "eager", data: { decorator: expression.callee.name } });
376
375
  }
377
376
  }
378
377
  },
379
- }
378
+ };
380
379
  },
381
- }
382
-
380
+ };
383
381
  // -- R82 ---------------------------------------------------------------------------------------------
384
-
385
382
  /** The platform types whose calls leave the process. */
386
- const PLATFORM_EXTERNAL_TYPES = new Set(["HttpClient", "MessagePublisher"])
387
-
383
+ const PLATFORM_EXTERNAL_TYPES = new Set(["HttpClient", "MessagePublisher"]);
388
384
  /** Every receiver of a call chain, outermost first: `this.stripe.charges.create()` gives `this.stripe.charges`, `this.stripe`, `this`. */
389
385
  const receiversOf = (callee) => {
390
- const receivers = []
391
- let current = callee.type === "MemberExpression" ? callee.object : null
386
+ const receivers = [];
387
+ let current = callee.type === "MemberExpression" ? callee.object : null;
392
388
  while (current) {
393
- receivers.push(current)
394
- if (current.type === "MemberExpression") current = current.object
395
- else if (current.type === "CallExpression") current = current.callee.type === "MemberExpression" ? current.callee.object : null
396
- else if (current.type === "TSNonNullExpression") current = current.expression
397
- else current = null
389
+ receivers.push(current);
390
+ if (current.type === "MemberExpression")
391
+ current = current.object;
392
+ else if (current.type === "CallExpression")
393
+ current = current.callee.type === "MemberExpression" ? current.callee.object : null;
394
+ else if (current.type === "TSNonNullExpression")
395
+ current = current.expression;
396
+ else
397
+ current = null;
398
398
  }
399
- return receivers
400
- }
401
-
399
+ return receivers;
400
+ };
402
401
  /** No transaction spans an external call: commit first, then call out (or write an outbox message inside the transaction). */
403
402
  export const noExternalCallInTransaction = {
404
403
  meta: {
@@ -406,35 +405,32 @@ export const noExternalCallInTransaction = {
406
405
  docs: { description: "An HTTP, SDK or publish call does not run inside `<manager>.transaction(async (tx) => ...)`." },
407
406
  schema: [],
408
407
  messages: {
409
- external:
410
- "`{{call}}` runs inside `.transaction(...)`. A database transaction held open for as long as an external call takes means: the call fails after the transaction already did its work and now has to be undone by hand, or the call succeeds and the transaction then rolls back, and the two systems disagree with no way back. Commit the transaction, then make the call - or write an outbox message inside the transaction and let a worker deliver it after commit.",
408
+ external: "`{{call}}` runs inside `.transaction(...)`. A database transaction held open for as long as an external call takes means: the call fails after the transaction already did its work and now has to be undone by hand, or the call succeeds and the transaction then rolls back, and the two systems disagree with no way back. Commit the transaction, then make the call - or write an outbox message inside the transaction and let a worker deliver it after commit.",
411
409
  },
412
410
  },
413
411
  create(context) {
414
- const hfs = hfsOf(context)
415
- const sourceCode = context.sourceCode || context.getSourceCode()
412
+ const hfs = hfsOf(context);
413
+ const sourceCode = context.sourceCode || context.getSourceCode();
416
414
  /** Whether a value's type is declared in `integrations/**` or is the platform `HttpClient` / `MessagePublisher`. */
417
- const isExternalReceiver = (node) =>
418
- typeOrigins(context, node).some(
419
- (origin) => hfs.tierOf(origin.file) === "integrations" || (PLATFORM_EXTERNAL_TYPES.has(origin.name) && hfs.slotOf(origin.file) === "be.platform"),
420
- )
415
+ const isExternalReceiver = (node) => typeOrigins(context, node).some((origin) => hfs.tierOf(origin.file) === "integrations" || (PLATFORM_EXTERNAL_TYPES.has(origin.name) && hfs.slotOf(origin.file) === "be.platform"));
421
416
  return {
422
417
  CallExpression(node) {
423
- const callback = transactionCallback(context, node)
424
- if (!callback) return
418
+ const callback = transactionCallback(context, node);
419
+ if (!callback)
420
+ return;
425
421
  walk(callback.body, (child) => {
426
- if (child.type !== "CallExpression") return
427
- const { callee } = child
428
- const globalFetch = callee.type === "Identifier" && callee.name === "fetch" && !resolveVariable(sourceCode, callee)?.defs.length
422
+ if (child.type !== "CallExpression")
423
+ return;
424
+ const { callee } = child;
425
+ const globalFetch = callee.type === "Identifier" && callee.name === "fetch" && !resolveVariable(sourceCode, callee)?.defs.length;
429
426
  if (globalFetch || receiversOf(callee).some(isExternalReceiver)) {
430
- context.report({ node: child, messageId: "external", data: { call: sourceCode.getText(callee).slice(0, 60) } })
427
+ context.report({ node: child, messageId: "external", data: { call: sourceCode.getText(callee).slice(0, 60) } });
431
428
  }
432
- })
429
+ });
433
430
  },
434
- }
431
+ };
435
432
  },
436
- }
437
-
433
+ };
438
434
  /** The rules this law contributes to the plugin. */
439
435
  export const rules = {
440
436
  "must-inject-entity-manager": mustInjectEntityManager,
@@ -444,8 +440,7 @@ export const rules = {
444
440
  "no-eager-relation": noEagerRelation,
445
441
  "no-external-call-in-transaction": noExternalCallInTransaction,
446
442
  "named-entity-manager-only": namedEntityManagerOnly,
447
- }
448
-
443
+ };
449
444
  /** Every rule of this law ships at `error`; a repository is fixed before it adopts the plugin, never given a weaker level. */
450
445
  export const recommended = {
451
446
  "starci-be/must-inject-entity-manager": "error",
@@ -455,4 +450,4 @@ export const recommended = {
455
450
  "starci-be/no-eager-relation": "error",
456
451
  "starci-be/no-external-call-in-transaction": "error",
457
452
  "starci-be/named-entity-manager-only": "error",
458
- }
453
+ };