@ddd-ts-kit/eslint-plugin 0.16.0 → 0.17.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 (235) hide show
  1. package/README.fr.md +465 -0
  2. package/README.md +149 -9
  3. package/dist/project/config.d.ts +8 -0
  4. package/dist/project/config.d.ts.map +1 -1
  5. package/dist/project/parse-config.d.ts.map +1 -1
  6. package/dist/project/parse-config.js +13 -0
  7. package/dist/project/parse-config.js.map +1 -1
  8. package/dist/rules/naming-business-name.d.ts +6 -0
  9. package/dist/rules/naming-business-name.d.ts.map +1 -0
  10. package/dist/rules/naming-business-name.js +175 -0
  11. package/dist/rules/naming-business-name.js.map +1 -0
  12. package/dist/rules/rules.d.ts.map +1 -1
  13. package/dist/rules/rules.js +2 -0
  14. package/dist/rules/rules.js.map +1 -1
  15. package/dist/support/business-names/binding-advice.d.ts +4 -0
  16. package/dist/support/business-names/binding-advice.d.ts.map +1 -0
  17. package/dist/support/business-names/binding-advice.js +12 -0
  18. package/dist/support/business-names/binding-advice.js.map +1 -0
  19. package/dist/support/business-names/binding-kind.d.ts +3 -0
  20. package/dist/support/business-names/binding-kind.d.ts.map +1 -0
  21. package/dist/support/business-names/binding-kind.js +2 -0
  22. package/dist/support/business-names/binding-kind.js.map +1 -0
  23. package/dist/support/business-names/built-class.d.ts +9 -0
  24. package/dist/support/business-names/built-class.d.ts.map +1 -0
  25. package/dist/support/business-names/built-class.js +37 -0
  26. package/dist/support/business-names/built-class.js.map +1 -0
  27. package/dist/support/business-names/called-member.d.ts +8 -0
  28. package/dist/support/business-names/called-member.d.ts.map +1 -0
  29. package/dist/support/business-names/called-member.js +10 -0
  30. package/dist/support/business-names/called-member.js.map +1 -0
  31. package/dist/support/business-names/camel.d.ts +3 -0
  32. package/dist/support/business-names/camel.d.ts.map +1 -0
  33. package/dist/support/business-names/camel.js +5 -0
  34. package/dist/support/business-names/camel.js.map +1 -0
  35. package/dist/support/business-names/collection-element.d.ts +4 -0
  36. package/dist/support/business-names/collection-element.d.ts.map +1 -0
  37. package/dist/support/business-names/collection-element.js +12 -0
  38. package/dist/support/business-names/collection-element.js.map +1 -0
  39. package/dist/support/business-names/conventional-model-name.d.ts +9 -0
  40. package/dist/support/business-names/conventional-model-name.d.ts.map +1 -0
  41. package/dist/support/business-names/conventional-model-name.js +22 -0
  42. package/dist/support/business-names/conventional-model-name.js.map +1 -0
  43. package/dist/support/business-names/generic-words.d.ts +6 -0
  44. package/dist/support/business-names/generic-words.d.ts.map +1 -0
  45. package/dist/support/business-names/generic-words.js +25 -0
  46. package/dist/support/business-names/generic-words.js.map +1 -0
  47. package/dist/support/business-names/is-name-free.d.ts +10 -0
  48. package/dist/support/business-names/is-name-free.d.ts.map +1 -0
  49. package/dist/support/business-names/is-name-free.js +26 -0
  50. package/dist/support/business-names/is-name-free.js.map +1 -0
  51. package/dist/support/business-names/judges-names.d.ts +7 -0
  52. package/dist/support/business-names/judges-names.d.ts.map +1 -0
  53. package/dist/support/business-names/judges-names.js +14 -0
  54. package/dist/support/business-names/judges-names.js.map +1 -0
  55. package/dist/support/business-names/pattern-identifiers.d.ts +4 -0
  56. package/dist/support/business-names/pattern-identifiers.d.ts.map +1 -0
  57. package/dist/support/business-names/pattern-identifiers.js +21 -0
  58. package/dist/support/business-names/pattern-identifiers.js.map +1 -0
  59. package/dist/support/business-names/plural.d.ts +3 -0
  60. package/dist/support/business-names/plural.d.ts.map +1 -0
  61. package/dist/support/business-names/plural.js +8 -0
  62. package/dist/support/business-names/plural.js.map +1 -0
  63. package/dist/support/business-names/proposed-name.d.ts +6 -0
  64. package/dist/support/business-names/proposed-name.d.ts.map +1 -0
  65. package/dist/support/business-names/proposed-name.js +2 -0
  66. package/dist/support/business-names/proposed-name.js.map +1 -0
  67. package/dist/support/business-names/rename-fix.d.ts +8 -0
  68. package/dist/support/business-names/rename-fix.d.ts.map +1 -0
  69. package/dist/support/business-names/rename-fix.js +26 -0
  70. package/dist/support/business-names/rename-fix.js.map +1 -0
  71. package/dist/support/business-names/repository-concept.d.ts +4 -0
  72. package/dist/support/business-names/repository-concept.d.ts.map +1 -0
  73. package/dist/support/business-names/repository-concept.js +10 -0
  74. package/dist/support/business-names/repository-concept.js.map +1 -0
  75. package/dist/support/business-names/singular.d.ts +3 -0
  76. package/dist/support/business-names/singular.d.ts.map +1 -0
  77. package/dist/support/business-names/singular.js +11 -0
  78. package/dist/support/business-names/singular.js.map +1 -0
  79. package/dist/support/business-names/typed-names.d.ts +13 -0
  80. package/dist/support/business-names/typed-names.d.ts.map +1 -0
  81. package/dist/support/business-names/typed-names.js +53 -0
  82. package/dist/support/business-names/typed-names.js.map +1 -0
  83. package/dist/support/business-names/words-of.d.ts +9 -0
  84. package/dist/support/business-names/words-of.d.ts.map +1 -0
  85. package/dist/support/business-names/words-of.js +8 -0
  86. package/dist/support/business-names/words-of.js.map +1 -0
  87. package/dist/version.d.ts +1 -1
  88. package/dist/version.js +1 -1
  89. package/docs/rules/application-command-query-separation.fr.md +57 -0
  90. package/docs/rules/application-command-query-separation.md +2 -0
  91. package/docs/rules/application-handler-shape.fr.md +55 -0
  92. package/docs/rules/application-handler-shape.md +2 -0
  93. package/docs/rules/aspects-outside-in.fr.md +57 -0
  94. package/docs/rules/aspects-outside-in.md +2 -0
  95. package/docs/rules/authz-actor-explicit.fr.md +73 -0
  96. package/docs/rules/authz-actor-explicit.md +2 -0
  97. package/docs/rules/authz-declared.fr.md +90 -0
  98. package/docs/rules/authz-declared.md +3 -1
  99. package/docs/rules/authz-fields-by-schema.fr.md +54 -0
  100. package/docs/rules/authz-fields-by-schema.md +2 -0
  101. package/docs/rules/authz-in-application.fr.md +91 -0
  102. package/docs/rules/authz-in-application.md +2 -0
  103. package/docs/rules/clean-blank-lines.fr.md +90 -0
  104. package/docs/rules/clean-blank-lines.md +2 -0
  105. package/docs/rules/clean-braces.fr.md +64 -0
  106. package/docs/rules/clean-braces.md +2 -0
  107. package/docs/rules/clean-file-size.fr.md +46 -0
  108. package/docs/rules/clean-file-size.md +2 -0
  109. package/docs/rules/clean-formatted.fr.md +35 -0
  110. package/docs/rules/clean-formatted.md +2 -0
  111. package/docs/rules/clean-function-ceiling.fr.md +56 -0
  112. package/docs/rules/clean-function-ceiling.md +2 -0
  113. package/docs/rules/clean-function-size.fr.md +48 -0
  114. package/docs/rules/clean-function-size.md +2 -0
  115. package/docs/rules/clean-no-commented-out-code.fr.md +51 -0
  116. package/docs/rules/clean-no-commented-out-code.md +2 -0
  117. package/docs/rules/clean-no-escape-hatch.fr.md +83 -0
  118. package/docs/rules/clean-no-escape-hatch.md +2 -0
  119. package/docs/rules/clean-no-flag-argument.fr.md +53 -0
  120. package/docs/rules/clean-no-flag-argument.md +2 -0
  121. package/docs/rules/clean-no-hash-private.fr.md +66 -0
  122. package/docs/rules/clean-no-hash-private.md +2 -0
  123. package/docs/rules/clean-no-magic-number.fr.md +62 -0
  124. package/docs/rules/clean-no-magic-number.md +2 -0
  125. package/docs/rules/clean-no-noise-comment.fr.md +58 -0
  126. package/docs/rules/clean-no-noise-comment.md +2 -0
  127. package/docs/rules/clean-one-export-per-file.fr.md +91 -0
  128. package/docs/rules/clean-one-export-per-file.md +2 -0
  129. package/docs/rules/clean-stepdown.fr.md +63 -0
  130. package/docs/rules/clean-stepdown.md +2 -0
  131. package/docs/rules/context-declared-relationship.fr.md +52 -0
  132. package/docs/rules/context-declared-relationship.md +2 -0
  133. package/docs/rules/context-extractable.fr.md +112 -0
  134. package/docs/rules/context-extractable.md +2 -0
  135. package/docs/rules/context-published-language-is-a-contract.fr.md +50 -0
  136. package/docs/rules/context-published-language-is-a-contract.md +2 -0
  137. package/docs/rules/context-published-language-only.fr.md +50 -0
  138. package/docs/rules/context-published-language-only.md +2 -0
  139. package/docs/rules/declarations-constructor-injection.fr.md +92 -0
  140. package/docs/rules/declarations-constructor-injection.md +2 -0
  141. package/docs/rules/declarations-role-declared.fr.md +118 -0
  142. package/docs/rules/declarations-role-declared.md +2 -0
  143. package/docs/rules/domain-aggregate-encapsulation.fr.md +66 -0
  144. package/docs/rules/domain-aggregate-encapsulation.md +2 -0
  145. package/docs/rules/domain-events-dispatched-on-save.fr.md +86 -0
  146. package/docs/rules/domain-events-dispatched-on-save.md +2 -0
  147. package/docs/rules/domain-events-transactional-before-commit.fr.md +95 -0
  148. package/docs/rules/domain-events-transactional-before-commit.md +2 -0
  149. package/docs/rules/domain-no-generic-error.fr.md +43 -0
  150. package/docs/rules/domain-no-generic-error.md +2 -0
  151. package/docs/rules/domain-value-object-class.fr.md +177 -0
  152. package/docs/rules/domain-value-object-class.md +2 -0
  153. package/docs/rules/domain-value-object-immutability.fr.md +55 -0
  154. package/docs/rules/domain-value-object-immutability.md +2 -0
  155. package/docs/rules/errors-constructor-not-public.fr.md +56 -0
  156. package/docs/rules/errors-constructor-not-public.md +2 -0
  157. package/docs/rules/errors-factory-name.fr.md +53 -0
  158. package/docs/rules/errors-factory-name.md +2 -0
  159. package/docs/rules/errors-through-factory.fr.md +48 -0
  160. package/docs/rules/errors-through-factory.md +2 -0
  161. package/docs/rules/event-sourcing-past-tense.fr.md +43 -0
  162. package/docs/rules/event-sourcing-past-tense.md +2 -0
  163. package/docs/rules/event-sourcing-projection-never-appends.fr.md +52 -0
  164. package/docs/rules/event-sourcing-projection-never-appends.md +2 -0
  165. package/docs/rules/event-sourcing-state-in-apply.fr.md +54 -0
  166. package/docs/rules/event-sourcing-state-in-apply.md +2 -0
  167. package/docs/rules/event-sourcing-store-behind-repository.fr.md +42 -0
  168. package/docs/rules/event-sourcing-store-behind-repository.md +2 -0
  169. package/docs/rules/event-sourcing-upcaster-required.fr.md +58 -0
  170. package/docs/rules/event-sourcing-upcaster-required.md +2 -0
  171. package/docs/rules/events-consumer-idempotent.fr.md +71 -0
  172. package/docs/rules/events-consumer-idempotent.md +2 -0
  173. package/docs/rules/events-name-format.fr.md +57 -0
  174. package/docs/rules/events-name-format.md +2 -0
  175. package/docs/rules/events-outbox-required.fr.md +60 -0
  176. package/docs/rules/events-outbox-required.md +2 -0
  177. package/docs/rules/governance-recorded-deviation.fr.md +58 -0
  178. package/docs/rules/governance-recorded-deviation.md +2 -0
  179. package/docs/rules/imports-alias-only.fr.md +77 -0
  180. package/docs/rules/imports-alias-only.md +2 -0
  181. package/docs/rules/imports-extension.fr.md +86 -0
  182. package/docs/rules/imports-extension.md +2 -0
  183. package/docs/rules/language-declared-vocabulary.fr.md +67 -0
  184. package/docs/rules/language-declared-vocabulary.md +2 -0
  185. package/docs/rules/layer-application-inward.fr.md +65 -0
  186. package/docs/rules/layer-application-inward.md +4 -2
  187. package/docs/rules/layer-domain-purity.fr.md +63 -0
  188. package/docs/rules/layer-domain-purity.md +4 -2
  189. package/docs/rules/layer-infrastructure-no-presentation.fr.md +49 -0
  190. package/docs/rules/layer-infrastructure-no-presentation.md +2 -0
  191. package/docs/rules/layer-presentation-no-infrastructure.fr.md +49 -0
  192. package/docs/rules/layer-presentation-no-infrastructure.md +2 -0
  193. package/docs/rules/lifecycle-status-through-machine.fr.md +72 -0
  194. package/docs/rules/lifecycle-status-through-machine.md +2 -0
  195. package/docs/rules/naming-business-name.fr.md +82 -0
  196. package/docs/rules/naming-business-name.md +81 -0
  197. package/docs/rules/ports-abstract-class.fr.md +73 -0
  198. package/docs/rules/ports-abstract-class.md +2 -0
  199. package/docs/rules/ports-implements-never-extends.fr.md +56 -0
  200. package/docs/rules/ports-implements-never-extends.md +2 -0
  201. package/docs/rules/ports-no-concrete-dependency.fr.md +56 -0
  202. package/docs/rules/ports-no-concrete-dependency.md +2 -0
  203. package/docs/rules/ports-no-token-constant.fr.md +60 -0
  204. package/docs/rules/ports-no-token-constant.md +2 -0
  205. package/docs/rules/ports-value-import.fr.md +58 -0
  206. package/docs/rules/ports-value-import.md +2 -0
  207. package/docs/rules/presentation-controller-delegates.fr.md +60 -0
  208. package/docs/rules/presentation-controller-delegates.md +2 -0
  209. package/docs/rules/presentation-controller-shape.fr.md +53 -0
  210. package/docs/rules/presentation-controller-shape.md +2 -0
  211. package/docs/rules/presentation-guard-at-the-edge.fr.md +58 -0
  212. package/docs/rules/presentation-guard-at-the-edge.md +2 -0
  213. package/docs/rules/presentation-shared-cache-varies.fr.md +57 -0
  214. package/docs/rules/presentation-shared-cache-varies.md +2 -0
  215. package/docs/rules/process-sends-commands-only.fr.md +67 -0
  216. package/docs/rules/process-sends-commands-only.md +2 -0
  217. package/docs/rules/purity-no-ambient-randomness.fr.md +46 -0
  218. package/docs/rules/purity-no-ambient-randomness.md +2 -0
  219. package/docs/rules/purity-no-environment.fr.md +48 -0
  220. package/docs/rules/purity-no-environment.md +2 -0
  221. package/docs/rules/purity-no-system-clock.fr.md +52 -0
  222. package/docs/rules/purity-no-system-clock.md +2 -0
  223. package/docs/rules/scheduling-job-name.fr.md +60 -0
  224. package/docs/rules/scheduling-job-name.md +2 -0
  225. package/docs/rules/scheduling-job-triggers-use-case.fr.md +74 -0
  226. package/docs/rules/scheduling-job-triggers-use-case.md +2 -0
  227. package/docs/rules/schema-presentation-only.fr.md +48 -0
  228. package/docs/rules/schema-presentation-only.md +2 -0
  229. package/docs/rules/standard-no-parallel-interface.fr.md +100 -0
  230. package/docs/rules/standard-no-parallel-interface.md +2 -0
  231. package/docs/rules/test-no-mocks.fr.md +50 -0
  232. package/docs/rules/test-no-mocks.md +2 -0
  233. package/docs/rules/tracing-platform-only.fr.md +68 -0
  234. package/docs/rules/tracing-platform-only.md +2 -0
  235. package/package.json +1 -1
