@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.
Files changed (197) hide show
  1. package/CHANGELOG.md +19 -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 +22 -14
  177. package/runtime/knowledge/hfs/rules.yaml +23 -0
  178. package/runtime/scripts/lib/package-at.mjs +5 -5
  179. package/async-discipline.mjs +0 -83
  180. package/comments.mjs +0 -416
  181. package/edge-hardening.mjs +0 -139
  182. package/health-ready.mjs +0 -539
  183. package/jwt-alg.mjs +0 -45
  184. package/lib/ast.mjs +0 -88
  185. package/lib/import-source.mjs +0 -104
  186. package/lib/specifier.mjs +0 -27
  187. package/lib/subject-values.mjs +0 -55
  188. package/lib/types.mjs +0 -133
  189. package/log-safety.mjs +0 -303
  190. package/module-layering.mjs +0 -270
  191. package/naming.mjs +0 -251
  192. package/observability.mjs +0 -241
  193. package/resilience.mjs +0 -304
  194. package/service-isolation.mjs +0 -75
  195. package/spec-no-skip.mjs +0 -85
  196. package/testing.mjs +0 -384
  197. package/type-safety.mjs +0 -323
@@ -17,22 +17,19 @@
17
17
  *
18
18
  * Where a file lives is asked of the slot view; what a name IS comes from the import that binds it. No path pattern is spelled here.
19
19
  */
20
- import { hfsOf } from "./lib/hfs.mjs"
21
- import { decoratorCallee, importOf, isImportedFrom, moduleReferences } from "./lib/import-source.mjs"
22
-
20
+ import { hfsOf } from "./lib/hfs.js";
21
+ import { decoratorCallee, importOf, isImportedFrom, moduleReferences } from "./lib/import-source.js";
23
22
  /** The slot of the cli app and of the cli feature root. */
24
- const CLI_APP_SLOT = "be.app.cli"
25
- const CLI_FEATURE_SLOT = "be.cli"
26
- const COMMANDER = "nest-commander"
23
+ const CLI_APP_SLOT = "be.app.cli";
24
+ const CLI_FEATURE_SLOT = "be.cli";
25
+ const COMMANDER = "nest-commander";
27
26
  /** The argument parsers no back-end source imports: nest-commander (in the cli app and feature only) parses the arguments. */
28
- const FOREIGN_PARSERS = new Set(["commander", "yargs", "yargs/yargs", "yargs/helpers", "minimist"])
27
+ const FOREIGN_PARSERS = new Set(["commander", "yargs", "yargs/yargs", "yargs/helpers", "minimist"]);
29
28
  /** The entry file of an app (the slot's first requirement): where the cli app boots. */
30
- const ENTRY = "main.ts"
31
-
32
- const relativeIn = (hfs, file) => hfs.allows(file)?.relative ?? null
33
- const isCliApp = (hfs, file) => hfs.slotOf(file) === CLI_APP_SLOT
34
- const isCliFeature = (hfs, file) => hfs.slotOf(file) === CLI_FEATURE_SLOT
35
-
29
+ const ENTRY = "main.ts";
30
+ const relativeIn = (hfs, file) => hfs.allows(file)?.relative ?? null;
31
+ const isCliApp = (hfs, file) => hfs.slotOf(file) === CLI_APP_SLOT;
32
+ const isCliFeature = (hfs, file) => hfs.slotOf(file) === CLI_FEATURE_SLOT;
36
33
  /** The cli app boots with CommandFactory.run and never serves HTTP or a microservice. */
