@ddd-ts-kit/eslint-plugin 0.0.0-stage → 0.1.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 (745) hide show
  1. package/README.md +292 -2
  2. package/dist/ddd-ts-kit.d.ts +5 -0
  3. package/dist/ddd-ts-kit.d.ts.map +1 -0
  4. package/dist/ddd-ts-kit.js +7 -0
  5. package/dist/ddd-ts-kit.js.map +1 -0
  6. package/dist/index.d.ts +9 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +6 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/plugin.d.ts +11 -0
  11. package/dist/plugin.d.ts.map +1 -0
  12. package/dist/plugin.js +30 -0
  13. package/dist/plugin.js.map +1 -0
  14. package/dist/presets/braces-rules.d.ts +11 -0
  15. package/dist/presets/braces-rules.d.ts.map +1 -0
  16. package/dist/presets/braces-rules.js +10 -0
  17. package/dist/presets/braces-rules.js.map +1 -0
  18. package/dist/presets/create-ddd-ts-kit.d.ts +21 -0
  19. package/dist/presets/create-ddd-ts-kit.d.ts.map +1 -0
  20. package/dist/presets/create-ddd-ts-kit.js +123 -0
  21. package/dist/presets/create-ddd-ts-kit.js.map +1 -0
  22. package/dist/presets/flat-rules.d.ts +3 -0
  23. package/dist/presets/flat-rules.d.ts.map +1 -0
  24. package/dist/presets/flat-rules.js +2 -0
  25. package/dist/presets/flat-rules.js.map +1 -0
  26. package/dist/presets/layout-rules.d.ts +11 -0
  27. package/dist/presets/layout-rules.d.ts.map +1 -0
  28. package/dist/presets/layout-rules.js +33 -0
  29. package/dist/presets/layout-rules.js.map +1 -0
  30. package/dist/presets/plugin-rule-levels.d.ts +4 -0
  31. package/dist/presets/plugin-rule-levels.d.ts.map +1 -0
  32. package/dist/presets/plugin-rule-levels.js +13 -0
  33. package/dist/presets/plugin-rule-levels.js.map +1 -0
  34. package/dist/presets/standard-rule-sets.d.ts +12 -0
  35. package/dist/presets/standard-rule-sets.d.ts.map +1 -0
  36. package/dist/presets/standard-rule-sets.js +15 -0
  37. package/dist/presets/standard-rule-sets.js.map +1 -0
  38. package/dist/presets/standard-rules.d.ts +24 -0
  39. package/dist/presets/standard-rules.d.ts.map +1 -0
  40. package/dist/presets/standard-rules.js +88 -0
  41. package/dist/presets/standard-rules.js.map +1 -0
  42. package/dist/project/alias-root.d.ts +8 -0
  43. package/dist/project/alias-root.d.ts.map +1 -0
  44. package/dist/project/alias-root.js +2 -0
  45. package/dist/project/alias-root.js.map +1 -0
  46. package/dist/project/alias-roots.d.ts +9 -0
  47. package/dist/project/alias-roots.d.ts.map +1 -0
  48. package/dist/project/alias-roots.js +17 -0
  49. package/dist/project/alias-roots.js.map +1 -0
  50. package/dist/project/config-file.d.ts +2 -0
  51. package/dist/project/config-file.d.ts.map +1 -0
  52. package/dist/project/config-file.js +2 -0
  53. package/dist/project/config-file.js.map +1 -0
  54. package/dist/project/config.d.ts +53 -0
  55. package/dist/project/config.d.ts.map +1 -0
  56. package/dist/project/config.js +2 -0
  57. package/dist/project/config.js.map +1 -0
  58. package/dist/project/configured-severity.d.ts +3 -0
  59. package/dist/project/configured-severity.d.ts.map +1 -0
  60. package/dist/project/configured-severity.js +5 -0
  61. package/dist/project/configured-severity.js.map +1 -0
  62. package/dist/project/describe-linted-file.d.ts +4 -0
  63. package/dist/project/describe-linted-file.d.ts.map +1 -0
  64. package/dist/project/describe-linted-file.js +38 -0
  65. package/dist/project/describe-linted-file.js.map +1 -0
  66. package/dist/project/find-project.d.ts +4 -0
  67. package/dist/project/find-project.d.ts.map +1 -0
  68. package/dist/project/find-project.js +37 -0
  69. package/dist/project/find-project.js.map +1 -0
  70. package/dist/project/is-record.d.ts +2 -0
  71. package/dist/project/is-record.d.ts.map +1 -0
  72. package/dist/project/is-record.js +4 -0
  73. package/dist/project/is-record.js.map +1 -0
  74. package/dist/project/is-test-file.d.ts +3 -0
  75. package/dist/project/is-test-file.d.ts.map +1 -0
  76. package/dist/project/is-test-file.js +4 -0
  77. package/dist/project/is-test-file.js.map +1 -0
  78. package/dist/project/layer.d.ts +2 -0
  79. package/dist/project/layer.d.ts.map +1 -0
  80. package/dist/project/layer.js +2 -0
  81. package/dist/project/layer.js.map +1 -0
  82. package/dist/project/lint-host.d.ts +6 -0
  83. package/dist/project/lint-host.d.ts.map +1 -0
  84. package/dist/project/lint-host.js +2 -0
  85. package/dist/project/lint-host.js.map +1 -0
  86. package/dist/project/linted-file.d.ts +13 -0
  87. package/dist/project/linted-file.d.ts.map +1 -0
  88. package/dist/project/linted-file.js +2 -0
  89. package/dist/project/linted-file.js.map +1 -0
  90. package/dist/project/locate.d.ts +5 -0
  91. package/dist/project/locate.d.ts.map +1 -0
  92. package/dist/project/locate.js +47 -0
  93. package/dist/project/locate.js.map +1 -0
  94. package/dist/project/location.d.ts +11 -0
  95. package/dist/project/location.d.ts.map +1 -0
  96. package/dist/project/location.js +2 -0
  97. package/dist/project/location.js.map +1 -0
  98. package/dist/project/parse-allowed-file.d.ts +4 -0
  99. package/dist/project/parse-allowed-file.d.ts.map +1 -0
  100. package/dist/project/parse-allowed-file.js +11 -0
  101. package/dist/project/parse-allowed-file.js.map +1 -0
  102. package/dist/project/parse-config.d.ts +10 -0
  103. package/dist/project/parse-config.d.ts.map +1 -0
  104. package/dist/project/parse-config.js +113 -0
  105. package/dist/project/parse-config.js.map +1 -0
  106. package/dist/project/plugin-settings.d.ts +8 -0
  107. package/dist/project/plugin-settings.d.ts.map +1 -0
  108. package/dist/project/plugin-settings.js +2 -0
  109. package/dist/project/plugin-settings.js.map +1 -0
  110. package/dist/project/posix.d.ts +2 -0
  111. package/dist/project/posix.d.ts.map +1 -0
  112. package/dist/project/posix.js +4 -0
  113. package/dist/project/posix.js.map +1 -0
  114. package/dist/project/resolve-import.d.ts +15 -0
  115. package/dist/project/resolve-import.d.ts.map +1 -0
  116. package/dist/project/resolve-import.js +32 -0
  117. package/dist/project/resolve-import.js.map +1 -0
  118. package/dist/project/to-alias.d.ts +7 -0
  119. package/dist/project/to-alias.d.ts.map +1 -0
  120. package/dist/project/to-alias.js +13 -0
  121. package/dist/project/to-alias.js.map +1 -0
  122. package/dist/project/to-posix.d.ts +2 -0
  123. package/dist/project/to-posix.d.ts.map +1 -0
  124. package/dist/project/to-posix.js +5 -0
  125. package/dist/project/to-posix.js.map +1 -0
  126. package/dist/rules/application-command-query-separation.d.ts +6 -0
  127. package/dist/rules/application-command-query-separation.d.ts.map +1 -0
  128. package/dist/rules/application-command-query-separation.js +49 -0
  129. package/dist/rules/application-command-query-separation.js.map +1 -0
  130. package/dist/rules/application-handler-shape.d.ts +4 -0
  131. package/dist/rules/application-handler-shape.d.ts.map +1 -0
  132. package/dist/rules/application-handler-shape.js +51 -0
  133. package/dist/rules/application-handler-shape.js.map +1 -0
  134. package/dist/rules/aspects-outside-in.d.ts +2 -0
  135. package/dist/rules/aspects-outside-in.d.ts.map +1 -0
  136. package/dist/rules/aspects-outside-in.js +45 -0
  137. package/dist/rules/aspects-outside-in.js.map +1 -0
  138. package/dist/rules/authz-actor-explicit.d.ts +5 -0
  139. package/dist/rules/authz-actor-explicit.d.ts.map +1 -0
  140. package/dist/rules/authz-actor-explicit.js +106 -0
  141. package/dist/rules/authz-actor-explicit.js.map +1 -0
  142. package/dist/rules/authz-declared.d.ts +5 -0
  143. package/dist/rules/authz-declared.d.ts.map +1 -0
  144. package/dist/rules/authz-declared.js +167 -0
  145. package/dist/rules/authz-declared.js.map +1 -0
  146. package/dist/rules/authz-in-application.d.ts +5 -0
  147. package/dist/rules/authz-in-application.d.ts.map +1 -0
  148. package/dist/rules/authz-in-application.js +202 -0
  149. package/dist/rules/authz-in-application.js.map +1 -0
  150. package/dist/rules/clean-file-size.d.ts +2 -0
  151. package/dist/rules/clean-file-size.d.ts.map +1 -0
  152. package/dist/rules/clean-file-size.js +25 -0
  153. package/dist/rules/clean-file-size.js.map +1 -0
  154. package/dist/rules/clean-function-ceiling.d.ts +6 -0
  155. package/dist/rules/clean-function-ceiling.d.ts.map +1 -0
  156. package/dist/rules/clean-function-ceiling.js +32 -0
  157. package/dist/rules/clean-function-ceiling.js.map +1 -0
  158. package/dist/rules/clean-function-size.d.ts +7 -0
  159. package/dist/rules/clean-function-size.d.ts.map +1 -0
  160. package/dist/rules/clean-function-size.js +70 -0
  161. package/dist/rules/clean-function-size.js.map +1 -0
  162. package/dist/rules/clean-no-commented-out-code.d.ts +3 -0
  163. package/dist/rules/clean-no-commented-out-code.d.ts.map +1 -0
  164. package/dist/rules/clean-no-commented-out-code.js +60 -0
  165. package/dist/rules/clean-no-commented-out-code.js.map +1 -0
  166. package/dist/rules/clean-no-escape-hatch.d.ts +15 -0
  167. package/dist/rules/clean-no-escape-hatch.d.ts.map +1 -0
  168. package/dist/rules/clean-no-escape-hatch.js +116 -0
  169. package/dist/rules/clean-no-escape-hatch.js.map +1 -0
  170. package/dist/rules/clean-no-flag-argument.d.ts +2 -0
  171. package/dist/rules/clean-no-flag-argument.d.ts.map +1 -0
  172. package/dist/rules/clean-no-flag-argument.js +80 -0
  173. package/dist/rules/clean-no-flag-argument.js.map +1 -0
  174. package/dist/rules/clean-no-hash-private.d.ts +2 -0
  175. package/dist/rules/clean-no-hash-private.d.ts.map +1 -0
  176. package/dist/rules/clean-no-hash-private.js +36 -0
  177. package/dist/rules/clean-no-hash-private.js.map +1 -0
  178. package/dist/rules/clean-no-noise-comment.d.ts +5 -0
  179. package/dist/rules/clean-no-noise-comment.d.ts.map +1 -0
  180. package/dist/rules/clean-no-noise-comment.js +187 -0
  181. package/dist/rules/clean-no-noise-comment.js.map +1 -0
  182. package/dist/rules/clean-one-export-per-file.d.ts +10 -0
  183. package/dist/rules/clean-one-export-per-file.d.ts.map +1 -0
  184. package/dist/rules/clean-one-export-per-file.js +124 -0
  185. package/dist/rules/clean-one-export-per-file.js.map +1 -0
  186. package/dist/rules/clean-stepdown.d.ts +3 -0
  187. package/dist/rules/clean-stepdown.d.ts.map +1 -0
  188. package/dist/rules/clean-stepdown.js +33 -0
  189. package/dist/rules/clean-stepdown.js.map +1 -0
  190. package/dist/rules/context-boundaries.d.ts +4 -0
  191. package/dist/rules/context-boundaries.d.ts.map +1 -0
  192. package/dist/rules/context-boundaries.js +87 -0
  193. package/dist/rules/context-boundaries.js.map +1 -0
  194. package/dist/rules/context-extractable.d.ts +5 -0
  195. package/dist/rules/context-extractable.d.ts.map +1 -0
  196. package/dist/rules/context-extractable.js +242 -0
  197. package/dist/rules/context-extractable.js.map +1 -0
  198. package/dist/rules/declarations-role-declared.d.ts +5 -0
  199. package/dist/rules/declarations-role-declared.d.ts.map +1 -0
  200. package/dist/rules/declarations-role-declared.js +142 -0
  201. package/dist/rules/declarations-role-declared.js.map +1 -0
  202. package/dist/rules/domain-aggregate-encapsulation.d.ts +4 -0
  203. package/dist/rules/domain-aggregate-encapsulation.d.ts.map +1 -0
  204. package/dist/rules/domain-aggregate-encapsulation.js +93 -0
  205. package/dist/rules/domain-aggregate-encapsulation.js.map +1 -0
  206. package/dist/rules/domain-events-dispatched-on-save.d.ts +3 -0
  207. package/dist/rules/domain-events-dispatched-on-save.d.ts.map +1 -0
  208. package/dist/rules/domain-events-dispatched-on-save.js +87 -0
  209. package/dist/rules/domain-events-dispatched-on-save.js.map +1 -0
  210. package/dist/rules/domain-events-transactional-before-commit.d.ts +4 -0
  211. package/dist/rules/domain-events-transactional-before-commit.d.ts.map +1 -0
  212. package/dist/rules/domain-events-transactional-before-commit.js +121 -0
  213. package/dist/rules/domain-events-transactional-before-commit.js.map +1 -0
  214. package/dist/rules/domain-no-generic-error.d.ts +2 -0
  215. package/dist/rules/domain-no-generic-error.d.ts.map +1 -0
  216. package/dist/rules/domain-no-generic-error.js +32 -0
  217. package/dist/rules/domain-no-generic-error.js.map +1 -0
  218. package/dist/rules/domain-value-object-immutability.d.ts +4 -0
  219. package/dist/rules/domain-value-object-immutability.d.ts.map +1 -0
  220. package/dist/rules/domain-value-object-immutability.js +77 -0
  221. package/dist/rules/domain-value-object-immutability.js.map +1 -0
  222. package/dist/rules/events-consumer-idempotent.d.ts +5 -0
  223. package/dist/rules/events-consumer-idempotent.d.ts.map +1 -0
  224. package/dist/rules/events-consumer-idempotent.js +115 -0
  225. package/dist/rules/events-consumer-idempotent.js.map +1 -0
  226. package/dist/rules/events-name-format.d.ts +2 -0
  227. package/dist/rules/events-name-format.d.ts.map +1 -0
  228. package/dist/rules/events-name-format.js +53 -0
  229. package/dist/rules/events-name-format.js.map +1 -0
  230. package/dist/rules/events-outbox-required.d.ts +7 -0
  231. package/dist/rules/events-outbox-required.d.ts.map +1 -0
  232. package/dist/rules/events-outbox-required.js +82 -0
  233. package/dist/rules/events-outbox-required.js.map +1 -0
  234. package/dist/rules/governance-recorded-deviation.d.ts +2 -0
  235. package/dist/rules/governance-recorded-deviation.d.ts.map +1 -0
  236. package/dist/rules/governance-recorded-deviation.js +73 -0
  237. package/dist/rules/governance-recorded-deviation.js.map +1 -0
  238. package/dist/rules/imports-alias-only.d.ts +5 -0
  239. package/dist/rules/imports-alias-only.d.ts.map +1 -0
  240. package/dist/rules/imports-alias-only.js +63 -0
  241. package/dist/rules/imports-alias-only.js.map +1 -0
  242. package/dist/rules/layer-application-inward.d.ts +2 -0
  243. package/dist/rules/layer-application-inward.d.ts.map +1 -0
  244. package/dist/rules/layer-application-inward.js +66 -0
  245. package/dist/rules/layer-application-inward.js.map +1 -0
  246. package/dist/rules/layer-domain-purity.d.ts +4 -0
  247. package/dist/rules/layer-domain-purity.d.ts.map +1 -0
  248. package/dist/rules/layer-domain-purity.js +75 -0
  249. package/dist/rules/layer-domain-purity.js.map +1 -0
  250. package/dist/rules/layer-sideways.d.ts +3 -0
  251. package/dist/rules/layer-sideways.d.ts.map +1 -0
  252. package/dist/rules/layer-sideways.js +42 -0
  253. package/dist/rules/layer-sideways.js.map +1 -0
  254. package/dist/rules/ports-abstract-class.d.ts +2 -0
  255. package/dist/rules/ports-abstract-class.d.ts.map +1 -0
  256. package/dist/rules/ports-abstract-class.js +74 -0
  257. package/dist/rules/ports-abstract-class.js.map +1 -0
  258. package/dist/rules/ports-implements-never-extends.d.ts +5 -0
  259. package/dist/rules/ports-implements-never-extends.d.ts.map +1 -0
  260. package/dist/rules/ports-implements-never-extends.js +81 -0
  261. package/dist/rules/ports-implements-never-extends.js.map +1 -0
  262. package/dist/rules/ports-no-concrete-dependency.d.ts +2 -0
  263. package/dist/rules/ports-no-concrete-dependency.d.ts.map +1 -0
  264. package/dist/rules/ports-no-concrete-dependency.js +32 -0
  265. package/dist/rules/ports-no-concrete-dependency.js.map +1 -0
  266. package/dist/rules/ports-no-token-constant.d.ts +5 -0
  267. package/dist/rules/ports-no-token-constant.d.ts.map +1 -0
  268. package/dist/rules/ports-no-token-constant.js +109 -0
  269. package/dist/rules/ports-no-token-constant.js.map +1 -0
  270. package/dist/rules/ports-value-import.d.ts +3 -0
  271. package/dist/rules/ports-value-import.d.ts.map +1 -0
  272. package/dist/rules/ports-value-import.js +60 -0
  273. package/dist/rules/ports-value-import.js.map +1 -0
  274. package/dist/rules/purity.d.ts +4 -0
  275. package/dist/rules/purity.d.ts.map +1 -0
  276. package/dist/rules/purity.js +65 -0
  277. package/dist/rules/purity.js.map +1 -0
  278. package/dist/rules/rules.d.ts +4 -0
  279. package/dist/rules/rules.d.ts.map +1 -0
  280. package/dist/rules/rules.js +97 -0
  281. package/dist/rules/rules.js.map +1 -0
  282. package/dist/rules/scheduling-job-name.d.ts +5 -0
  283. package/dist/rules/scheduling-job-name.d.ts.map +1 -0
  284. package/dist/rules/scheduling-job-name.js +98 -0
  285. package/dist/rules/scheduling-job-name.js.map +1 -0
  286. package/dist/rules/scheduling-job-triggers-use-case.d.ts +5 -0
  287. package/dist/rules/scheduling-job-triggers-use-case.d.ts.map +1 -0
  288. package/dist/rules/scheduling-job-triggers-use-case.js +129 -0
  289. package/dist/rules/scheduling-job-triggers-use-case.js.map +1 -0
  290. package/dist/rules/standard-no-parallel-interface.d.ts +2 -0
  291. package/dist/rules/standard-no-parallel-interface.d.ts.map +1 -0
  292. package/dist/rules/standard-no-parallel-interface.js +57 -0
  293. package/dist/rules/standard-no-parallel-interface.js.map +1 -0
  294. package/dist/rules/test-no-mocks.d.ts +2 -0
  295. package/dist/rules/test-no-mocks.d.ts.map +1 -0
  296. package/dist/rules/test-no-mocks.js +50 -0
  297. package/dist/rules/test-no-mocks.js.map +1 -0
  298. package/dist/rules/tracing-platform-only.d.ts +2 -0
  299. package/dist/rules/tracing-platform-only.d.ts.map +1 -0
  300. package/dist/rules/tracing-platform-only.js +52 -0
  301. package/dist/rules/tracing-platform-only.js.map +1 -0
  302. package/dist/support/ancestors.d.ts +4 -0
  303. package/dist/support/ancestors.d.ts.map +1 -0
  304. package/dist/support/ancestors.js +7 -0
  305. package/dist/support/ancestors.js.map +1 -0
  306. package/dist/support/calls/accessed-name.d.ts +4 -0
  307. package/dist/support/calls/accessed-name.d.ts.map +1 -0
  308. package/dist/support/calls/accessed-name.js +14 -0
  309. package/dist/support/calls/accessed-name.js.map +1 -0
  310. package/dist/support/calls/callee-name.d.ts +4 -0
  311. package/dist/support/calls/callee-name.d.ts.map +1 -0
  312. package/dist/support/calls/callee-name.js +11 -0
  313. package/dist/support/calls/callee-name.js.map +1 -0
  314. package/dist/support/calls/has-spread.d.ts +4 -0
  315. package/dist/support/calls/has-spread.d.ts.map +1 -0
  316. package/dist/support/calls/has-spread.js +6 -0
  317. package/dist/support/calls/has-spread.js.map +1 -0
  318. package/dist/support/calls/method-chain.d.ts +8 -0
  319. package/dist/support/calls/method-chain.d.ts.map +1 -0
  320. package/dist/support/calls/method-chain.js +13 -0
  321. package/dist/support/calls/method-chain.js.map +1 -0
  322. package/dist/support/calls/missing-keys.d.ts +7 -0
  323. package/dist/support/calls/missing-keys.d.ts.map +1 -0
  324. package/dist/support/calls/missing-keys.js +28 -0
  325. package/dist/support/calls/missing-keys.js.map +1 -0
  326. package/dist/support/calls/property-of.d.ts +3 -0
  327. package/dist/support/calls/property-of.d.ts.map +1 -0
  328. package/dist/support/calls/property-of.js +8 -0
  329. package/dist/support/calls/property-of.js.map +1 -0
  330. package/dist/support/classes/class-finder.d.ts +18 -0
  331. package/dist/support/classes/class-finder.d.ts.map +1 -0
  332. package/dist/support/classes/class-finder.js +76 -0
  333. package/dist/support/classes/class-finder.js.map +1 -0
  334. package/dist/support/classes/class-name.d.ts +4 -0
  335. package/dist/support/classes/class-name.d.ts.map +1 -0
  336. package/dist/support/classes/class-name.js +4 -0
  337. package/dist/support/classes/class-name.js.map +1 -0
  338. package/dist/support/classes/constructor-of.d.ts +3 -0
  339. package/dist/support/classes/constructor-of.d.ts.map +1 -0
  340. package/dist/support/classes/constructor-of.js +5 -0
  341. package/dist/support/classes/constructor-of.js.map +1 -0
  342. package/dist/support/classes/enclosing-member.d.ts +8 -0
  343. package/dist/support/classes/enclosing-member.d.ts.map +1 -0
  344. package/dist/support/classes/enclosing-member.js +15 -0
  345. package/dist/support/classes/enclosing-member.js.map +1 -0
  346. package/dist/support/classes/exported-classes.d.ts +4 -0
  347. package/dist/support/classes/exported-classes.d.ts.map +1 -0
  348. package/dist/support/classes/exported-classes.js +22 -0
  349. package/dist/support/classes/exported-classes.js.map +1 -0
  350. package/dist/support/classes/is-callable.d.ts +4 -0
  351. package/dist/support/classes/is-callable.d.ts.map +1 -0
  352. package/dist/support/classes/is-callable.js +10 -0
  353. package/dist/support/classes/is-callable.js.map +1 -0
  354. package/dist/support/classes/is-constructor.d.ts +3 -0
  355. package/dist/support/classes/is-constructor.d.ts.map +1 -0
  356. package/dist/support/classes/is-constructor.js +5 -0
  357. package/dist/support/classes/is-constructor.js.map +1 -0
  358. package/dist/support/classes/is-function.d.ts +3 -0
  359. package/dist/support/classes/is-function.d.ts.map +1 -0
  360. package/dist/support/classes/is-function.js +5 -0
  361. package/dist/support/classes/is-function.js.map +1 -0
  362. package/dist/support/classes/is-inline-export.d.ts +3 -0
  363. package/dist/support/classes/is-inline-export.d.ts.map +1 -0
  364. package/dist/support/classes/is-inline-export.js +6 -0
  365. package/dist/support/classes/is-inline-export.js.map +1 -0
  366. package/dist/support/classes/is-keyed.d.ts +5 -0
  367. package/dist/support/classes/is-keyed.d.ts.map +1 -0
  368. package/dist/support/classes/is-keyed.js +5 -0
  369. package/dist/support/classes/is-keyed.js.map +1 -0
  370. package/dist/support/classes/key-name.d.ts +3 -0
  371. package/dist/support/classes/key-name.d.ts.map +1 -0
  372. package/dist/support/classes/key-name.js +11 -0
  373. package/dist/support/classes/key-name.js.map +1 -0
  374. package/dist/support/classes/member-name.d.ts +4 -0
  375. package/dist/support/classes/member-name.d.ts.map +1 -0
  376. package/dist/support/classes/member-name.js +7 -0
  377. package/dist/support/classes/member-name.js.map +1 -0
  378. package/dist/support/classes/top-level-classes.d.ts +4 -0
  379. package/dist/support/classes/top-level-classes.d.ts.map +1 -0
  380. package/dist/support/classes/top-level-classes.js +10 -0
  381. package/dist/support/classes/top-level-classes.js.map +1 -0
  382. package/dist/support/classes/visibility-of.d.ts +4 -0
  383. package/dist/support/classes/visibility-of.d.ts.map +1 -0
  384. package/dist/support/classes/visibility-of.js +12 -0
  385. package/dist/support/classes/visibility-of.js.map +1 -0
  386. package/dist/support/comments/comment-lines.d.ts +15 -0
  387. package/dist/support/comments/comment-lines.d.ts.map +1 -0
  388. package/dist/support/comments/comment-lines.js +47 -0
  389. package/dist/support/comments/comment-lines.js.map +1 -0
  390. package/dist/support/comments/is-commented-out-code.d.ts +6 -0
  391. package/dist/support/comments/is-commented-out-code.d.ts.map +1 -0
  392. package/dist/support/comments/is-commented-out-code.js +108 -0
  393. package/dist/support/comments/is-commented-out-code.js.map +1 -0
  394. package/dist/support/comments/is-directive.d.ts +3 -0
  395. package/dist/support/comments/is-directive.d.ts.map +1 -0
  396. package/dist/support/comments/is-directive.js +6 -0
  397. package/dist/support/comments/is-directive.js.map +1 -0
  398. package/dist/support/comments/is-fragment.d.ts +3 -0
  399. package/dist/support/comments/is-fragment.d.ts.map +1 -0
  400. package/dist/support/comments/is-fragment.js +18 -0
  401. package/dist/support/comments/is-fragment.js.map +1 -0
  402. package/dist/support/comments/is-jsdoc.d.ts +3 -0
  403. package/dist/support/comments/is-jsdoc.d.ts.map +1 -0
  404. package/dist/support/comments/is-jsdoc.js +5 -0
  405. package/dist/support/comments/is-jsdoc.js.map +1 -0
  406. package/dist/support/comments/prose-opening.d.ts +3 -0
  407. package/dist/support/comments/prose-opening.d.ts.map +1 -0
  408. package/dist/support/comments/prose-opening.js +3 -0
  409. package/dist/support/comments/prose-opening.js.map +1 -0
  410. package/dist/support/comments/reads-as-prose.d.ts +3 -0
  411. package/dist/support/comments/reads-as-prose.d.ts.map +1 -0
  412. package/dist/support/comments/reads-as-prose.js +7 -0
  413. package/dist/support/comments/reads-as-prose.js.map +1 -0
  414. package/dist/support/declarations/access-decorators.d.ts +3 -0
  415. package/dist/support/declarations/access-decorators.d.ts.map +1 -0
  416. package/dist/support/declarations/access-decorators.js +3 -0
  417. package/dist/support/declarations/access-decorators.js.map +1 -0
  418. package/dist/support/declarations/declaration-reader.d.ts +19 -0
  419. package/dist/support/declarations/declaration-reader.d.ts.map +1 -0
  420. package/dist/support/declarations/declaration-reader.js +46 -0
  421. package/dist/support/declarations/declaration-reader.js.map +1 -0
  422. package/dist/support/declarations/declared-role-of.d.ts +5 -0
  423. package/dist/support/declarations/declared-role-of.d.ts.map +1 -0
  424. package/dist/support/declarations/declared-role-of.js +12 -0
  425. package/dist/support/declarations/declared-role-of.js.map +1 -0
  426. package/dist/support/declarations/declared-role.d.ts +9 -0
  427. package/dist/support/declarations/declared-role.d.ts.map +1 -0
  428. package/dist/support/declarations/declared-role.js +2 -0
  429. package/dist/support/declarations/declared-role.js.map +1 -0
  430. package/dist/support/declarations/declared-roles.d.ts +4 -0
  431. package/dist/support/declarations/declared-roles.d.ts.map +1 -0
  432. package/dist/support/declarations/declared-roles.js +20 -0
  433. package/dist/support/declarations/declared-roles.js.map +1 -0
  434. package/dist/support/declarations/is-declared-style.d.ts +3 -0
  435. package/dist/support/declarations/is-declared-style.d.ts.map +1 -0
  436. package/dist/support/declarations/is-declared-style.js +4 -0
  437. package/dist/support/declarations/is-declared-style.js.map +1 -0
  438. package/dist/support/declarations/written-name.d.ts +11 -0
  439. package/dist/support/declarations/written-name.d.ts.map +1 -0
  440. package/dist/support/declarations/written-name.js +22 -0
  441. package/dist/support/declarations/written-name.js.map +1 -0
  442. package/dist/support/declarations/written-names.d.ts +3 -0
  443. package/dist/support/declarations/written-names.d.ts.map +1 -0
  444. package/dist/support/declarations/written-names.js +7 -0
  445. package/dist/support/declarations/written-names.js.map +1 -0
  446. package/dist/support/descendants.d.ts +4 -0
  447. package/dist/support/descendants.d.ts.map +1 -0
  448. package/dist/support/descendants.js +21 -0
  449. package/dist/support/descendants.js.map +1 -0
  450. package/dist/support/exports/derived-forms-of.d.ts +8 -0
  451. package/dist/support/exports/derived-forms-of.d.ts.map +1 -0
  452. package/dist/support/exports/derived-forms-of.js +23 -0
  453. package/dist/support/exports/derived-forms-of.js.map +1 -0
  454. package/dist/support/exports/explain-exports.d.ts +11 -0
  455. package/dist/support/exports/explain-exports.d.ts.map +1 -0
  456. package/dist/support/exports/explain-exports.js +60 -0
  457. package/dist/support/exports/explain-exports.js.map +1 -0
  458. package/dist/support/exports/export-explanation.d.ts +9 -0
  459. package/dist/support/exports/export-explanation.d.ts.map +1 -0
  460. package/dist/support/exports/export-explanation.js +2 -0
  461. package/dist/support/exports/export-explanation.js.map +1 -0
  462. package/dist/support/exports/is-named-after.d.ts +8 -0
  463. package/dist/support/exports/is-named-after.d.ts.map +1 -0
  464. package/dist/support/exports/is-named-after.js +16 -0
  465. package/dist/support/exports/is-named-after.js.map +1 -0
  466. package/dist/support/exports/module-shape-of.d.ts +4 -0
  467. package/dist/support/exports/module-shape-of.d.ts.map +1 -0
  468. package/dist/support/exports/module-shape-of.js +11 -0
  469. package/dist/support/exports/module-shape-of.js.map +1 -0
  470. package/dist/support/exports/module-shape.d.ts +10 -0
  471. package/dist/support/exports/module-shape.d.ts.map +1 -0
  472. package/dist/support/exports/module-shape.js +2 -0
  473. package/dist/support/exports/module-shape.js.map +1 -0
  474. package/dist/support/exports/shares-private-state.d.ts +11 -0
  475. package/dist/support/exports/shares-private-state.d.ts.map +1 -0
  476. package/dist/support/exports/shares-private-state.js +36 -0
  477. package/dist/support/exports/shares-private-state.js.map +1 -0
  478. package/dist/support/exports/signature-of.d.ts +8 -0
  479. package/dist/support/exports/signature-of.d.ts.map +1 -0
  480. package/dist/support/exports/signature-of.js +44 -0
  481. package/dist/support/exports/signature-of.js.map +1 -0
  482. package/dist/support/exports/top-level-declaration.d.ts +10 -0
  483. package/dist/support/exports/top-level-declaration.d.ts.map +1 -0
  484. package/dist/support/exports/top-level-declaration.js +2 -0
  485. package/dist/support/exports/top-level-declaration.js.map +1 -0
  486. package/dist/support/exports/top-level-declarations.d.ts +5 -0
  487. package/dist/support/exports/top-level-declarations.d.ts.map +1 -0
  488. package/dist/support/exports/top-level-declarations.js +48 -0
  489. package/dist/support/exports/top-level-declarations.js.map +1 -0
  490. package/dist/support/exports/type-closure.d.ts +5 -0
  491. package/dist/support/exports/type-closure.d.ts.map +1 -0
  492. package/dist/support/exports/type-closure.js +18 -0
  493. package/dist/support/exports/type-closure.js.map +1 -0
  494. package/dist/support/exports/type-family-of.d.ts +8 -0
  495. package/dist/support/exports/type-family-of.d.ts.map +1 -0
  496. package/dist/support/exports/type-family-of.js +43 -0
  497. package/dist/support/exports/type-family-of.js.map +1 -0
  498. package/dist/support/exports/type-names-in.d.ts +4 -0
  499. package/dist/support/exports/type-names-in.d.ts.map +1 -0
  500. package/dist/support/exports/type-names-in.js +21 -0
  501. package/dist/support/exports/type-names-in.js.map +1 -0
  502. package/dist/support/functions/code-lines.d.ts +5 -0
  503. package/dist/support/functions/code-lines.d.ts.map +1 -0
  504. package/dist/support/functions/code-lines.js +14 -0
  505. package/dist/support/functions/code-lines.js.map +1 -0
  506. package/dist/support/functions/described-function.d.ts +11 -0
  507. package/dist/support/functions/described-function.d.ts.map +1 -0
  508. package/dist/support/functions/described-function.js +9 -0
  509. package/dist/support/functions/described-function.js.map +1 -0
  510. package/dist/support/functions/function-node.d.ts +3 -0
  511. package/dist/support/functions/function-node.d.ts.map +1 -0
  512. package/dist/support/functions/function-node.js +2 -0
  513. package/dist/support/functions/function-node.js.map +1 -0
  514. package/dist/support/glob-matcher.d.ts +3 -0
  515. package/dist/support/glob-matcher.d.ts.map +1 -0
  516. package/dist/support/glob-matcher.js +8 -0
  517. package/dist/support/glob-matcher.js.map +1 -0
  518. package/dist/support/globals/ambient-name.d.ts +8 -0
  519. package/dist/support/globals/ambient-name.d.ts.map +1 -0
  520. package/dist/support/globals/ambient-name.js +26 -0
  521. package/dist/support/globals/ambient-name.js.map +1 -0
  522. package/dist/support/globals/property-name.d.ts +3 -0
  523. package/dist/support/globals/property-name.d.ts.map +1 -0
  524. package/dist/support/globals/property-name.js +10 -0
  525. package/dist/support/globals/property-name.js.map +1 -0
  526. package/dist/support/hash-private-fix.d.ts +12 -0
  527. package/dist/support/hash-private-fix.d.ts.map +1 -0
  528. package/dist/support/hash-private-fix.js +52 -0
  529. package/dist/support/hash-private-fix.js.map +1 -0
  530. package/dist/support/imports/describe-target.d.ts +3 -0
  531. package/dist/support/imports/describe-target.d.ts.map +1 -0
  532. package/dist/support/imports/describe-target.js +11 -0
  533. package/dist/support/imports/describe-target.js.map +1 -0
  534. package/dist/support/imports/import-listener.d.ts +23 -0
  535. package/dist/support/imports/import-listener.d.ts.map +1 -0
  536. package/dist/support/imports/import-listener.js +43 -0
  537. package/dist/support/imports/import-listener.js.map +1 -0
  538. package/dist/support/imports/in-context.d.ts +4 -0
  539. package/dist/support/imports/in-context.d.ts.map +1 -0
  540. package/dist/support/imports/in-context.js +4 -0
  541. package/dist/support/imports/in-context.js.map +1 -0
  542. package/dist/support/imports/in-layer.d.ts +5 -0
  543. package/dist/support/imports/in-layer.d.ts.map +1 -0
  544. package/dist/support/imports/in-layer.js +4 -0
  545. package/dist/support/imports/in-layer.js.map +1 -0
  546. package/dist/support/imports/in-source-root.d.ts +4 -0
  547. package/dist/support/imports/in-source-root.d.ts.map +1 -0
  548. package/dist/support/imports/in-source-root.js +5 -0
  549. package/dist/support/imports/in-source-root.js.map +1 -0
  550. package/dist/support/imports/inner-layer.d.ts +4 -0
  551. package/dist/support/imports/inner-layer.d.ts.map +1 -0
  552. package/dist/support/imports/inner-layer.js +9 -0
  553. package/dist/support/imports/inner-layer.js.map +1 -0
  554. package/dist/support/imports/static-string.d.ts +3 -0
  555. package/dist/support/imports/static-string.d.ts.map +1 -0
  556. package/dist/support/imports/static-string.js +11 -0
  557. package/dist/support/imports/static-string.js.map +1 -0
  558. package/dist/support/kebab-case.d.ts +7 -0
  559. package/dist/support/kebab-case.d.ts.map +1 -0
  560. package/dist/support/kebab-case.js +13 -0
  561. package/dist/support/kebab-case.js.map +1 -0
  562. package/dist/support/members/parameter-name.d.ts +3 -0
  563. package/dist/support/members/parameter-name.d.ts.map +1 -0
  564. package/dist/support/members/parameter-name.js +7 -0
  565. package/dist/support/members/parameter-name.js.map +1 -0
  566. package/dist/support/members/parameter-properties.d.ts +4 -0
  567. package/dist/support/members/parameter-properties.d.ts.map +1 -0
  568. package/dist/support/members/parameter-properties.js +6 -0
  569. package/dist/support/members/parameter-properties.js.map +1 -0
  570. package/dist/support/members/starts-at-this.d.ts +4 -0
  571. package/dist/support/members/starts-at-this.d.ts.map +1 -0
  572. package/dist/support/members/starts-at-this.js +10 -0
  573. package/dist/support/members/starts-at-this.js.map +1 -0
  574. package/dist/support/outside-concerns/outside-concern-message.d.ts +3 -0
  575. package/dist/support/outside-concerns/outside-concern-message.d.ts.map +1 -0
  576. package/dist/support/outside-concerns/outside-concern-message.js +3 -0
  577. package/dist/support/outside-concerns/outside-concern-message.js.map +1 -0
  578. package/dist/support/outside-concerns/outside-concern.d.ts +13 -0
  579. package/dist/support/outside-concerns/outside-concern.d.ts.map +1 -0
  580. package/dist/support/outside-concerns/outside-concern.js +31 -0
  581. package/dist/support/outside-concerns/outside-concern.js.map +1 -0
  582. package/dist/support/ports/binding-call-reader.d.ts +10 -0
  583. package/dist/support/ports/binding-call-reader.d.ts.map +1 -0
  584. package/dist/support/ports/binding-call-reader.js +25 -0
  585. package/dist/support/ports/binding-call-reader.js.map +1 -0
  586. package/dist/support/ports/dependency-list-listener.d.ts +10 -0
  587. package/dist/support/ports/dependency-list-listener.d.ts.map +1 -0
  588. package/dist/support/ports/dependency-list-listener.js +37 -0
  589. package/dist/support/ports/dependency-list-listener.js.map +1 -0
  590. package/dist/support/ports/imported-binding.d.ts +11 -0
  591. package/dist/support/ports/imported-binding.d.ts.map +1 -0
  592. package/dist/support/ports/imported-binding.js +2 -0
  593. package/dist/support/ports/imported-binding.js.map +1 -0
  594. package/dist/support/ports/imported-bindings.d.ts +6 -0
  595. package/dist/support/ports/imported-bindings.d.ts.map +1 -0
  596. package/dist/support/ports/imported-bindings.js +19 -0
  597. package/dist/support/ports/imported-bindings.js.map +1 -0
  598. package/dist/support/ports/is-port-file.d.ts +4 -0
  599. package/dist/support/ports/is-port-file.d.ts.map +1 -0
  600. package/dist/support/ports/is-port-file.js +13 -0
  601. package/dist/support/ports/is-port-file.js.map +1 -0
  602. package/dist/support/purity-rule.d.ts +19 -0
  603. package/dist/support/purity-rule.d.ts.map +1 -0
  604. package/dist/support/purity-rule.js +74 -0
  605. package/dist/support/purity-rule.js.map +1 -0
  606. package/dist/support/rule/define-rule.d.ts +30 -0
  607. package/dist/support/rule/define-rule.d.ts.map +1 -0
  608. package/dist/support/rule/define-rule.js +51 -0
  609. package/dist/support/rule/define-rule.js.map +1 -0
  610. package/dist/support/rule/docs-of.d.ts +6 -0
  611. package/dist/support/rule/docs-of.d.ts.map +1 -0
  612. package/dist/support/rule/docs-of.js +9 -0
  613. package/dist/support/rule/docs-of.js.map +1 -0
  614. package/dist/support/rule/rule-docs.d.ts +9 -0
  615. package/dist/support/rule/rule-docs.d.ts.map +1 -0
  616. package/dist/support/rule/rule-docs.js +2 -0
  617. package/dist/support/rule/rule-docs.js.map +1 -0
  618. package/dist/support/scheduling/is-job-file.d.ts +4 -0
  619. package/dist/support/scheduling/is-job-file.d.ts.map +1 -0
  620. package/dist/support/scheduling/is-job-file.js +11 -0
  621. package/dist/support/scheduling/is-job-file.js.map +1 -0
  622. package/dist/support/scheduling/registered-job.d.ts +11 -0
  623. package/dist/support/scheduling/registered-job.d.ts.map +1 -0
  624. package/dist/support/scheduling/registered-job.js +17 -0
  625. package/dist/support/scheduling/registered-job.js.map +1 -0
  626. package/dist/support/standard-interfaces/boundary-names.d.ts +3 -0
  627. package/dist/support/standard-interfaces/boundary-names.d.ts.map +1 -0
  628. package/dist/support/standard-interfaces/boundary-names.js +3 -0
  629. package/dist/support/standard-interfaces/boundary-names.js.map +1 -0
  630. package/dist/support/standard-interfaces/parallel-names.d.ts +4 -0
  631. package/dist/support/standard-interfaces/parallel-names.d.ts.map +1 -0
  632. package/dist/support/standard-interfaces/parallel-names.js +76 -0
  633. package/dist/support/standard-interfaces/parallel-names.js.map +1 -0
  634. package/dist/support/standard-interfaces/standard-names-in.d.ts +3 -0
  635. package/dist/support/standard-interfaces/standard-names-in.d.ts.map +1 -0
  636. package/dist/support/standard-interfaces/standard-names-in.js +5 -0
  637. package/dist/support/standard-interfaces/standard-names-in.js.map +1 -0
  638. package/dist/support/stepdown/call-graph.d.ts +8 -0
  639. package/dist/support/stepdown/call-graph.d.ts.map +1 -0
  640. package/dist/support/stepdown/call-graph.js +27 -0
  641. package/dist/support/stepdown/call-graph.js.map +1 -0
  642. package/dist/support/stepdown/member-use.d.ts +7 -0
  643. package/dist/support/stepdown/member-use.d.ts.map +1 -0
  644. package/dist/support/stepdown/member-use.js +2 -0
  645. package/dist/support/stepdown/member-use.js.map +1 -0
  646. package/dist/support/stepdown/member-uses.d.ts +9 -0
  647. package/dist/support/stepdown/member-uses.d.ts.map +1 -0
  648. package/dist/support/stepdown/member-uses.js +27 -0
  649. package/dist/support/stepdown/member-uses.js.map +1 -0
  650. package/dist/support/stepdown/misplaced-functions.d.ts +11 -0
  651. package/dist/support/stepdown/misplaced-functions.d.ts.map +1 -0
  652. package/dist/support/stepdown/misplaced-functions.js +80 -0
  653. package/dist/support/stepdown/misplaced-functions.js.map +1 -0
  654. package/dist/support/stepdown/misplaced-members.d.ts +10 -0
  655. package/dist/support/stepdown/misplaced-members.d.ts.map +1 -0
  656. package/dist/support/stepdown/misplaced-members.js +73 -0
  657. package/dist/support/stepdown/misplaced-members.js.map +1 -0
  658. package/dist/support/suppressions/shares-line-with-code.d.ts +3 -0
  659. package/dist/support/suppressions/shares-line-with-code.d.ts.map +1 -0
  660. package/dist/support/suppressions/shares-line-with-code.js +5 -0
  661. package/dist/support/suppressions/shares-line-with-code.js.map +1 -0
  662. package/dist/support/suppressions/suppressed-lines.d.ts +4 -0
  663. package/dist/support/suppressions/suppressed-lines.d.ts.map +1 -0
  664. package/dist/support/suppressions/suppressed-lines.js +17 -0
  665. package/dist/support/suppressions/suppressed-lines.js.map +1 -0
  666. package/dist/support/types/declared-type-name.d.ts +6 -0
  667. package/dist/support/types/declared-type-name.d.ts.map +1 -0
  668. package/dist/support/types/declared-type-name.js +33 -0
  669. package/dist/support/types/declared-type-name.js.map +1 -0
  670. package/dist/support/types/parameter-binding.d.ts +4 -0
  671. package/dist/support/types/parameter-binding.d.ts.map +1 -0
  672. package/dist/support/types/parameter-binding.js +7 -0
  673. package/dist/support/types/parameter-binding.js.map +1 -0
  674. package/dist/support/types/parameter-type-name.d.ts +3 -0
  675. package/dist/support/types/parameter-type-name.d.ts.map +1 -0
  676. package/dist/support/types/parameter-type-name.js +6 -0
  677. package/dist/support/types/parameter-type-name.js.map +1 -0
  678. package/dist/support/types/type-reference-name.d.ts +4 -0
  679. package/dist/support/types/type-reference-name.d.ts.map +1 -0
  680. package/dist/support/types/type-reference-name.js +14 -0
  681. package/dist/support/types/type-reference-name.js.map +1 -0
  682. package/dist/support/words/same-word.d.ts +3 -0
  683. package/dist/support/words/same-word.d.ts.map +1 -0
  684. package/dist/support/words/same-word.js +75 -0
  685. package/dist/support/words/same-word.js.map +1 -0
  686. package/dist/support/words/split-words.d.ts +3 -0
  687. package/dist/support/words/split-words.d.ts.map +1 -0
  688. package/dist/support/words/split-words.js +12 -0
  689. package/dist/support/words/split-words.js.map +1 -0
  690. package/dist/version.d.ts +2 -0
  691. package/dist/version.d.ts.map +1 -0
  692. package/dist/version.js +2 -0
  693. package/dist/version.js.map +1 -0
  694. package/docs/rules/application-command-query-separation.md +54 -0
  695. package/docs/rules/application-handler-shape.md +52 -0
  696. package/docs/rules/aspects-outside-in.md +54 -0
  697. package/docs/rules/authz-actor-explicit.md +70 -0
  698. package/docs/rules/authz-declared.md +87 -0
  699. package/docs/rules/authz-in-application.md +88 -0
  700. package/docs/rules/clean-blank-lines.md +87 -0
  701. package/docs/rules/clean-braces.md +61 -0
  702. package/docs/rules/clean-file-size.md +43 -0
  703. package/docs/rules/clean-formatted.md +32 -0
  704. package/docs/rules/clean-function-ceiling.md +53 -0
  705. package/docs/rules/clean-function-size.md +45 -0
  706. package/docs/rules/clean-no-commented-out-code.md +48 -0
  707. package/docs/rules/clean-no-escape-hatch.md +80 -0
  708. package/docs/rules/clean-no-flag-argument.md +50 -0
  709. package/docs/rules/clean-no-hash-private.md +63 -0
  710. package/docs/rules/clean-no-noise-comment.md +55 -0
  711. package/docs/rules/clean-one-export-per-file.md +88 -0
  712. package/docs/rules/clean-stepdown.md +60 -0
  713. package/docs/rules/context-declared-relationship.md +49 -0
  714. package/docs/rules/context-extractable.md +109 -0
  715. package/docs/rules/context-published-language-is-a-contract.md +47 -0
  716. package/docs/rules/context-published-language-only.md +47 -0
  717. package/docs/rules/declarations-role-declared.md +109 -0
  718. package/docs/rules/domain-aggregate-encapsulation.md +63 -0
  719. package/docs/rules/domain-events-dispatched-on-save.md +83 -0
  720. package/docs/rules/domain-events-transactional-before-commit.md +92 -0
  721. package/docs/rules/domain-no-generic-error.md +40 -0
  722. package/docs/rules/domain-value-object-immutability.md +52 -0
  723. package/docs/rules/events-consumer-idempotent.md +68 -0
  724. package/docs/rules/events-name-format.md +50 -0
  725. package/docs/rules/events-outbox-required.md +57 -0
  726. package/docs/rules/governance-recorded-deviation.md +55 -0
  727. package/docs/rules/imports-alias-only.md +73 -0
  728. package/docs/rules/layer-application-inward.md +62 -0
  729. package/docs/rules/layer-domain-purity.md +60 -0
  730. package/docs/rules/layer-infrastructure-no-presentation.md +46 -0
  731. package/docs/rules/layer-presentation-no-infrastructure.md +46 -0
  732. package/docs/rules/ports-abstract-class.md +70 -0
  733. package/docs/rules/ports-implements-never-extends.md +53 -0
  734. package/docs/rules/ports-no-concrete-dependency.md +52 -0
  735. package/docs/rules/ports-no-token-constant.md +57 -0
  736. package/docs/rules/ports-value-import.md +55 -0
  737. package/docs/rules/purity-no-ambient-randomness.md +43 -0
  738. package/docs/rules/purity-no-environment.md +45 -0
  739. package/docs/rules/purity-no-system-clock.md +49 -0
  740. package/docs/rules/scheduling-job-name.md +57 -0
  741. package/docs/rules/scheduling-job-triggers-use-case.md +71 -0
  742. package/docs/rules/standard-no-parallel-interface.md +95 -0
  743. package/docs/rules/test-no-mocks.md +47 -0
  744. package/docs/rules/tracing-platform-only.md +65 -0
  745. package/package.json +56 -4