package/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ **English** · [Français](README.fr.md)
2
+
1
3
  # @ddd-ts-kit/eslint-plugin
2
4
 
3
5
  AST-accurate ESLint rules for the architecture of [docs/ARCHITECTURE.md](../../docs/ARCHITECTURE.md):
@@ -10,6 +12,8 @@ Every rule reads `ddd-ts-kit.config.json` ([docs/CONFIG.md](../../docs/CONFIG.md
10
12
  walking up from the linted file, and classifies the file into context and layer exactly like
11
13
  `ddd-ts-kit check` does. It also reads `stack.style` there: see [The two styles](#the-two-styles).
12
14
 
15
+ ![ESLint hands the plugin a file; the plugin walks up to ddd-ts-kit.config.json, classifies the file as ddd-ts-kit check does (context billing, layer application, not a test file), runs each rule on its syntax tree at the severity the config gives its id, and reports the line, the problem, what to write instead and the rule](https://raw.githubusercontent.com/gbourgeat/ddd-ts-kit/main/docs/assets/diagrams/eslint-plugin-how-a-file-is-judged.svg)
16
+
13
17
  ## Install
14
18
 
15
19
  ```
@@ -31,14 +35,15 @@ export default dddTsKit({ tsconfigRootDir: import.meta.dirname });
31
35
 
32
36
  | Layer of the config | Content |
33
37
  |---|---|
38
+ | `ddd-ts-kit/ignores` | what is never linted: see `ignores` below |
34
39
  | `@eslint/js` recommended | the baseline of ESLint |
35
- | typescript-eslint `strictTypeChecked` and `stylisticTypeChecked` | with `projectService`; `strict` and `stylistic` when `typeChecked` is `false` |
40
+ | typescript-eslint `strictTypeChecked` and `stylisticTypeChecked` | with `projectService` (`ddd-ts-kit/type-information`), and without type checking on JavaScript files (`ddd-ts-kit/javascript`); `strict` and `stylistic` when `typeChecked` is `false` |
36
41
  | `ddd-ts-kit/clean-code` | the standard rules backing section 6 of the architecture reference (below) |
37
42
  | `ddd-ts-kit/architecture` | every rule of this plugin, at the severity of `rules.<id>` in `ddd-ts-kit.config.json`, else at its default, the two layout rules of `@stylistic/eslint-plugin` at the severity of `rules."clean/blank-lines"` and `curly` at the severity of `rules."clean/braces"` (default `error`) |
38
43
  | `ddd-ts-kit/scripts` | `curly` on `.js`, `.mjs` and `.cjs` files, at the severity of `rules."clean/braces"`: a branch reads the same in a script |
39
44
  | `ddd-ts-kit/inner-layers` | `no-param-reassign` with `props` in `domain/` and `application/`: no output argument |
40
45
  | `ddd-ts-kit/aggregates` | `prefer-readonly` off in aggregates and entities, whose state is replaced by intention methods |
41
- | `ddd-ts-kit/tests` | a lighter set for specs, fakes and builders |
46
+ | `ddd-ts-kit/tests` | a lighter set on `*.spec.ts`, `*.test.ts`, the `test/` directory of each context and the root `test/`: `any` and `!` warn, the `no-unsafe-*` rules off, type assertions allowed |
42
47
 
43
48
  | Option | Default | Meaning |
44
49
  |---|---|---|
@@ -47,9 +52,22 @@ export default dddTsKit({ tsconfigRootDir: import.meta.dirname });
47
52
  | `allowDefaultProject` | `['*.config.ts', '*.config.mts']` | files outside the tsconfig still linted with types |
48
53
  | `ignores` | none | added to `dist`, `coverage`, `node_modules`, `reports`, `*.d.ts`, and `clients/*/src` when `ddd-ts-kit.config.json` has `"sdk"` (the clients the CLI generates) |
49
54
 
55
+ Blocks are applied in this order, and a later block wins for the files it matches. A block of
56
+ your own goes after the helper:
57
+
58
+ ```js
59
+ import { dddTsKit } from '@ddd-ts-kit/eslint-plugin';
60
+
61
+ export default [
62
+ ...dddTsKit({ tsconfigRootDir: import.meta.dirname, ignores: ['src/generated/**'] }),
63
+ // a rule the kit does not enable: purity/no-environment refuses console in domain/ and application/ only
64
+ { files: ['src/**/*.ts'], rules: { 'no-console': 'error' } },
65
+ ];
66
+ ```
67
+
50
68
  To compose a config by hand, the plugin is the default export, with two presets that hold only
51
- its own rules, the three typescript-eslint rules they delegate to and the four layout rules of
52
- `@stylistic/eslint-plugin`, without type information:
69
+ its own rules, the three typescript-eslint rules they delegate to, the two layout rules of
70
+ `@stylistic/eslint-plugin` and `curly`, without type information:
53
71
 
54
72
  ```js
55
73
  import dddTsKit from '@ddd-ts-kit/eslint-plugin';
@@ -70,6 +88,104 @@ import dddTsKit, { standardRules } from '@ddd-ts-kit/eslint-plugin';
70
88
  export default [{ files: ['**/*.ts'], plugins: { 'ddd-ts-kit': dddTsKit, '@stylistic': stylistic }, rules: standardRules.layout }];
71
89
  ```
72
90
 
91
+ ### Changing a severity
92
+
93
+ The severity of a rule of the kit is written once, in `ddd-ts-kit.config.json`, where both
94
+ tools read it:
95
+
96
+ ```json
97
+ {
98
+ "rules": {
99
+ "clean/function-size": "error",
100
+ "test/no-mocks": "off"
101
+ }
102
+ }
103
+ ```
104
+
105
+ ```js
106
+ // instead of: a severity in eslint.config.mjs, which `ddd-ts-kit check` never sees
107
+ export default [...dddTsKit(), { rules: { 'ddd-ts-kit/test-no-mocks': 'off' } }];
108
+ ```
109
+
110
+ `"off"` in the config silences the rule even where an ESLint config enables it. Raising a
111
+ severity is free; lowering one under its default (`off`, or `warn` for an `error` rule) is a
112
+ deviation, and `ddd-ts-kit check` asks for its decision record: see
113
+ [Deviations](../../docs/CONFIG.md#deviations).
114
+
115
+ ## A report, and what to write instead
116
+
117
+ Every message says what is wrong, what to write instead, and the rule. A handler that reads the
118
+ system clock, in `src/contexts/billing/application/commands/issue-invoice/issue-invoice.handler.ts`:
119
+
120
+ ```ts
121
+ // instead of
122
+ import type { IdGenerator } from '@ddd-ts-kit/kernel';
123
+ import { Invoice } from '@/contexts/billing/domain/aggregates/invoice.aggregate.js';
124
+ import type { InvoiceRepository } from '@/contexts/billing/domain/repositories/invoice.repository.js';
125
+ import type { IssueInvoice } from '@/contexts/billing/application/commands/issue-invoice/issue-invoice.command.js';
126
+
127
+ export class IssueInvoiceHandler {
128
+ constructor(
129
+ private readonly invoices: InvoiceRepository,
130
+ private readonly ids: IdGenerator,
131
+ ) {}
132
+
133
+ async execute(command: IssueInvoice): Promise<string> {
134
+ const id = this.ids.next();
135
+
136
+ await this.invoices.save(Invoice.issue(id, command.customerId, new Date()));
137
+
138
+ return id;
139
+ }
140
+ }
141
+ ```
142
+
143
+ is reported, by `npx eslint src`:
144
+
145
+ ```
146
+ src/contexts/billing/application/commands/issue-invoice/issue-invoice.handler.ts
147
+ 16:68 error new Date() without argument is used in the application layer. Receive the instant as a parameter in the domain, and take it from the Clock port (`this.clock.now()`) in a handler, so that a test fixes time with FixedClock ddd-ts-kit/purity-no-system-clock
148
+ ```
149
+
150
+ The fix the message names: the `Clock` port, which a spec fixes with `FixedClock`.
151
+
152
+ <!-- checked sample -->
153
+ ```ts
154
+ import { AuthorizedCommand, Clock, IdGenerator, type Actor } from '@ddd-ts-kit/kernel';
155
+
156
+ // the command, the aggregate and its repository port, in their own files
157
+ declare class IssueInvoice extends AuthorizedCommand<string> {
158
+ readonly customerId: string;
159
+ constructor(actor: Actor, customerId: string);
160
+ }
161
+ declare class Invoice {
162
+ static issue(id: string, customerId: string, issuedAt: Date): Invoice;
163
+ }
164
+ declare abstract class InvoiceRepository {
165
+ abstract save(invoice: Invoice): Promise<void>;
166
+ }
167
+
168
+ // write: the instant comes from a port
169
+ export class IssueInvoiceHandler {
170
+ constructor(
171
+ private readonly invoices: InvoiceRepository,
172
+ private readonly clock: Clock,
173
+ private readonly ids: IdGenerator,
174
+ ) {}
175
+
176
+ async execute(command: IssueInvoice): Promise<string> {
177
+ const id = this.ids.next();
178
+
179
+ await this.invoices.save(Invoice.issue(id, command.customerId, this.clock.now()));
180
+
181
+ return id;
182
+ }
183
+ }
184
+ ```
185
+
186
+ When the code is right and the rule is not, the deviation is recorded, not hidden: see the
187
+ suppression comment in [Settings](#settings).
188
+
73
189
  ## Rules
74
190
 
75
191
  Ids are those of [docs/ARCHITECTURE.md](../../docs/ARCHITECTURE.md); the ESLint name replaces the
@@ -86,6 +202,7 @@ is an error whatever the configured limit). `strict` sets every rule to `error`.
86
202
  | [`context/declared-relationship`](docs/rules/context-declared-relationship.md) | `ddd-ts-kit/context-declared-relationship` | such an import needs the upstream declared in the config | `error` | custom |
87
203
  | [`context/published-language-is-a-contract`](docs/rules/context-published-language-is-a-contract.md) | `ddd-ts-kit/context-published-language-is-a-contract` | `published-language/` imports only its allow-list and other published languages | `error` | custom |
88
204
  | [`language/declared-vocabulary`](docs/rules/language-declared-vocabulary.md) | `ddd-ts-kit/language-declared-vocabulary` | a value of a closed vocabulary the project declares (an object `as const` with the union type of its name, a permission set) is read through it, never written again as a string, under `"stack.literals": "named"`; tests and published languages excluded | `error` | custom |
205
+ | [`naming/business-name`](docs/rules/naming-business-name.md) | `ddd-ts-kit/naming-business-name` | a variable, parameter, property, destructured or loop binding of `domain/`, `application/` and the shared kernel is named after its concept, never `target`, `data`, `item` or another generic word (`words`, `allow`, `businessNames` of the config); fixable where the initializer names the concept | `error` | custom |
89
206
  | [`purity/no-system-clock`](docs/rules/purity-no-system-clock.md) | `ddd-ts-kit/purity-no-system-clock` | no `new Date()`, `Date.now()`, `Date()`, `performance.now()` in `domain/` and `application/` | `error` | custom |
90
207
  | [`purity/no-ambient-randomness`](docs/rules/purity-no-ambient-randomness.md) | `ddd-ts-kit/purity-no-ambient-randomness` | no `Math.random`, `crypto.randomUUID`, id library in `domain/` and `application/` | `error` | custom |
91
208
  | [`purity/no-environment`](docs/rules/purity-no-environment.md) | `ddd-ts-kit/purity-no-environment` | no `process.env`, `console`, `fetch`, file system or network module in `domain/` and `application/` | `error` | custom |
@@ -227,7 +344,7 @@ is not reported for following the conventions of the kit:
227
344
  | `no-unnecessary-type-arguments` | off | the id type of an aggregate is part of its declaration |
228
345
  | `consistent-type-definitions` | off | props are type aliases, states and options are interfaces |
229
346
  | `no-empty-object-type` | interfaces allowed | `interface SessionExtensions {}` is left open for declaration merging |
230
- | `no-extraneous-class` | empty classes allowed | a domain service or a fake starts empty |
347
+ | `no-extraneous-class` | empty classes and decorated classes allowed | a domain service or a fake starts empty; a class that carries a decorator is a declaration, whatever its body |
231
348
  | `no-unused-vars` | `args: 'none'` | an adapter implements the whole signature of its port |
232
349
  | `dot-notation` | index signatures allowed | `process.env['PORT']` |
233
350
  | `no-confusing-void-expression`, `restrict-template-expressions`, `restrict-plus-operands` | arrow shorthand, numbers and booleans allowed | not coercion bugs |
@@ -261,16 +378,39 @@ editor after changing `ddd-ts-kit.config.json`.
261
378
  Two things work as with the CLI checker: `rules.<id>: "off"` in the config silences the rule
262
379
  even when the ESLint config enables it, and `// ddd-ts-kit-disable-next-line <id> -- <reason>`
263
380
  silences one line for both tools. A suppression without a reason silences nothing, and
264
- `governance/recorded-deviation` asks that the reason point to a decision record (`ADR-<number>`).
381
+ `governance/recorded-deviation` asks that the reason point to a decision record (`ADR-<number>`):
382
+
383
+ ```ts
384
+ // instead of: a reason that points to no decision
385
+ // ddd-ts-kit-disable-next-line clean/no-flag-argument -- kept for now
386
+ cancel(force: boolean): void {
387
+ ```
388
+
389
+ ```
390
+ 12:3 error `ddd-ts-kit-disable-next-line clean/no-flag-argument` on line 12 silences a rule without pointing to a decision. Fix the diagnostic; if the deviation is deliberate, record it with `ddd-ts-kit generate adr` (reason, scope, condition for removing it) and end the comment with `-- ADR-<number>: <reason>` ddd-ts-kit/governance-recorded-deviation
391
+ ```
392
+
393
+ ```ts
394
+ // write: the decision record says why, for what scope and until when
395
+ // ddd-ts-kit-disable-next-line clean/no-flag-argument -- ADR-0007: the legacy import sends a flag until 2027
396
+ cancel(force: boolean): void {
397
+ ```
398
+
399
+ The id is the one of the architecture reference (`clean/no-flag-argument`), not the ESLint name,
400
+ and `npx ddd-ts-kit generate adr` writes the record. `eslint-disable` comments are held the same
401
+ way, by `clean/no-escape-hatch` and `governance/recorded-deviation`.
265
402
 
266
403
  ## With `ddd-ts-kit check`
267
404
 
268
- Two tools, one set of ids, no overlap of authority.
405
+ Two tools, one set of ids, no overlap of authority. A third, dependency-cruiser, does not read the
406
+ config: it runs on a file generated from it, with its own rule names.
407
+
408
+ ![The plugin and ddd-ts-kit check read ddd-ts-kit.config.json at run time and share its rule ids, severities and suppression comments: the plugin judges one source file at a time on its syntax tree and is right when it disagrees with the checker; the checker judges what spans files, the tree, names, glossaries, config and barrel; dependency-cruiser runs only on the .dependency-cruiser.cjs that depcruise-config --write generates from the config and judges the resolved import graph with its own rule names, always at severity error, ignoring suppression comments](https://raw.githubusercontent.com/gbourgeat/ddd-ts-kit/main/docs/assets/diagrams/eslint-plugin-two-tools.svg)
269
409
 
270
410
  | Concern | Authority | Why |
271
411
  |---|---|---|
272
- | imports and boundaries (`layer/*`, `context/published-language-only`, `context/declared-relationship`, `context/published-language-is-a-contract`), `purity/*`, `clean/*`, `test/no-mocks`, `events/name-format`, `domain/*`, `application/*`, the code side of `events/outbox-required`, `events/consumer-idempotent`, `context/extractable`, `authz/*`, `aspects/outside-in`, `tracing/platform-only`, `domain-events/dispatched-on-save`, `domain-events/transactional-before-commit` on a declared class, `event-sourcing/*` (but the lock of `event-sourcing/upcaster-required`), `standard/no-parallel-interface`, `declarations/role-declared`, `ports/*`, `scheduling/*` (but the uniqueness of job names) and `governance/recorded-deviation` | this plugin | it reads the syntax tree: no false positive from a string or a comment, shadowing and arrow functions are understood |
273
- | the tree (`tree/closed`, `tree/context-doc`), names and files (`naming/*`, `test/spec-required`, `test/builder-required`), the language (`language/*`), the config (`config/*`, `context/no-cycle`), `events/defined-in-published-language`, `composition/only-in-module`, `declarations/barrel-current`, unique consumer names and job names, one declared class per role file, of `domain-events/transactional-before-commit` the adapters of an `application/ports/` port and the phase of an explicit-style handler, the config side of the ids above (`stack.events`, lowered severities, that a decision record exists) | `ddd-ts-kit check` | they judge the project, the glossary and files that are not sources; ESLint judges one source at a time |
412
+ | imports and boundaries (`layer/*`, `context/published-language-only`, `context/declared-relationship`, `context/published-language-is-a-contract`), `purity/*`, `clean/*`, `test/no-mocks`, `events/name-format`, `domain/*`, `application/*`, the code side of `events/outbox-required`, `events/consumer-idempotent`, `context/extractable`, `authz/*`, `aspects/outside-in`, `tracing/platform-only`, `domain-events/dispatched-on-save`, `domain-events/transactional-before-commit` on a declared class, `event-sourcing/*` (but the lock of `event-sourcing/upcaster-required`), `standard/no-parallel-interface`, `declarations/role-declared`, `ports/*`, `scheduling/*` (but the uniqueness of job names), `language/declared-vocabulary`, `errors/through-factory`, `errors/constructor-not-public`, `errors/factory-name`, `presentation/*`, `lifecycle/*`, `process/*`, `schema/presentation-only`, `imports/alias-only`, `imports/extension` and `governance/recorded-deviation` | this plugin | it reads the syntax tree: no false positive from a string or a comment, shadowing and arrow functions are understood |
413
+ | the tree (`tree/closed`, `tree/context-doc`), names and files (`naming/*` but the code side of `naming/business-name`, which this plugin reads on the syntax tree and fixes, `test/spec-required`, `test/builder-required`), the language (`language/glossary-term`, `language/no-technical-name`), error codes (`errors/code-unique`, `errors/known-code`), `imports/alias-declared`, `schema/no-duplicate-shape`, the config (`config/*`, `context/no-cycle`), `events/defined-in-published-language`, `composition/only-in-module`, `declarations/barrel-current`, unique consumer names and job names, one declared class per role file, of `domain-events/transactional-before-commit` the adapters of an `application/ports/` port and the phase of an explicit-style handler, the config side of the ids above (`stack.events`, lowered severities, that a decision record exists) | `ddd-ts-kit check` | they judge the project, the glossary and files that are not sources; ESLint judges one source at a time |
274
414
  | the real dependency graph (barrels, cycles, orphans, dev dependencies in production code) | dependency-cruiser, configured by the `.dependency-cruiser.cjs` that `ddd-ts-kit depcruise-config --write` generates from the config | it resolves modules instead of classifying paths |
275
415
 
276
416
  The CLI keeps approximating the code-level rules with regular expressions, without dependency:
@@ -42,6 +42,12 @@ export interface AllowedFile {
42
42
  export interface OnePerFile {
43
43
  readonly allow: readonly AllowedFile[];
44
44
  }
45
+ /** The generic words `naming/business-name` reports: `words` replaces its list, `allow` removes some of them. */
46
+ export interface BusinessNames {
47
+ /** Undefined: the default list of the rule. */
48
+ readonly words: readonly string[] | undefined;
49
+ readonly allow: readonly string[];
50
+ }
45
51
  export interface Config {
46
52
  readonly sourceRoot: string;
47
53
  readonly contextsDir: string;
@@ -61,6 +67,8 @@ export interface Config {
61
67
  readonly stack: Stack;
62
68
  /** Names reported by `standard/no-parallel-interface`, over its defaults: the kernel interface to use instead, or `false` to drop a default. */
63
69
  readonly standardInterfaces: Readonly<Record<string, string | false>>;
70
+ /** The words of `naming/business-name`, over its defaults, as the checker reads them. */
71
+ readonly businessNames: BusinessNames;
64
72
  /** The clients generated from the contract (`ddd-ts-kit sdk`), whose sources under `clients/` are not linted; none without the key. */
65
73
  readonly sdk: SdkConfig | undefined;
66
74
  }
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/project/config.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAEhD,MAAM,WAAW,QAAQ;IAC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;IAChJ,QAAQ,CAAC,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC;IACtE,yFAAyF;IACzF,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,uIAAuI;IACvI,QAAQ,CAAC,GAAG,EAAE,SAAS,GAAG,SAAS,CAAC;CACrC;AAED,uGAAuG;AACvG,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"parse-config.d.ts","sourceRoot":"","sources":["../../src/project/parse-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAQV,MAAM,EAEP,MAAM,aAAa,CAAC;AAOrB,+GAA+G;AAC/G,eAAO,MAAM,sBAAsB,MAAM,CAAC;AA2B1C;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CA0BhD"}
1
+ {"version":3,"file":"parse-config.d.ts","sourceRoot":"","sources":["../../src/project/parse-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EASV,MAAM,EAEP,MAAM,aAAa,CAAC;AAOrB,+GAA+G;AAC/G,eAAO,MAAM,sBAAsB,MAAM,CAAC;AA2B1C;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CA2BhD"}
@@ -48,9 +48,22 @@ export function parseConfig(raw) {
48
48
  onePerFile: parseOnePerFile(source['onePerFile']),
49
49
  stack: parseStack(source['stack']),
50
50
  standardInterfaces: parseStandardInterfaces(source['standardInterfaces']),
51
+ businessNames: parseBusinessNames(source['businessNames']),
51
52
  sdk: parseSdk(source['sdk']),
52
53
  };
53
54
  }
55
+ /** As in the CLI: an entry that is not a word is left out, and a `words` that is not a list keeps the defaults. */
56
+ function parseBusinessNames(value) {
57
+ const raw = isRecord(value) ? value : {};
58
+ const words = raw['words'];
59
+ return {
60
+ words: Array.isArray(words) ? wordsOf(words) : undefined,
61
+ allow: Array.isArray(raw['allow']) ? wordsOf(raw['allow']) : [],
62
+ };
63
+ }
64
+ function wordsOf(entries) {
65
+ return entries.filter((entry) => typeof entry === 'string' && entry.trim() !== '');
66
+ }
54
67
  /** A key that is not an object asks for no client, as in the CLI. */
55
68
  function parseSdk(value) {
56
69
  return isRecord(value) ? { name: text(value['name'], DEFAULT_SDK_NAME) } : undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"parse-config.js","sourceRoot":"","sources":["../../src/project/parse-config.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,cAAc,GAAW,EAAE,aAAa,EAAE,CAAC,EAAE,gBAAgB,EAAE,EAAE,EAAE,CAAC;AAE1E,+GAA+G;AAC/G,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAE1C,MAAM,MAAM,GAAqB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AAE1D,MAAM,UAAU,GAAwB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAChE,MAAM,qBAAqB,GAAqC,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AACxF,MAAM,aAAa,GAAiC,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAC7E,MAAM,YAAY,GAAgC,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAC1E,MAAM,aAAa,GAAiC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AACtE,MAAM,WAAW,GAA+B,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AAEpE,MAAM,MAAM,GAAG,CAAC,oBAAoB,CAAC,CAAC;AAEtC,uFAAuF;AACvF,MAAM,gBAAgB,GAAG,6BAA6B,CAAC;AAEvD,0HAA0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,CAAC;AAED,SAAS,QAAQ,CAAC,SAAkB,EAAE,QAAgB;IACpD,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC9G,CAAC;AAED,SAAS,UAAU,CAAI,KAAc,EAAE,KAA4B;IACjE,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACrH,CAAC;AAED,SAAS,OAAO,CAAC,KAAc,EAAE,QAA2B;IAC1D,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC5F,CAAC;AAED,SAAS,KAAK,CAAmB,MAAoB,EAAE,SAAkB,EAAE,QAAW;IACpF,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,IAAI,QAAQ,CAAC;AACjE,CAAC;AAED,SAAS,IAAI,CAAC,KAAc,EAAE,QAAgB;IAC5C,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC;AACtD,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { type TSESLint } from '@typescript-eslint/utils';
2
+ import { type BusinessNameOptions } from '../support/business-names/words-of.js';
3
+ type Options = [BusinessNameOptions];
4
+ export declare const namingBusinessName: TSESLint.RuleModule<"generic", Options, import("../index.js").RuleDocs, TSESLint.RuleListener>;
5
+ export {};
6
+ //# sourceMappingURL=naming-business-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"naming-business-name.d.ts","sourceRoot":"","sources":["../../src/rules/naming-business-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,QAAQ,EAAiB,MAAM,0BAA0B,CAAC;AAkBxF,OAAO,EAAW,KAAK,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAI1F,KAAK,OAAO,GAAG,CAAC,mBAAmB,CAAC,CAAC;AA0BrC,eAAO,MAAM,kBAAkB,gGA+B7B,CAAC"}
@@ -0,0 +1,175 @@
1
+ import { AST_NODE_TYPES } from '@typescript-eslint/utils';
2
+ import { bindingAdvice } from '../support/business-names/binding-advice.js';
3
+ import { builtClass } from '../support/business-names/built-class.js';
4
+ import { camel } from '../support/business-names/camel.js';
5
+ import { collectionElement } from '../support/business-names/collection-element.js';
6
+ import { calledMember } from '../support/business-names/called-member.js';
7
+ import { conventionalModelName } from '../support/business-names/conventional-model-name.js';
8
+ import { isNameFree } from '../support/business-names/is-name-free.js';
9
+ import { judgesNames } from '../support/business-names/judges-names.js';
10
+ import { patternIdentifiers } from '../support/business-names/pattern-identifiers.js';
11
+ import { plural } from '../support/business-names/plural.js';
12
+ import { renameFix } from '../support/business-names/rename-fix.js';
13
+ import { repositoryConcept } from '../support/business-names/repository-concept.js';
14
+ import { singular } from '../support/business-names/singular.js';
15
+ import { typedNames } from '../support/business-names/typed-names.js';
16
+ import { wordsOf } from '../support/business-names/words-of.js';
17
+ import { defineRule } from '../support/rule/define-rule.js';
18
+ /** Everything that declares parameters: functions, methods, abstract and overload signatures, function types. */
19
+ const WITH_PARAMETERS = [
20
+ 'FunctionDeclaration',
21
+ 'FunctionExpression',
22
+ 'ArrowFunctionExpression',
23
+ 'TSDeclareFunction',
24
+ 'TSEmptyBodyFunctionExpression',
25
+ 'TSMethodSignature',
26
+ 'TSFunctionType',
27
+ 'TSCallSignatureDeclaration',
28
+ 'TSConstructSignatureDeclaration',
29
+ 'TSConstructorType',
30
+ ].join(', ');
31
+ export const namingBusinessName = defineRule({
32
+ id: 'naming/business-name',
33
+ type: 'suggestion',
34
+ fixable: 'code',
35
+ recommended: 'error',
36
+ description: 'A variable, parameter, property, destructured or loop binding of domain/ and application/ (and of the shared kernel) is named after the concept it holds, never a generic word such as target, data or item.',
37
+ messages: {
38
+ generic: 'The {{kind}} `{{name}}` is named with a generic word: the code of the model speaks the ubiquitous language of its context, and `{{name}}` hides which concept it holds. {{advice}}',
39
+ },
40
+ schema: [
41
+ {
42
+ type: 'object',
43
+ properties: {
44
+ words: { type: 'array', items: { type: 'string' } },
45
+ allow: { type: 'array', items: { type: 'string' } },
46
+ },
47
+ additionalProperties: false,
48
+ },
49
+ ],
50
+ defaultOptions: [{}],
51
+ create({ context, file, options, report }) {
52
+ const words = wordsOf(file.config, options[0]);
53
+ if (words.size === 0 || !judgesNames(file)) {
54
+ return {};
55
+ }
56
+ return listeners({ context, file, words, report, typed: typedNames(context, file) });
57
+ },
58
+ });
59
+ /** Every place a name is bound: declarators, parameter lists, class properties and the properties of a declared shape. */
60
+ function listeners(judged) {
61
+ return {
62
+ VariableDeclarator(node) {
63
+ if (node.id.type === AST_NODE_TYPES.Identifier) {
64
+ judgeVariable(judged, node, node.id);
65
+ return;
66
+ }
67
+ for (const identifier of patternIdentifiers(node.id)) {
68
+ judgeName(judged, identifier, 'destructured binding');
69
+ }
70
+ },
71
+ [WITH_PARAMETERS](node) {
72
+ for (const parameter of node.params) {
73
+ for (const identifier of patternIdentifiers(parameter)) {
74
+ judgeName(judged, identifier, parameterKind(parameter));
75
+ }
76
+ }
77
+ },
78
+ 'PropertyDefinition, TSAbstractPropertyDefinition'(node) {
79
+ if (!node.computed && node.key.type === AST_NODE_TYPES.Identifier) {
80
+ judgeName(judged, node.key, 'property');
81
+ }
82
+ },
83
+ TSPropertySignature(node) {
84
+ if (!node.computed && node.key.type === AST_NODE_TYPES.Identifier && declaresAShape(node.parent)) {
85
+ judgeName(judged, node.key, 'property');
86
+ }
87
+ },
88
+ };
89
+ }
90
+ function parameterKind(parameter) {
91
+ if (parameter.type === AST_NODE_TYPES.TSParameterProperty) {
92
+ return 'property';
93
+ }
94
+ const bound = parameter.type === AST_NODE_TYPES.AssignmentPattern ? parameter.left : parameter;
95
+ const named = bound.type === AST_NODE_TYPES.RestElement ? bound.argument : bound;
96
+ return named.type === AST_NODE_TYPES.Identifier ? 'parameter' : 'destructured binding';
97
+ }
98
+ /** An interface, or a type alias of an object: a type literal nested in an annotation is not a declaration of the model. */
99
+ function declaresAShape(body) {
100
+ return (body.type === AST_NODE_TYPES.TSInterfaceBody ||
101
+ (body.type === AST_NODE_TYPES.TSTypeLiteral && body.parent.type === AST_NODE_TYPES.TSTypeAliasDeclaration));
102
+ }
103
+ function judgeName(judged, identifier, kind) {
104
+ if (judged.words.has(identifier.name)) {
105
+ reportName(judged, { identifier, kind, suggestion: undefined, fix: undefined });
106
+ }
107
+ }
108
+ function reportName(judged, { identifier, kind, suggestion, fix }) {
109
+ judged.report({
110
+ node: identifier,
111
+ messageId: 'generic',
112
+ data: { kind, name: identifier.name, advice: bindingAdvice(kind, suggestion) },
113
+ ...(fix === undefined ? {} : { fix }),
114
+ });
115
+ }
116
+ /** A variable: renamed when its initializer says which concept it holds and the name is free, reported otherwise. */
117
+ function judgeVariable(judged, declarator, identifier) {
118
+ if (!judged.words.has(identifier.name)) {
119
+ return;
120
+ }
121
+ const loop = walkedCollection(declarator);
122
+ if (loop !== undefined) {
123
+ const element = judged.typed?.modelOf(loop)?.element ?? collectionElement(loop);
124
+ reportName(judged, { identifier, kind: 'loop variable', suggestion: element, fix: undefined });
125
+ return;
126
+ }
127
+ reportName(judged, { identifier, kind: 'variable', ...renaming(judged, declarator, identifier) });
128
+ }
129
+ /** The name the initializer of a variable gives to what it holds, and the fix when the variable holds as many as the name says. */
130
+ function renaming(judged, declarator, identifier) {
131
+ const several = singular(identifier.name) !== undefined;
132
+ const proposal = declarator.init === null ? undefined : proposedName(judged, declarator.init, several);
133
+ if (proposal === undefined) {
134
+ return { suggestion: undefined, fix: undefined };
135
+ }
136
+ const name = proposal.many ? plural(proposal.element) : proposal.element;
137
+ return { suggestion: name, fix: proposal.many === several ? safeRename(judged, declarator, name) : undefined };
138
+ }
139
+ /** The renaming of the variable a declarator declares, unless the name is taken where it is used. */
140
+ function safeRename(judged, declarator, name) {
141
+ const variable = judged.context.sourceCode.getDeclaredVariables(declarator)[0];
142
+ return variable !== undefined && isNameFree(variable, name) ? renameFix(variable, name) : undefined;
143
+ }
144
+ /** `due` in `for (const target of due)`. */
145
+ function walkedCollection(declarator) {
146
+ const loop = declarator.parent.parent;
147
+ const walks = (loop.type === AST_NODE_TYPES.ForOfStatement || loop.type === AST_NODE_TYPES.ForInStatement) &&
148
+ loop.left === declarator.parent;
149
+ return walks ? loop.right : undefined;
150
+ }
151
+ /**
152
+ * The concept an initializer holds: the class of the project it builds, or what a repository it
153
+ * reads answers, by its type when the parser has one, by the names of the kit otherwise; for
154
+ * `found ?? X.create(..)`, either side.
155
+ */
156
+ function proposedName(judged, init, several) {
157
+ if (init.type === AST_NODE_TYPES.LogicalExpression && init.operator === '??') {
158
+ return proposedName(judged, init.right, several) ?? proposedName(judged, init.left, several);
159
+ }
160
+ const built = builtClass(judged.context.sourceCode, judged.file, init);
161
+ if (built !== undefined) {
162
+ return { element: camel(built), many: false };
163
+ }
164
+ const call = calledMember(init);
165
+ if (call === undefined) {
166
+ return undefined;
167
+ }
168
+ const { typed } = judged;
169
+ if (typed === undefined) {
170
+ return conventionalModelName(call, several);
171
+ }
172
+ const reads = typed.isRepository(call.object) || repositoryConcept(call.object) !== undefined;
173
+ return reads ? typed.modelOf(init) : undefined;
174
+ }
175
+ //# sourceMappingURL=naming-business-name.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"naming-business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AAI,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC/F,CAAC;IAED,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAEvE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IAChD,CAAC;IAED,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAEhC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IAEzB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,qBAAqB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,SAAS,CAAC;IAE9F,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACjD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/rules/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,OAAO,EAAE,MAAM,4BAA4B,CAAC;AA8IlE,+HAA+H;AAC/H,eAAO,MAAM,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEnD,CAAC"}
1
+ {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/rules/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAgJlE,+HAA+H;AAC/H,eAAO,MAAM,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEnD,CAAC"}
@@ -54,6 +54,7 @@ import { presentationGuardAtTheEdge } from './presentation-guard-at-the-edge.js'
54
54
  import { presentationSharedCacheVaries } from './presentation-shared-cache-varies.js';
55
55
  import { purityNoAmbientRandomness, purityNoEnvironment, purityNoSystemClock } from './purity.js';
56
56
  import { lifecycleStatusThroughMachine } from './lifecycle-status-through-machine.js';
57
+ import { namingBusinessName } from './naming-business-name.js';
57
58
  import { processSendsCommandsOnly } from './process-sends-commands-only.js';
58
59
  import { schedulingJobName } from './scheduling-job-name.js';
59
60
  import { schedulingJobTriggersUseCase } from './scheduling-job-triggers-use-case.js';
@@ -72,6 +73,7 @@ const ALL = [
72
73
  contextDeclaredRelationship,
73
74
  contextPublishedLanguageIsAContract,
74
75
  languageDeclaredVocabulary,
76
+ namingBusinessName,
75
77
  purityNoSystemClock,
76
78
  purityNoAmbientRandomness,
77
79
  purityNoEnvironment,
@@ -1 +1 @@
1
- {"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/rules/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAgB,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAC9F,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B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AAgB;IAChB,oBAAoB;IACpB,wBAAwB;IACxB,kBAAkB;IAClB,aAAa;IACb,kBAAkB;IAClB,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,mBAAmB;IACnB,2BAA2B;IAC3B,2BAA2B;IAC3B,wBAAwB;IACxB,gCAAgC;IAChC,kBAAkB;IAClB,2BAA2B;IAC3B,oBAAoB;IACpB,yBAAyB;IACzB,gBAAgB;IAChB,4BAA4B;IAC5B,6BAA6B;IAC7B,wBAAwB;IACxB,iBAAiB;IACjB,sBAAsB;IACtB,gBAAgB;IAChB,gBAAgB;IAChB,2BAA2B;IAC3B,+BAA+B;IAC/B,0BAA0B;IAC1B,6BAA6B;CAC9B,CAAC;AAEF,+HAA+H;AAC/H,MAAM,CAAC,MAAM,KAAK,GAAsC,MAAM,CAAC,WAAW,CACxE,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAC7C,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { BindingKind } from './binding-kind.js';
2
+ /** What the message asks for: the name the code already gives to the concept, or how to find one. */
3
+ export declare function bindingAdvice(kind: BindingKind, suggestion: string | undefined): string;
4
+ //# sourceMappingURL=binding-advice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binding-advice.d.ts","sourceRoot":"","sources":["../../../src/support/business-names/binding-advice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,qGAAqG;AACrG,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAUvF"}
@@ -0,0 +1,12 @@
1
+ /** What the message asks for: the name the code already gives to the concept, or how to find one. */
2
+ export function bindingAdvice(kind, suggestion) {
3
+ if (kind === 'loop variable') {
4
+ return suggestion === undefined
5
+ ? 'Name it after one element of the collection, in the singular (`for (const reminder of dueReminders)`).'
6
+ : `Name it after one element of the collection, in the singular: \`${suggestion}\`.`;
7
+ }
8
+ return suggestion === undefined
9
+ ? 'Name it after the concept it holds, a term of the glossary of the context (CONTEXT.md).'
10
+ : `Name it \`${suggestion}\`, the name the code already gives to what it holds.`;
11
+ }
12
+ //# sourceMappingURL=binding-advice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binding-advice.js","sourceRoot":"","sources":["../../../src/support/business-names/binding-advice.ts"],"names":[],"mappings":"AAEA,qGAAqG;AACrG,MAAM,UAAU,aAAa,CAAC,IAAiB,EAAE,UAA8B;IAC7E,IAAI,IAAI,KAAK,eAAe,EAAE,CAAC;QAC7B,OAAO,UAAU,KAAK,SAAS;YAC7B,CAAC,CAAC,wGAAwG;YAC1G,CAAC,CAAC,mEAAmE,UAAU,KAAK,CAAC;IACzF,CAAC;IAED,OAAO,UAAU,KAAK,SAAS;QAC7B,CAAC,CAAC,yFAAyF;QAC3F,CAAC,CAAC,aAAa,UAAU,uDAAuD,CAAC;AACrF,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** What a binding names, for the message: the reader needs to know which one it is. */
2
+ export type BindingKind = 'variable' | 'loop variable' | 'destructured binding' | 'parameter' | 'property';
3
+ //# sourceMappingURL=binding-kind.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binding-kind.d.ts","sourceRoot":"","sources":["../../../src/support/business-names/binding-kind.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,eAAe,GAAG,sBAAsB,GAAG,WAAW,GAAG,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=binding-kind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binding-kind.js","sourceRoot":"","sources":["../../../src/support/business-names/binding-kind.ts"],"names":[],"mappings":""}