37
34
  export const cliBootstrap = {
38
35
  meta: {
@@ -45,49 +42,58 @@ export const cliBootstrap = {
45
42
  },
46
43
  },
47
44
  create(context) {
48
- const hfs = hfsOf(context)
49
- const filename = context.filename
50
- if (!isCliApp(hfs, filename)) return {}
51
- const entry = relativeIn(hfs, filename) === ENTRY
52
- let boots = false
45
+ const hfs = hfsOf(context);
46
+ const filename = context.filename;
47
+ if (!isCliApp(hfs, filename))
48
+ return {};
49
+ const entry = relativeIn(hfs, filename) === ENTRY;
50
+ let boots = false;
53
51
  return {
54
52
  ...moduleReferences(({ source, value }) => {
55
- if (value === "@nestjs/microservices" || value.startsWith("@nestjs/platform-")) context.report({ node: source, messageId: "server", data: { name: value } })
53
+ if (value === "@nestjs/microservices" || value.startsWith("@nestjs/platform-"))
54
+ context.report({ node: source, messageId: "server", data: { name: value } });
56
55
  }),
57
56
  CallExpression(node) {
58
- const callee = node.callee
59
- if (callee.type !== "MemberExpression" || callee.computed || callee.property.type !== "Identifier") return
60
- const method = callee.property.name
61
- if (method === "run" && isImportedFrom(context, callee.object, COMMANDER, "CommandFactory")) boots = true
62
- if (isImportedFrom(context, callee.object, "@nestjs/core", "NestFactory")) context.report({ node, messageId: "server", data: { name: `NestFactory.${method}` } })
63
- else if (method === "listen" || method === "connectMicroservice" || method === "startAllMicroservices") context.report({ node, messageId: "server", data: { name: `.${method}()` } })
57
+ const callee = node.callee;
58
+ if (callee.type !== "MemberExpression" || callee.computed || callee.property.type !== "Identifier")
59
+ return;
60
+ const method = callee.property.name;
61
+ if (method === "run" && isImportedFrom(context, callee.object, COMMANDER, "CommandFactory"))
62
+ boots = true;
63
+ if (isImportedFrom(context, callee.object, "@nestjs/core", "NestFactory"))
64
+ context.report({ node, messageId: "server", data: { name: `NestFactory.${method}` } });
65
+ else if (method === "listen" || method === "connectMicroservice" || method === "startAllMicroservices")
66
+ context.report({ node, messageId: "server", data: { name: `.${method}()` } });
64
67
  },
65
68
  "Program:exit"(program) {
66
- if (entry && !boots) context.report({ node: program, messageId: "missing" })
69
+ if (entry && !boots)
70
+ context.report({ node: program, messageId: "missing" });
67
71
  },
68
- }
72
+ };
69
73
  },
70
- }
71
-
74
+ };
72
75
  /** The nest-commander decorator a class carries (Command or SubCommand), by the import that binds it. */
73
76
  const commanderDecorator = (context, klass) => {
74
77
  for (const decorator of klass.decorators ?? []) {
75
- const callee = decoratorCallee(decorator)
76
- if (callee?.type !== "Identifier") continue
77
- const bound = importOf(context, callee)
78
- if (bound?.source === COMMANDER && (bound.imported === "Command" || bound.imported === "SubCommand")) return { decorator, kind: bound.imported }
78
+ const callee = decoratorCallee(decorator);
79
+ if (callee?.type !== "Identifier")
80
+ continue;
81
+ const bound = importOf(context, callee);
82
+ if (bound?.source === COMMANDER && (bound.imported === "Command" || bound.imported === "SubCommand"))
83
+ return { decorator, kind: bound.imported };
79
84
  }
80
- return null
81
- }
82
-
85
+ return null;
86
+ };
83
87
  /** Where a command of each kind is declared in the cli feature root: `<group>/<group>.cli.ts` or `<group>/subs/<name>.cli.ts`. */
84
88
  const placeOf = (relative) => {
85
- const parts = String(relative ?? "").split("/")
86
- if (parts.length === 2 && parts[1] === `${parts[0]}.cli.ts`) return "Command"
87
- if (parts.length === 3 && parts[1] === "subs" && parts[2].endsWith(".cli.ts") && !parts[2].endsWith(".spec.ts")) return "SubCommand"
88
- return null
89
- }
90
-
89
+ const parts = String(relative ?? "").split("/");
90
+ if (parts.length === 2 && parts[1] === `${parts[0]}.cli.ts`)
91
+ return "Command";
92
+ const leaf = parts[2];
93
+ if (parts.length === 3 && parts[1] === "subs" && leaf !== undefined && leaf.endsWith(".cli.ts") && !leaf.endsWith(".spec.ts"))
94
+ return "SubCommand";
95
+ return null;
96
+ };
91
97
  /** A nest-commander command is declared only where the cli feature root keeps it, one per file, a sub-command a CommandRunner. */