package/README.md CHANGED
@@ -1,3 +1,293 @@
1
- # Temporary Holding Version
1
+ # @ddd-ts-kit/eslint-plugin
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ AST-accurate ESLint rules for the architecture of [docs/ARCHITECTURE.md](../../docs/ARCHITECTURE.md):
4
+ layer and context boundaries, purity of the domain and the application, clean code ordering,
5
+ layout and file shape, tactical DDD shapes, ports as abstract classes, scheduled jobs, and the
6
+ declarations of a declared-style project. Flat config only, ESLint 9
7
+ and 10.
8
+
9
+ Every rule reads `ddd-ts-kit.config.json` ([docs/CONFIG.md](../../docs/CONFIG.md)), found by
10
+ walking up from the linted file, and classifies the file into context and layer exactly like
11
+ `ddd-ts-kit check` does. It also reads `stack.style` there: see [The two styles](#the-two-styles).
12
+
13
+ ## Install
14
+
15
+ ```
16
+ npm i -D @ddd-ts-kit/eslint-plugin eslint @eslint/js typescript-eslint
17
+ ```
18
+
19
+ `@stylistic/eslint-plugin` (5.x) comes with the plugin as a dependency: the presets use it for the
20
+ layout rules, and nothing has to be installed for it.
21
+
22
+ ## Use
23
+
24
+ ```js
25
+ import { dddTsKit } from '@ddd-ts-kit/eslint-plugin';
26
+
27
+ export default dddTsKit({ tsconfigRootDir: import.meta.dirname });
28
+ ```
29
+
30
+ `dddTsKit(options)` returns a complete flat config array:
31
+
32
+ | Layer of the config | Content |
33
+ |---|---|
34
+ | `@eslint/js` recommended | the baseline of ESLint |
35
+ | typescript-eslint `strictTypeChecked` and `stylisticTypeChecked` | with `projectService`; `strict` and `stylistic` when `typeChecked` is `false` |
36
+ | `ddd-ts-kit/clean-code` | the standard rules backing section 6 of the architecture reference (below) |
37
+ | `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
+ | `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
+ | `ddd-ts-kit/inner-layers` | `no-param-reassign` with `props` in `domain/` and `application/`: no output argument |
40
+ | `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 |
42
+
43
+ | Option | Default | Meaning |
44
+ |---|---|---|
45
+ | `tsconfigRootDir` | the working directory | directory of the tsconfig and of `ddd-ts-kit.config.json` |
46
+ | `typeChecked` | `true` | add the rules that read types; `false` is faster and needs no tsconfig |
47
+ | `allowDefaultProject` | `['*.config.ts', '*.config.mts']` | files outside the tsconfig still linted with types |
48
+ | `ignores` | none | added to `dist`, `coverage`, `node_modules`, `reports`, `*.d.ts` |
49
+
50
+ 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:
53
+
54
+ ```js
55
+ import dddTsKit from '@ddd-ts-kit/eslint-plugin';
56
+
57
+ export default [...dddTsKit.configs.recommended]; // or configs.strict: every rule at error
58
+ ```
59
+
60
+ The standard rule sets of the helper are exported as `standardRules` (`escapeHatch`, `cleanCode`,
61
+ `typedCleanCode`, `kitConventions`, `layout`, `braces`). `standardRules.braces` holds `curly` for
62
+ [`clean/braces`](docs/rules/clean-braces.md); `standardRules.layout` holds the two
63
+ `@stylistic/*` rules of [`clean/blank-lines`](docs/rules/clean-blank-lines.md) at `error`; a config
64
+ composed by hand registers the plugin under `@stylistic` next to them:
65
+
66
+ ```js
67
+ import stylistic from '@stylistic/eslint-plugin';
68
+ import dddTsKit, { standardRules } from '@ddd-ts-kit/eslint-plugin';
69
+
70
+ export default [{ files: ['**/*.ts'], plugins: { 'ddd-ts-kit': dddTsKit, '@stylistic': stylistic }, rules: standardRules.layout }];
71
+ ```
72
+
73
+ ## Rules
74
+
75
+ Ids are those of [docs/ARCHITECTURE.md](../../docs/ARCHITECTURE.md); the ESLint name replaces the
76
+ slash by a dash (one exception: `clean-function-ceiling`, the part of `clean/function-size` that
77
+ is an error whatever the configured limit). `strict` sets every rule to `error`.
78
+
79
+ | Id | ESLint name | Holds | Default | Implementation |
80
+ |---|---|---|---|---|
81
+ | [`layer/domain-purity`](docs/rules/layer-domain-purity.md) | `ddd-ts-kit/layer-domain-purity` | `domain/` imports only its own domain, the shared kernel and the allowed packages; never `@ddd-ts-kit/aspects`, `audit`, `redis`, `scheduling`, `sentry` or `tracing`, even allowed, nor `@ddd-ts-kit/kernel/declarations` in the declared style | `error` | custom |
82
+ | [`layer/application-inward`](docs/rules/layer-application-inward.md) | `ddd-ts-kit/layer-application-inward` | `application/` never imports `infrastructure/`, `presentation/`, a framework, a driver or a package applying a concern from outside (`@ddd-ts-kit/aspects`, `audit`, `redis`, `scheduling`, `sentry`, `tracing`); `@ddd-ts-kit/kernel/declarations` is always allowed in the declared style | `error` | custom |
83
+ | [`layer/presentation-no-infrastructure`](docs/rules/layer-presentation-no-infrastructure.md) | `ddd-ts-kit/layer-presentation-no-infrastructure` | `presentation/` never imports `infrastructure/` | `error` | custom |
84
+ | [`layer/infrastructure-no-presentation`](docs/rules/layer-infrastructure-no-presentation.md) | `ddd-ts-kit/layer-infrastructure-no-presentation` | `infrastructure/` never imports `presentation/` | `error` | custom |
85
+ | [`context/published-language-only`](docs/rules/context-published-language-only.md) | `ddd-ts-kit/context-published-language-only` | another context is imported only through its `published-language/` | `error` | custom |
86
+ | [`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
+ | [`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
+ | [`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 |
89
+ | [`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 |
90
+ | [`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 |
91
+ | [`clean/stepdown`](docs/rules/clean-stepdown.md) | `ddd-ts-kit/clean-stepdown` | static factories, public members, then private ones; a function above the functions it calls | `error` | custom |
92
+ | [`clean/function-size`](docs/rules/clean-function-size.md) | `ddd-ts-kit/clean-function-size` | at most 3 parameters (constructors exempt) and 30 lines of code (configurable, never above 100) | `warn` | custom |
93
+ | [`clean/function-size`](docs/rules/clean-function-ceiling.md) (ceiling) | `ddd-ts-kit/clean-function-ceiling` | no function longer than 100 lines of code, `describe` callbacks and module files included | `error` | custom |
94
+ | [`clean/no-flag-argument`](docs/rules/clean-no-flag-argument.md) | `ddd-ts-kit/clean-no-flag-argument` | no boolean parameter on a public method of the domain or on `execute` | `warn` | custom |
95
+ | [`clean/no-commented-out-code`](docs/rules/clean-no-commented-out-code.md) | `ddd-ts-kit/clean-no-commented-out-code` | no comment that parses as code | `error` | custom |
96
+ | [`clean/no-noise-comment`](docs/rules/clean-no-noise-comment.md) | `ddd-ts-kit/clean-no-noise-comment` | no banner, journal, closing-brace label, empty tag, ownerless TODO, comment repeating a name | `warn` | custom |
97
+ | [`clean/no-escape-hatch`](docs/rules/clean-no-escape-hatch.md) | `ddd-ts-kit/clean-no-escape-hatch` | no type assertion outside mappers, infrastructure and the declared `adapterGlobs`, no `eslint-disable` without reason | `error` | custom, plus 3 standard rules (below) |
98
+ | [`clean/no-hash-private`](docs/rules/clean-no-hash-private.md) | `ddd-ts-kit/clean-no-hash-private` | a class member is `private`, never `#name`; fixable | `error` | custom |
99
+ | [`clean/one-export-per-file`](docs/rules/clean-one-export-per-file.md) | `ddd-ts-kit/clean-one-export-per-file` | one exported class, interface or function per source file, with the types of its signature, the file named after it; entry files only re-export | `error` | custom |
100
+ | [`clean/file-size`](docs/rules/clean-file-size.md) | `ddd-ts-kit/clean-file-size` | no file over 350 lines, tests included | `error` | custom |
101
+ | [`clean/blank-lines`](docs/rules/clean-blank-lines.md) | two `@stylistic/*` rules (`standardRules.layout`) | a blank line before every `return` and between logical blocks, around a method; fixable | `error` | standard |
102
+ | [`clean/braces`](docs/rules/clean-braces.md) | `curly` (`standardRules.braces`) | every `if`, `else`, `for`, `while` and `do` has braces; fixable | `error` | standard |
103
+ | [`clean/formatted`](docs/rules/clean-formatted.md) | none: Biome (`npm run format:check`) | every file is laid out by the formatter, at a line width of 120 | none | formatter |
104
+ | [`domain/aggregate-encapsulation`](docs/rules/domain-aggregate-encapsulation.md) | `ddd-ts-kit/domain-aggregate-encapsulation` | aggregates and entities: no public constructor, no public mutable property, no setter | `error` | custom |
105
+ | [`domain/value-object-immutability`](docs/rules/domain-value-object-immutability.md) | `ddd-ts-kit/domain-value-object-immutability` | value objects: every property `readonly`, no setter, no write to `this` | `error` | custom |
106
+ | [`domain/no-generic-error`](docs/rules/domain-no-generic-error.md) | `ddd-ts-kit/domain-no-generic-error` | no `throw new Error(...)` in `domain/` and `application/` | `error` | custom |
107
+ | [`application/handler-shape`](docs/rules/application-handler-shape.md) | `ddd-ts-kit/application-handler-shape` | a `*.handler.ts` exports one class whose single public method is `execute` | `error` | custom |
108
+ | [`application/command-query-separation`](docs/rules/application-command-query-separation.md) | `ddd-ts-kit/application-command-query-separation` | nothing under `application/queries` calls `save`, `delete`, `publish` on a dependency | `warn` | custom |
109
+ | [`domain-events/dispatched-on-save`](docs/rules/domain-events-dispatched-on-save.md) | `ddd-ts-kit/domain-events-dispatched-on-save` | no `pullEvents()` in `application/` and `infrastructure/`; no `DomainEventDispatcher` imported, listed as a dependency or received by a constructor in `application/commands`, `application/queries` and a repository adapter | `error` | custom |
110
+ | [`domain-events/transactional-before-commit`](docs/rules/domain-events-transactional-before-commit.md) | `ddd-ts-kit/domain-events-transactional-before-commit` | a class carrying `@DomainEventHandler` without `phase: 'after-commit'` depends on no `Cache`, `Lock`, `RateLimiter`, `JobScheduler` or `EventBus` of the kernel and on nothing imported from `infrastructure/`, another context, the platform or a package other than `@ddd-ts-kit/kernel` and `@ddd-ts-kit/auth`; an after-commit handler does not depend on `IntegrationEventPublisher`. The adapters of an `application/ports/` port and the phase of an explicit-style handler are held by the CLI checker | `error` | custom |
111
+ | [`test/no-mocks`](docs/rules/test-no-mocks.md) | `ddd-ts-kit/test-no-mocks` | no `vi.mock`, `vi.fn`, `vi.spyOn`, their `jest` twins or a mocking library in a context's tests | `warn` | custom |
112
+ | [`events/name-format`](docs/rules/events-name-format.md) | `ddd-ts-kit/events-name-format` | event names follow `<context>.<aggregate>.<fact>` in kebab-case | `error` | custom |
113
+ | [`events/outbox-required`](docs/rules/events-outbox-required.md) | `ddd-ts-kit/events-outbox-required` | no broker client and no concrete bus in `domain/` and `application/`; a publisher depends on the `IntegrationEventPublisher` port | `error` | custom |
114
+ | [`events/consumer-idempotent`](docs/rules/events-consumer-idempotent.md) | `ddd-ts-kit/events-consumer-idempotent` | a consumer is declared with a `consumer` name and a processed-event store, never by a bare `subscribe`; in the declared style `@IntegrationEventHandler` writes its `consumer` as a string literal | `error` | custom |
115
+ | [`context/extractable`](docs/rules/context-extractable.md) | `ddd-ts-kit/context-extractable` | no schema or table of another context, no exported mutable state, nothing of another context wired in the module and, in the declared style, no port of another context imported by a role file | `error` | custom |
116
+ | [`authz/declared`](docs/rules/authz-declared.md) | `ddd-ts-kit/authz-declared` | a registered command or query says `.requires(...)` or `.public()`, or its class carries `@Requires` or `@Public` (required on every message of the declared style), a route declares `security`, an authorized message forwards its actor | `error` | custom |
117
+ | [`authz/in-application`](docs/rules/authz-in-application.md) | `ddd-ts-kit/authz-in-application` | no role test in `presentation/`, no authorization in `infrastructure/`, no actor, session, execution context or rights in `domain/`; in the declared style `Requires`, `Public`, `Policy` and the `Access` port stay in `application/` | `error` | custom |
118
+ | [`authz/actor-explicit`](docs/rules/authz-actor-explicit.md) | `ddd-ts-kit/authz-actor-explicit` | no `ExecutionScope`, `ActorContext` (type or value: the class is the token) or `AsyncLocalStorage`, no read of the ambient context, no `stampCreation`, `stampUpdate` or `tenantScopeOf` in `domain/` and `application/` | `error` | custom |
119
+ | [`aspects/outside-in`](docs/rules/aspects-outside-in.md) | `ddd-ts-kit/aspects-outside-in` | `@ddd-ts-kit/aspects/decorators` is imported only in `infrastructure/` and in the platform | `error` | custom |
120
+ | [`tracing/platform-only`](docs/rules/tracing-platform-only.md) | `ddd-ts-kit/tracing-platform-only` | `@ddd-ts-kit/tracing` and `@opentelemetry/*` are imported only by the platform directory, `main.ts` and `apps/` | `error` | custom |
121
+ | [`standard/no-parallel-interface`](docs/rules/standard-no-parallel-interface.md) | `ddd-ts-kit/standard-no-parallel-interface` | no declared `ILogger`, `UserContext`, `PaginatedResult`, `CronJob`, `ErrorTracker` and the like next to the standard interfaces of the kernel (`standardInterfaces` in the config) | `warn` | custom |
122
+ | [`governance/recorded-deviation`](docs/rules/governance-recorded-deviation.md) | `ddd-ts-kit/governance-recorded-deviation` | every suppression names its rules and points to `ADR-<number>` after `--` | `error` | custom |
123
+ | [`declarations/role-declared`](docs/rules/declarations-role-declared.md) | `ddd-ts-kit/declarations-role-declared` | declared style only: a role file exports a class carrying the decorator of its role, the `consumer` and `name` of a declaration are string literals, a domain event handler names its event as the event does, `domain/` carries no declaration decorator | `error` | custom |
124
+ | [`ports/abstract-class`](docs/rules/ports-abstract-class.md) | `ddd-ts-kit/ports-abstract-class` | a port (`domain/repositories/*.repository.ts`, `application/ports/*.port.ts`) is an abstract class with abstract members only, never an interface | `error` | custom |
125
+ | [`ports/implements-never-extends`](docs/rules/ports-implements-never-extends.md) | `ddd-ts-kit/ports-implements-never-extends` | an adapter (`@Repository`, `@Gateway`, `@Adapter`, `bind(Port).toClass(Class)`) implements its port and never extends it | `error` | custom |
126
+ | [`ports/no-token-constant`](docs/rules/ports-no-token-constant.md) | `ddd-ts-kit/ports-no-token-constant` | a dependency is named by its port class: no token helper, symbol, string or constant, no token file | `error` | custom |
127
+ | [`ports/no-concrete-dependency`](docs/rules/ports-no-concrete-dependency.md) | `ddd-ts-kit/ports-no-concrete-dependency` | a dependency list names nothing imported from `infrastructure/` or `test/fakes/` | `error` | custom |
128
+ | [`ports/value-import`](docs/rules/ports-value-import.md) | `ddd-ts-kit/ports-value-import` | a port named in a dependency list or given to `bind` is not a type-only import; fixable | `error` | custom |
129
+ | [`scheduling/job-triggers-use-case`](docs/rules/scheduling-job-triggers-use-case.md) | `ddd-ts-kit/scheduling-job-triggers-use-case` | a job lives in `application/scheduling/*.job.ts`, implements `ScheduledJob`, sends a command, and touches neither a repository nor the model | `error` | custom |
130
+ | [`scheduling/job-name`](docs/rules/scheduling-job-name.md) | `ddd-ts-kit/scheduling-job-name` | a job is named `<context>.<job-name>` by a string literal, and its `systemActor` carries that name | `error` | custom |
131
+ | [`imports/alias-only`](docs/rules/imports-alias-only.md) | `ddd-ts-kit/imports-alias-only` | a file of the project is imported by its alias (`@/...`, `$test/...`, `$scripts/...`), never by a relative path, the same directory included; no `.` or `..` segment in an alias path; fixable | `error` | custom |
132
+
133
+ `domain/*` and `application/*` ids are added by this plugin: the shape of a class needs a syntax
134
+ tree, so the CLI checker has no equivalent. The `domain-events/*` ids are not among them: both tools
135
+ hold them, and of `domain-events/transactional-before-commit` the checker alone holds what one file
136
+ does not show (where the adapters of an `application/ports/` port live, the phase an explicit-style
137
+ module file registers a handler in).
138
+
139
+ ### The two styles
140
+
141
+ `stack.style` in `ddd-ts-kit.config.json` says how the contexts of the project are written:
142
+ `explicit`, every binding is written in `<context>.module.ts`; `declared`, each class says what
143
+ it is with a decorator of `@ddd-ts-kit/kernel/declarations` and there is no module file. A
144
+ config that does not say is `explicit`, and an explicit-style project is judged exactly as before
145
+ the declared style existed.
146
+
147
+ | Rule | Added in a declared-style project |
148
+ |---|---|
149
+ | `authz/declared` | an exported class of a `*.command.ts` or `*.query.ts` file carries `@Requires(...)` or `@Public()` |
150
+ | `authz/in-application` | `Requires`, `Public` and `Policy` are not imported in `presentation/` or `infrastructure/`, nor the ports `Access` and `PolicyAccess` in `infrastructure/` |
151
+ | `layer/application-inward` | `@ddd-ts-kit/kernel/declarations` is allowed whatever `applicationAllowedPackages` says |
152
+ | `layer/domain-purity` | `@ddd-ts-kit/kernel/declarations` is refused in `domain/` |
153
+ | `events/consumer-idempotent` | `@IntegrationEventHandler` writes its `consumer` as a non-empty string literal |
154
+ | `context/extractable` | a role file imports nothing from a port file of another context |
155
+ | `declarations/role-declared` | the whole rule |
156
+
157
+ One thing holds in both styles: a message class carrying `@Requires` or `@Public` is declared,
158
+ so a module that registers it without `.requires(...)` or `.public()` is not reported.
159
+
160
+ A decorator is read from the syntax tree and counts when its name is imported from
161
+ `@ddd-ts-kit/kernel/declarations` in the file, under an alias (`{ Repository as Repo }`) or a
162
+ namespace (`declarations.Repository`) too. Three checks look at a class of another file (the
163
+ message a module registers, the event a `@DomainEventHandler` names, the class given to `toClass`): the import is resolved
164
+ like any other, the file is read from disk and parsed without types, and nothing is concluded
165
+ when it cannot be. `stack.assembly` (`barrel` or `discovery`) is read with the style; no rule of
166
+ this plugin depends on it, since the barrel is a fact of the project that `ddd-ts-kit check`
167
+ holds (`declarations/barrel-current`).
168
+
169
+ ### Standard rules instead of custom ones
170
+
171
+ Where a standard rule fully covers a part of the architecture reference, the presets enable it
172
+ and this plugin does not reimplement it.
173
+
174
+ | Architecture reference | Standard rule | Enabled by |
175
+ |---|---|---|
176
+ | `clean/no-escape-hatch`: explicit `any` | `@typescript-eslint/no-explicit-any` | `recommended`, `strict`, `dddTsKit()` |
177
+ | `clean/no-escape-hatch`: non-null assertion | `@typescript-eslint/no-non-null-assertion` | `recommended`, `strict`, `dddTsKit()` |
178
+ | `clean/no-escape-hatch`: `@ts-ignore`, `@ts-nocheck`, undescribed `@ts-expect-error` | `@typescript-eslint/ban-ts-comment` | `recommended`, `strict`, `dddTsKit()` |
179
+ | section 6, command or query and promises | `@typescript-eslint/no-floating-promises`, `no-misused-promises` | `dddTsKit()` with types |
180
+ | section 6, specific errors, exhaustive decisions | `@typescript-eslint/switch-exhaustiveness-check`, `no-unnecessary-condition` | `dddTsKit()` with types |
181
+ | section 6, immutability | `@typescript-eslint/prefer-readonly` | `dddTsKit()` with types |
182
+ | section 6, types | `@typescript-eslint/consistent-type-imports` | `dddTsKit()` |
183
+ | section 6, small functions | `complexity` (10, warn), `max-depth` (3, warn), `no-else-return` | `dddTsKit()` |
184
+ | section 6, no output argument | `no-param-reassign` (`props` in `domain/` and `application/`) | `dddTsKit()` |
185
+ | section 6, no surprise | `eqeqeq` | `dddTsKit()` |
186
+ | section 6, layout (`clean/blank-lines`) | `@stylistic/padding-line-between-statements`, `lines-between-class-members` | `recommended`, `strict`, `dddTsKit()` |
187
+ | section 6, layout (`clean/braces`) | `curly` (`all`) | `recommended`, `strict`, `dddTsKit()` |
188
+
189
+ `max-params`, `max-lines-per-function` and `max-lines` are deliberately not enabled:
190
+ `clean-function-size` exempts constructors and module files and reads `limits` from the config,
191
+ `clean-file-size` exempts generated files, which the standard rules cannot do, and both would
192
+ report the same thing twice. Layout is the opposite case: `clean/blank-lines` is entirely held by
193
+ `@stylistic/eslint-plugin` and `clean/braces` by `curly`, and this plugin writes no rule for them.
194
+ Where a token goes (indentation, quotes, line breaks, the padding of a block) is not linted at
195
+ all: the formatter of the project, Biome, owns it (`clean/formatted`), and no `@stylistic` rule
196
+ that would fight it is enabled.
197
+
198
+ ### Where the kit and typescript-eslint strict disagree
199
+
200
+ `dddTsKit()` changes ten strict rules, each for a stated reason, so that freshly generated code
201
+ is not reported for following the conventions of the kit:
202
+
203
+ | Rule | Setting | Reason |
204
+ |---|---|---|
205
+ | `require-await` | off | a port is asynchronous by contract; an in-memory adapter has nothing to await |
206
+ | `no-unnecessary-type-arguments` | off | the id type of an aggregate is part of its declaration |
207
+ | `consistent-type-definitions` | off | props are type aliases, states and options are interfaces |
208
+ | `no-empty-object-type` | interfaces allowed | `interface SessionExtensions {}` is left open for declaration merging |
209
+ | `no-extraneous-class` | empty classes allowed | a domain service or a fake starts empty |
210
+ | `no-unused-vars` | `args: 'none'` | an adapter implements the whole signature of its port |
211
+ | `dot-notation` | index signatures allowed | `process.env['PORT']` |
212
+ | `no-confusing-void-expression`, `restrict-template-expressions`, `restrict-plus-operands` | arrow shorthand, numbers and booleans allowed | not coercion bugs |
213
+
214
+ ## Settings
215
+
216
+ `settings['ddd-ts-kit']` replaces what is read from disk, for tests and editors:
217
+
218
+ | Key | Meaning |
219
+ |---|---|
220
+ | `config` | the content of `ddd-ts-kit.config.json`, as an object |
221
+ | `rootDir` | the project root, when `config` is given (default: the working directory) |
222
+ | `filename` | posix path relative to the root, used instead of the real file name |
223
+
224
+ ```ts
225
+ ruleTester.run('layer-domain-purity', rule, {
226
+ valid: [],
227
+ invalid: [
228
+ {
229
+ code: "import { z } from 'zod';",
230
+ settings: { 'ddd-ts-kit': { config: {}, filename: 'src/contexts/billing/domain/aggregates/invoice.aggregate.ts' } },
231
+ errors: [{ messageId: 'package' }],
232
+ },
233
+ ],
234
+ });
235
+ ```
236
+
237
+ The config file is read once per directory and per process: restart the ESLint server of the
238
+ editor after changing `ddd-ts-kit.config.json`.
239
+
240
+ Two things work as with the CLI checker: `rules.<id>: "off"` in the config silences the rule
241
+ even when the ESLint config enables it, and `// ddd-ts-kit-disable-next-line <id> -- <reason>`
242
+ silences one line for both tools. A suppression without a reason silences nothing, and
243
+ `governance/recorded-deviation` asks that the reason point to a decision record (`ADR-<number>`).
244
+
245
+ ## With `ddd-ts-kit check`
246
+
247
+ Two tools, one set of ids, no overlap of authority.
248
+
249
+ | Concern | Authority | Why |
250
+ |---|---|---|
251
+ | 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, `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 |
252
+ | 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 |
253
+ | 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 |
254
+
255
+ The CLI keeps approximating the code-level rules with regular expressions, without dependency:
256
+ it is the guard that runs in an editor hook after each write. When both report the same id, fix
257
+ the code once; when they disagree, this plugin is right and the checker is to be fixed. A test
258
+ of this package pins the classification of files and imports against the CLI on the same sample
259
+ paths.
260
+
261
+ ## TypeScript 7
262
+
263
+ typescript-eslint needs the JavaScript API of the compiler, which the native TypeScript 7 does
264
+ not ship (`typescript-eslint` 8.71 requires `typescript <6.1`). Keep both:
265
+
266
+ ```json
267
+ {
268
+ "devDependencies": {
269
+ "typescript": "~6.0.3",
270
+ "@typescript/native": "npm:typescript@~7.0.2"
271
+ },
272
+ "scripts": {
273
+ "typecheck": "node node_modules/@typescript/native/bin/tsc -p tsconfig.json --noEmit",
274
+ "lint": "eslint ."
275
+ }
276
+ }
277
+ ```
278
+
279
+ `typescript` 6 serves the tools that read sources through the compiler API (ESLint,
280
+ dependency-cruiser); the native 7 compiles and type-checks. Call the native compiler by its
281
+ path: both packages declare a `tsc` binary and `npx tsc` picks one of them.
282
+
283
+ ## Development
284
+
285
+ ```
286
+ node node_modules/@typescript/native/bin/tsc -b packages/eslint-plugin
287
+ npx vitest run packages/eslint-plugin
288
+ ```
289
+
290
+ Rules are tested with `@typescript-eslint/rule-tester` wired to Vitest
291
+ (`test/support/rule-tester.ts`). A rule comes with valid and invalid cases, a message that says
292
+ what to do instead, and a page in `docs/rules/`. The package is held by its own rules through the
293
+ root `eslint.config.mjs`: one export per file, files named after their export, the layout rules.
@@ -0,0 +1,5 @@
1
+ import type { TSESLint } from '@typescript-eslint/utils';
2
+ import { type DddTsKitOptions } from './presets/create-ddd-ts-kit.js';
3
+ /** The complete flat config of a ddd-ts-kit project. */
4
+ export declare function dddTsKit(options?: DddTsKitOptions): TSESLint.FlatConfig.ConfigArray;
5
+ //# sourceMappingURL=ddd-ts-kit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ddd-ts-kit.d.ts","sourceRoot":"","sources":["../src/ddd-ts-kit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtF,wDAAwD;AACxD,wBAAgB,QAAQ,CAAC,OAAO,GAAE,eAAoB,GAAG,QAAQ,CAAC,UAAU,CAAC,WAAW,CAEvF"}
@@ -0,0 +1,7 @@
1
+ import { plugin } from './plugin.js';
2
+ import { createDddTsKit } from './presets/create-ddd-ts-kit.js';
3
+ /** The complete flat config of a ddd-ts-kit project. */
4
+ export function dddTsKit(options = {}) {
5
+ return createDddTsKit(plugin, options);
6
+ }
7
+ //# sourceMappingURL=ddd-ts-kit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ddd-ts-kit.js","sourceRoot":"","sources":["../src/ddd-ts-kit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,cAAc,EAAwB,MAAM,gCAAgC,CAAC;AAEtF,wDAAwD;AACxD,MAAM,UAAU,QAAQ,CAAC,OAAO,GAAoB,EAAE;IACpD,OAAO,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC"}
@@ -0,0 +1,9 @@
1
+ export { dddTsKit } from './ddd-ts-kit.js';
2
+ export { plugin as default } from './plugin.js';
3
+ export type { DddTsKitOptions } from './presets/create-ddd-ts-kit.js';
4
+ export { standardRules } from './presets/standard-rule-sets.js';
5
+ export type { PluginSettings } from './project/plugin-settings.js';
6
+ export { rules } from './rules/rules.js';
7
+ export type { RuleDocs } from './support/rule/rule-docs.js';
8
+ export { VERSION } from './version.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,YAAY,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,YAAY,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ export { dddTsKit } from './ddd-ts-kit.js';
2
+ export { plugin as default } from './plugin.js';
3
+ export { standardRules } from './presets/standard-rule-sets.js';
4
+ export { rules } from './rules/rules.js';
5
+ export { VERSION } from './version.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { TSESLint } from '@typescript-eslint/utils';
2
+ type ConfigArray = TSESLint.FlatConfig.ConfigArray;
3
+ interface DddTsKitPlugin extends TSESLint.FlatConfig.Plugin {
4
+ readonly configs: {
5
+ recommended: ConfigArray;
6
+ strict: ConfigArray;
7
+ };
8
+ }
9
+ export declare const plugin: DddTsKitPlugin;
10
+ export {};
11
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAQzD,KAAK,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC;AAEnD,UAAU,cAAe,SAAQ,QAAQ,CAAC,UAAU,CAAC,MAAM;IACzD,QAAQ,CAAC,OAAO,EAAE;QAAE,WAAW,EAAE,WAAW,CAAC;QAAC,MAAM,EAAE,WAAW,CAAA;KAAE,CAAC;CACrE;AAED,eAAO,MAAM,MAAM,EAAE,cAIpB,CAAC"}
package/dist/plugin.js ADDED
@@ -0,0 +1,30 @@
1
+ import stylistic from '@stylistic/eslint-plugin';
2
+ import tseslint from 'typescript-eslint';
3
+ import { TYPESCRIPT_FILES } from './presets/create-ddd-ts-kit.js';
4
+ import { pluginRuleLevels } from './presets/plugin-rule-levels.js';
5
+ import { ESCAPE_HATCH_RULES } from './presets/standard-rules.js';
6
+ import { rules } from './rules/rules.js';
7
+ import { VERSION } from './version.js';
8
+ export const plugin = {
9
+ meta: { name: '@ddd-ts-kit/eslint-plugin', version: VERSION },
10
+ rules,
11
+ configs: { recommended: [], strict: [] },
12
+ };
13
+ plugin.configs.recommended = preset('recommended');
14
+ plugin.configs.strict = preset('error');
15
+ /**
16
+ * The rules of this plugin, the typescript-eslint rules they delegate to and the layout rules
17
+ * of `@stylistic/eslint-plugin`, on TypeScript files, without type information.
18
+ */
19
+ function preset(level) {
20
+ return [
21
+ {
22
+ name: `ddd-ts-kit/${level === 'error' ? 'strict' : 'recommended'}`,
23
+ files: TYPESCRIPT_FILES,
24
+ languageOptions: { parser: tseslint.parser },
25
+ plugins: { 'ddd-ts-kit': plugin, '@typescript-eslint': tseslint.plugin, '@stylistic': stylistic },
26
+ rules: { ...pluginRuleLevels(level), ...ESCAPE_HATCH_RULES },
27
+ },
28
+ ];
29
+ }
30
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,0BAA0B,CAAC;AAEjD,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAQvC,MAAM,CAAC,MAAM,MAAM,GAAmB;IACpC,IAAI,EAAE,EAAE,IAAI,EAAE,2BAA2B,EAAE,OAAO,EAAE,OAAO,EAAE;IAC7D,KAAK;IACL,OAAO,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;CACzC,CAAC;AAEF,MAAM,CAAC,OAAO,CAAC,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AACnD,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;AAExC;;;GAGG;AACH,SAAS,MAAM,CAAC,KAA8B;IAC5C,OAAO;QACL;YACE,IAAI,EAAE,cAAc,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,EAAE;YAClE,KAAK,EAAE,gBAAgB;YACvB,eAAe,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE;YAC5C,OAAO,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,oBAAoB,EAAE,QAAQ,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE;YACjG,KAAK,EAAE,EAAE,GAAG,gBAAgB,CAAC,KAAK,CAAC,EAAE,GAAG,kBAAkB,EAAE;SAC7D;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { TSESLint } from '@typescript-eslint/utils';
2
+ type Rules = TSESLint.FlatConfig.Rules;
3
+ /**
4
+ * `clean/braces` of docs/ARCHITECTURE.md, held by `curly` of ESLint instead of a rule written a
5
+ * second time: every `if`, `else`, `for`, `while` and `do` has braces. Where the braces and the
6
+ * body go is the work of the formatter (`clean/formatted`), which never leaves a body on the
7
+ * line of its braces.
8
+ */
9
+ export declare function bracesRules(level: 'error' | 'warn'): Rules;
10
+ export {};
11
+ //# sourceMappingURL=braces-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"braces-rules.d.ts","sourceRoot":"","sources":["../../src/presets/braces-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,KAAK,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC;AAEvC;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,CAE1D"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * `clean/braces` of docs/ARCHITECTURE.md, held by `curly` of ESLint instead of a rule written a
3
+ * second time: every `if`, `else`, `for`, `while` and `do` has braces. Where the braces and the
4
+ * body go is the work of the formatter (`clean/formatted`), which never leaves a body on the
5
+ * line of its braces.
6
+ */
7
+ export function bracesRules(level) {
8
+ return { curly: [level, 'all'] };
9
+ }
10
+ //# sourceMappingURL=braces-rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"braces-rules.js","sourceRoot":"","sources":["../../src/presets/braces-rules.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,OAAO,EAAE,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;AACnC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { TSESLint } from '@typescript-eslint/utils';
2
+ type ConfigArray = TSESLint.FlatConfig.ConfigArray;
3
+ type Plugin = TSESLint.FlatConfig.Plugin;
4
+ export interface DddTsKitOptions {
5
+ /** Directory of the tsconfig and of `ddd-ts-kit.config.json`. Default: the working directory. */
6
+ readonly tsconfigRootDir?: string;
7
+ /** Adds the rules that read types (slower, needs a tsconfig covering the linted files). Default: true. */
8
+ readonly typeChecked?: boolean;
9
+ /** Files outside the tsconfig that are still linted with types, as `projectService.allowDefaultProject` globs. */
10
+ readonly allowDefaultProject?: readonly string[];
11
+ readonly ignores?: readonly string[];
12
+ }
13
+ export declare const TYPESCRIPT_FILES: string[];
14
+ /**
15
+ * A complete flat config: typescript-eslint strict and stylistic, the standard rules backing
16
+ * the clean code section of the architecture reference, and the rules of this plugin at the
17
+ * severities of `ddd-ts-kit.config.json`.
18
+ */
19
+ export declare function createDddTsKit(plugin: Plugin, options?: DddTsKitOptions): ConfigArray;
20
+ export {};
21
+ //# sourceMappingURL=create-ddd-ts-kit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-ddd-ts-kit.d.ts","sourceRoot":"","sources":["../../src/presets/create-ddd-ts-kit.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAsBzD,KAAK,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC;AAEnD,KAAK,MAAM,GAAG,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC;AAEzC,MAAM,WAAW,eAAe;IAC9B,iGAAiG;IACjG,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,0GAA0G;IAC1G,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,kHAAkH;IAClH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjD,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED,eAAO,MAAM,gBAAgB,UAAsC,CAAC;AAcpE;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,WAAW,CAuBzF"}
@@ -0,0 +1,123 @@
1
+ import js from '@eslint/js';
2
+ import stylistic from '@stylistic/eslint-plugin';
3
+ import tseslint from 'typescript-eslint';
4
+ import { configuredSeverity } from '../project/configured-severity.js';
5
+ import { parseConfig } from '../project/parse-config.js';
6
+ import { findProject } from '../project/find-project.js';
7
+ import { rules as pluginRules } from '../rules/rules.js';
8
+ import { docsOf } from '../support/rule/docs-of.js';
9
+ import { eslintName } from '../support/rule/define-rule.js';
10
+ import { bracesRules } from './braces-rules.js';
11
+ import { layoutRules } from './layout-rules.js';
12
+ import { AGGREGATE_RULES, CLEAN_CODE_RULES, ESCAPE_HATCH_RULES, INNER_LAYER_RULES, KIT_CONVENTIONS, TEST_RULES, TYPED_CLEAN_CODE_RULES, } from './standard-rules.js';
13
+ export const TYPESCRIPT_FILES = ['**/*.ts', '**/*.mts', '**/*.cts'];
14
+ const DEFAULT_IGNORES = ['**/dist/**', '**/coverage/**', '**/node_modules/**', '**/reports/**', '**/*.d.ts'];
15
+ /** The architecture id whose severity drives the layout rules of `@stylistic/eslint-plugin`. */
16
+ const LAYOUT_ID = 'clean/blank-lines';
17
+ /** The architecture id whose severity drives `curly`. */
18
+ const BRACES_ID = 'clean/braces';
19
+ const JAVASCRIPT_FILES = ['**/*.js', '**/*.mjs', '**/*.cjs'];
20
+ const DEFAULT_PROJECT_FILES = ['*.config.ts', '*.config.mts'];
21
+ /**
22
+ * A complete flat config: typescript-eslint strict and stylistic, the standard rules backing
23
+ * the clean code section of the architecture reference, and the rules of this plugin at the
24
+ * severities of `ddd-ts-kit.config.json`.
25
+ */
26
+ export function createDddTsKit(plugin, options = {}) {
27
+ const root = options.tsconfigRootDir ?? process.cwd();
28
+ const config = findProject(root)?.config ?? parseConfig({});
29
+ const standard = options.typeChecked === false ? untyped() : typed(root, options.allowDefaultProject ?? DEFAULT_PROJECT_FILES);
30
+ return [
31
+ { name: 'ddd-ts-kit/ignores', ignores: [...DEFAULT_IGNORES, ...(options.ignores ?? [])] },
32
+ js.configs.recommended,
33
+ ...standard.presets,
34
+ { name: 'ddd-ts-kit/clean-code', files: TYPESCRIPT_FILES, rules: standard.rules },
35
+ {
36
+ name: 'ddd-ts-kit/architecture',
37
+ files: TYPESCRIPT_FILES,
38
+ plugins: { 'ddd-ts-kit': plugin, '@stylistic': stylistic },
39
+ rules: configuredLevels(config),
40
+ },
41
+ { name: 'ddd-ts-kit/scripts', files: JAVASCRIPT_FILES, rules: configuredBraces(config) },
42
+ { name: 'ddd-ts-kit/inner-layers', files: innerLayerFiles(config), rules: INNER_LAYER_RULES },
43
+ { name: 'ddd-ts-kit/aggregates', files: aggregateFiles(config), rules: standard.aggregateRules },
44
+ { name: 'ddd-ts-kit/tests', files: testFiles(config), rules: standard.testRules },
45
+ ];
46
+ }
47
+ function typed(root, allowDefaultProject) {
48
+ return {
49
+ presets: [
50
+ ...tseslint.configs.strictTypeChecked,
51
+ ...tseslint.configs.stylisticTypeChecked,
52
+ ...typeInformation(root, allowDefaultProject),
53
+ ],
54
+ rules: { ...CLEAN_CODE_RULES, ...ESCAPE_HATCH_RULES, ...TYPED_CLEAN_CODE_RULES, ...KIT_CONVENTIONS },
55
+ aggregateRules: AGGREGATE_RULES,
56
+ testRules: TEST_RULES,
57
+ };
58
+ }
59
+ function untyped() {
60
+ return {
61
+ presets: [...tseslint.configs.strict, ...tseslint.configs.stylistic],
62
+ rules: withoutTypedRules({ ...CLEAN_CODE_RULES, ...ESCAPE_HATCH_RULES, ...KIT_CONVENTIONS }),
63
+ aggregateRules: {},
64
+ testRules: withoutTypedRules(TEST_RULES),
65
+ };
66
+ }
67
+ function typeInformation(root, allowDefaultProject) {
68
+ return [
69
+ {
70
+ name: 'ddd-ts-kit/type-information',
71
+ files: TYPESCRIPT_FILES,
72
+ languageOptions: {
73
+ parserOptions: { projectService: { allowDefaultProject: [...allowDefaultProject] }, tsconfigRootDir: root },
74
+ },
75
+ },
76
+ { name: 'ddd-ts-kit/javascript', files: JAVASCRIPT_FILES, ...tseslint.configs.disableTypeChecked },
77
+ ];
78
+ }
79
+ /** `rules.<id>` of ddd-ts-kit.config.json wins over the documented default, as it does for the CLI checker. */
80
+ function configuredLevels(config) {
81
+ const own = Object.fromEntries(Object.entries(pluginRules).map(([name, rule]) => [`ddd-ts-kit/${name}`, levelOf(config, rule)]));
82
+ const layout = configuredSeverity(config, LAYOUT_ID) ?? 'error';
83
+ return { ...own, ...(layout === 'off' ? {} : layoutRules(layout)), ...configuredBraces(config) };
84
+ }
85
+ /** Scripts written in JavaScript carry no layer, but a branch reads the same in them. */
86
+ function configuredBraces(config) {
87
+ const braces = configuredSeverity(config, BRACES_ID) ?? 'error';
88
+ return braces === 'off' ? {} : bracesRules(braces);
89
+ }
90
+ /** A companion rule (the ceiling of `clean/function-size`) keeps its own severity: only `off` reaches it. */
91
+ function levelOf(config, rule) {
92
+ const { ruleId, name, recommended } = docsOf(rule);
93
+ const configured = configuredSeverity(config, ruleId);
94
+ return name === eslintName(ruleId) || configured === 'off' ? (configured ?? recommended) : recommended;
95
+ }
96
+ function innerLayerFiles(config) {
97
+ return [`${config.contextsDir}/*/domain/**/*.ts`, `${config.contextsDir}/*/application/**/*.ts`];
98
+ }
99
+ function aggregateFiles(config) {
100
+ return [`${config.contextsDir}/*/domain/aggregates/**/*.ts`, `${config.contextsDir}/*/domain/entities/**/*.ts`];
101
+ }
102
+ function testFiles(config) {
103
+ return ['**/*.spec.ts', '**/*.test.ts', `${config.contextsDir}/*/test/**/*.ts`, 'test/**/*.ts'];
104
+ }
105
+ /** Rules of typescript-eslint that need type information: naming them without it is an error. */
106
+ const TYPED_RULES = [
107
+ 'unbound-method',
108
+ 'no-unsafe-assignment',
109
+ 'no-unsafe-member-access',
110
+ 'no-unsafe-call',
111
+ 'no-unsafe-argument',
112
+ 'no-unsafe-return',
113
+ 'require-await',
114
+ 'no-unnecessary-type-arguments',
115
+ 'dot-notation',
116
+ 'no-confusing-void-expression',
117
+ 'restrict-template-expressions',
118
+ 'restrict-plus-operands',
119
+ ];
120
+ function withoutTypedRules(rules) {
121
+ return Object.fromEntries(Object.entries(rules).filter(([name]) => !TYPED_RULES.some((typed) => name === `@typescript-eslint/${typed}`)));
122
+ }
123
+ //# sourceMappingURL=create-ddd-ts-kit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-ddd-ts-kit.js","sourceRoot":"","sources":["../../src/presets/create-ddd-ts-kit.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+ import type { TSESLint } from '@typescript-eslint/utils';
2
+ export type Rules = TSESLint.FlatConfig.Rules;
3
+ //# sourceMappingURL=flat-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flat-rules.d.ts","sourceRoot":"","sources":["../../src/presets/flat-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=flat-rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flat-rules.js","sourceRoot":"","sources":["../../src/presets/flat-rules.ts"],"names":[],"mappings":""}