92
98
  export const cliCommandShape = {
93
99
  meta: {
@@ -102,40 +108,47 @@ export const cliCommandShape = {
102
108
  },
103
109
  },
104
110
  create(context) {
105
- const hfs = hfsOf(context)
106
- const filename = context.filename
107
- const slot = hfs.slotOf(filename)
108
- const place = isCliFeature(hfs, filename) ? placeOf(relativeIn(hfs, filename)) : null
109
- let commands = 0
111
+ const hfs = hfsOf(context);
112
+ const filename = context.filename;
113
+ const slot = hfs.slotOf(filename);
114
+ const place = isCliFeature(hfs, filename) ? placeOf(relativeIn(hfs, filename)) : null;
115
+ let commands = 0;
110
116
  const check = (klass) => {
111
- const found = commanderDecorator(context, klass)
112
- if (!found) return
113
- commands += 1
114
- if (!isCliFeature(hfs, filename)) return context.report({ node: found.decorator, messageId: "outside", data: { kind: found.kind, slot: slot ?? "none" } })
115
- if (place !== found.kind) return context.report({ node: found.decorator, messageId: "misplaced", data: { kind: found.kind, relative: relativeIn(hfs, filename) ?? filename } })
116
- if (commands > 1) return context.report({ node: found.decorator, messageId: "second" })
117
- if (found.kind === "SubCommand" && !(klass.superClass && isImportedFrom(context, klass.superClass, COMMANDER, "CommandRunner"))) context.report({ node: klass.id ?? klass, messageId: "runner", data: { name: klass.id?.name ?? "anonymous" } })
118
- }
119
- return { ClassDeclaration: check, ClassExpression: check }
117
+ const found = commanderDecorator(context, klass);
118
+ if (!found)
119
+ return;
120
+ commands += 1;
121
+ if (!isCliFeature(hfs, filename))
122
+ return context.report({ node: found.decorator, messageId: "outside", data: { kind: found.kind, slot: slot ?? "none" } });
123
+ if (place !== found.kind)
124
+ return context.report({ node: found.decorator, messageId: "misplaced", data: { kind: found.kind, relative: relativeIn(hfs, filename) ?? filename } });
125
+ if (commands > 1)
126
+ return context.report({ node: found.decorator, messageId: "second" });
127
+ if (found.kind === "SubCommand" && !(klass.superClass && isImportedFrom(context, klass.superClass, COMMANDER, "CommandRunner")))
128
+ context.report({ node: klass.id ?? klass, messageId: "runner", data: { name: klass.id?.name ?? "anonymous" } });
129
+ };
130
+ return { ClassDeclaration: check, ClassExpression: check };
120
131
  },
121
- }
122
-
132
+ };
123
133
  /** Whether a member expression is `process.argv` of the Node global (or `globalThis.process.argv`). */
124
134
  const isProcessArgv = (context, node) => {
125
- if (node.computed || node.property.type !== "Identifier" || node.property.name !== "argv") return false
126
- const object = node.object
135
+ if (node.computed || node.property.type !== "Identifier" || node.property.name !== "argv")
136
+ return false;
137
+ const object = node.object;
127
138
  const isProcess = (expression) => {
128
- if (expression.type !== "Identifier" || expression.name !== "process") return false
139
+ if (expression.type !== "Identifier" || expression.name !== "process")
140
+ return false;
129
141
  for (let scope = context.sourceCode.getScope(expression); scope; scope = scope.upper) {
130
- const variable = scope.set.get("process")
131
- if (variable) return variable.defs.length === 0
142
+ const variable = scope.set.get("process");
143
+ if (variable)
144
+ return variable.defs.length === 0;
132
145
  }
133
- return true
134
- }
135
- if (isProcess(object)) return true
136
- return object.type === "MemberExpression" && !object.computed && object.object.type === "Identifier" && object.object.name === "globalThis" && object.property.type === "Identifier" && object.property.name === "process"
137
- }
138
-
146
+ return true;
147
+ };
148
+ if (isProcess(object))
149
+ return true;
150
+ return object.type === "MemberExpression" && !object.computed && object.object.type === "Identifier" && object.object.name === "globalThis" && object.property.type === "Identifier" && object.property.name === "process";
151
+ };
139
152
  /** nest-commander belongs to the cli app and the cli feature root; nothing else parses arguments or opens an action door. */
140
153
  export const cliOwner = {
141
154
  meta: {
@@ -149,33 +162,35 @@ export const cliOwner = {
149
162
  },
150
163
  },
151
164
  create(context) {
152
- const hfs = hfsOf(context)
153
- const filename = context.filename
154
- const slot = hfs.slotOf(filename)
155
- const owner = isCliApp(hfs, filename) || isCliFeature(hfs, filename)
165
+ const hfs = hfsOf(context);
166
+ const filename = context.filename;
167
+ const slot = hfs.slotOf(filename);
168
+ const owner = isCliApp(hfs, filename) || isCliFeature(hfs, filename);
156
169
  return {
157
170
  ...moduleReferences(({ source, value }) => {
158
171
  if (value === COMMANDER || value.startsWith(`${COMMANDER}/`)) {
159
- if (!owner) context.report({ node: source, messageId: "commander", data: { slot: slot ?? "none" } })
160
- } else if (FOREIGN_PARSERS.has(value)) context.report({ node: source, messageId: "parser", data: { name: value } })
172
+ if (!owner)
173
+ context.report({ node: source, messageId: "commander", data: { slot: slot ?? "none" } });
174
+ }
175
+ else if (FOREIGN_PARSERS.has(value))
176
+ context.report({ node: source, messageId: "parser", data: { name: value } });
161
177
  }),
162
178
  MemberExpression(node) {
163
- if (isProcessArgv(context, node)) context.report({ node, messageId: "argv" })
179
+ if (isProcessArgv(context, node))
180
+ context.report({ node, messageId: "argv" });
164
181
  },
165
- }
182
+ };
166
183
  },
167
- }
168
-
184
+ };
169
185
  /** The rules this law contributes to the plugin. */
170
186
  export const rules = {
171
187
  "cli-bootstrap": cliBootstrap,
172
188
  "cli-command-shape": cliCommandShape,
173
189
  "cli-owner": cliOwner,
174
- }
175
-
190
+ };
176
191
  /** Every rule is an error from the start: HFS keeps no baseline. */
177
192
  export const recommended = {
178
193
  "starci-be/cli-bootstrap": "error",
179
194
  "starci-be/cli-command-shape": "error",
180
195
  "starci-be/cli-owner": "error",
181
- }
196
+ };
@@ -0,0 +1,52 @@
1
+ /**
2
+ * The rules that hold `comments.md`.
3
+ *
4
+ * Six rules, and each is careful about a different false positive:
5
+ *
6
+ * - `require-export-jsdoc` skips plain data constants. `export const MAX_ATTEMPTS = 3` is already
7
+ * fully described by its own name, and demanding a sentence there produces sentences that
8
+ * restate the name - which COMMENT-3 forbids. Only declarations with a surface get the check.
9
+ * - `require-public-member-jsdoc` (R109) judges only what a caller reaches: a private, protected or `#` member, the
10
+ * constructor and an index signature are not surface, overload signatures of one name share one doc, and a property
11
+ * set to a literal or a named constant is a data constant (COMMENT-1's reason). Product source only: the test tiers
12
+ * (`e2e`, `fixtures` of the slot manifest) document their spec-read shapes at the type.
13
+ * - `require-enum-member-jsdoc` checks an adjacent non-empty description, never whether it states a
14
+ * consequence. That half is read by a person, and the rule says so rather than pretending.
15
+ * - `no-non-ascii-source` takes no exemption marker, so text a program depends on
16
+ * lives in a message catalog (slot be.domain.messages, of any module tier, or be.feature.messages), the only place Vietnamese may appear. Specs
17
+ * and fixtures get no exemption.
18
+ * - `no-restated-name-jsdoc` (law 7) holds the decidable slice of law 3 - a doc block whose only
19
+ * content is the declared name re-spelled in words teaches nothing beyond the import line, so it
20
+ * is COMMENT-3's violation wearing COMMENT-1's shape. It fires only on an exact match between the
21
+ * doc's content words and the name's own words, so a doc that adds any real information is left
22
+ * alone - the rest of law 3 (whether a sentence explains something outside the line) is not
23
+ * decidable and stays a human read.
24
+ */
25
+ import type { Recommended, RuleModule } from "./lib/rule.js";
26
+ /** Every export with a surface opens with a doc block. */
27
+ export declare const requireExportJsdoc: RuleModule;
28
+ /** Every public member of an exported class, interface or object type opens with a doc block (BE-COMMENT-3). */
29
+ export declare const requirePublicMemberJsdoc: RuleModule;
30
+ /** Every member of an exported enum carries its own doc. */
31
+ export declare const requireEnumMemberJsdoc: RuleModule;
32
+ /** Source prose is English; there is no exemption marker. */
33
+ export declare const noNonAsciiSource: RuleModule;
34
+ /** A doc block that only re-spells the declared name is COMMENT-3's violation wearing COMMENT-1's shape. */
35
+ export declare const noRestatedNameJsdoc: RuleModule;
36
+ /** The rules this law contributes to the plugin. */
37
+ export declare const rules: {
38
+ "require-export-jsdoc": RuleModule;
39
+ "require-enum-member-jsdoc": RuleModule;
40
+ "require-public-member-jsdoc": RuleModule;
41
+ "no-non-ascii-source": RuleModule;
42
+ "no-restated-name-jsdoc": RuleModule;
43
+ };
44
+ /**
45
+ * The level this law asks for, as the plugin's own opinion.
46
+ *
47
+ * `no-non-ascii-source` replaces three separate rules in the reference plugin - one for Vietnamese,
48
+ * one for emoji, one for decorative symbols. They were three character classes answering one
49
+ * question, and a reader who hit the emoji rule learned nothing about the other two. One rule with
50
+ * one reason is easier to obey, and impossible to satisfy by switching alphabets.
51
+ */
52
+ export declare const recommended: Recommended;