@ddd-ts-kit/eslint-plugin 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +292 -2
- package/dist/ddd-ts-kit.d.ts +5 -0
- package/dist/ddd-ts-kit.d.ts.map +1 -0
- package/dist/ddd-ts-kit.js +7 -0
- package/dist/ddd-ts-kit.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +11 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +30 -0
- package/dist/plugin.js.map +1 -0
- package/dist/presets/braces-rules.d.ts +11 -0
- package/dist/presets/braces-rules.d.ts.map +1 -0
- package/dist/presets/braces-rules.js +10 -0
- package/dist/presets/braces-rules.js.map +1 -0
- package/dist/presets/create-ddd-ts-kit.d.ts +21 -0
- package/dist/presets/create-ddd-ts-kit.d.ts.map +1 -0
- package/dist/presets/create-ddd-ts-kit.js +123 -0
- package/dist/presets/create-ddd-ts-kit.js.map +1 -0
- package/dist/presets/flat-rules.d.ts +3 -0
- package/dist/presets/flat-rules.d.ts.map +1 -0
- package/dist/presets/flat-rules.js +2 -0
- package/dist/presets/flat-rules.js.map +1 -0
- package/dist/presets/layout-rules.d.ts +11 -0
- package/dist/presets/layout-rules.d.ts.map +1 -0
- package/dist/presets/layout-rules.js +33 -0
- package/dist/presets/layout-rules.js.map +1 -0
- package/dist/presets/plugin-rule-levels.d.ts +4 -0
- package/dist/presets/plugin-rule-levels.d.ts.map +1 -0
- package/dist/presets/plugin-rule-levels.js +13 -0
- package/dist/presets/plugin-rule-levels.js.map +1 -0
- package/dist/presets/standard-rule-sets.d.ts +12 -0
- package/dist/presets/standard-rule-sets.d.ts.map +1 -0
- package/dist/presets/standard-rule-sets.js +15 -0
- package/dist/presets/standard-rule-sets.js.map +1 -0
- package/dist/presets/standard-rules.d.ts +24 -0
- package/dist/presets/standard-rules.d.ts.map +1 -0
- package/dist/presets/standard-rules.js +88 -0
- package/dist/presets/standard-rules.js.map +1 -0
- package/dist/project/alias-root.d.ts +8 -0
- package/dist/project/alias-root.d.ts.map +1 -0
- package/dist/project/alias-root.js +2 -0
- package/dist/project/alias-root.js.map +1 -0
- package/dist/project/alias-roots.d.ts +9 -0
- package/dist/project/alias-roots.d.ts.map +1 -0
- package/dist/project/alias-roots.js +17 -0
- package/dist/project/alias-roots.js.map +1 -0
- package/dist/project/config-file.d.ts +2 -0
- package/dist/project/config-file.d.ts.map +1 -0
- package/dist/project/config-file.js +2 -0
- package/dist/project/config-file.js.map +1 -0
- package/dist/project/config.d.ts +53 -0
- package/dist/project/config.d.ts.map +1 -0
- package/dist/project/config.js +2 -0
- package/dist/project/config.js.map +1 -0
- package/dist/project/configured-severity.d.ts +3 -0
- package/dist/project/configured-severity.d.ts.map +1 -0
- package/dist/project/configured-severity.js +5 -0
- package/dist/project/configured-severity.js.map +1 -0
- package/dist/project/describe-linted-file.d.ts +4 -0
- package/dist/project/describe-linted-file.d.ts.map +1 -0
- package/dist/project/describe-linted-file.js +38 -0
- package/dist/project/describe-linted-file.js.map +1 -0
- package/dist/project/find-project.d.ts +4 -0
- package/dist/project/find-project.d.ts.map +1 -0
- package/dist/project/find-project.js +37 -0
- package/dist/project/find-project.js.map +1 -0
- package/dist/project/is-record.d.ts +2 -0
- package/dist/project/is-record.d.ts.map +1 -0
- package/dist/project/is-record.js +4 -0
- package/dist/project/is-record.js.map +1 -0
- package/dist/project/is-test-file.d.ts +3 -0
- package/dist/project/is-test-file.d.ts.map +1 -0
- package/dist/project/is-test-file.js +4 -0
- package/dist/project/is-test-file.js.map +1 -0
- package/dist/project/layer.d.ts +2 -0
- package/dist/project/layer.d.ts.map +1 -0
- package/dist/project/layer.js +2 -0
- package/dist/project/layer.js.map +1 -0
- package/dist/project/lint-host.d.ts +6 -0
- package/dist/project/lint-host.d.ts.map +1 -0
- package/dist/project/lint-host.js +2 -0
- package/dist/project/lint-host.js.map +1 -0
- package/dist/project/linted-file.d.ts +13 -0
- package/dist/project/linted-file.d.ts.map +1 -0
- package/dist/project/linted-file.js +2 -0
- package/dist/project/linted-file.js.map +1 -0
- package/dist/project/locate.d.ts +5 -0
- package/dist/project/locate.d.ts.map +1 -0
- package/dist/project/locate.js +47 -0
- package/dist/project/locate.js.map +1 -0
- package/dist/project/location.d.ts +11 -0
- package/dist/project/location.d.ts.map +1 -0
- package/dist/project/location.js +2 -0
- package/dist/project/location.js.map +1 -0
- package/dist/project/parse-allowed-file.d.ts +4 -0
- package/dist/project/parse-allowed-file.d.ts.map +1 -0
- package/dist/project/parse-allowed-file.js +11 -0
- package/dist/project/parse-allowed-file.js.map +1 -0
- package/dist/project/parse-config.d.ts +10 -0
- package/dist/project/parse-config.d.ts.map +1 -0
- package/dist/project/parse-config.js +113 -0
- package/dist/project/parse-config.js.map +1 -0
- package/dist/project/plugin-settings.d.ts +8 -0
- package/dist/project/plugin-settings.d.ts.map +1 -0
- package/dist/project/plugin-settings.js +2 -0
- package/dist/project/plugin-settings.js.map +1 -0
- package/dist/project/posix.d.ts +2 -0
- package/dist/project/posix.d.ts.map +1 -0
- package/dist/project/posix.js +4 -0
- package/dist/project/posix.js.map +1 -0
- package/dist/project/resolve-import.d.ts +15 -0
- package/dist/project/resolve-import.d.ts.map +1 -0
- package/dist/project/resolve-import.js +32 -0
- package/dist/project/resolve-import.js.map +1 -0
- package/dist/project/to-alias.d.ts +7 -0
- package/dist/project/to-alias.d.ts.map +1 -0
- package/dist/project/to-alias.js +13 -0
- package/dist/project/to-alias.js.map +1 -0
- package/dist/project/to-posix.d.ts +2 -0
- package/dist/project/to-posix.d.ts.map +1 -0
- package/dist/project/to-posix.js +5 -0
- package/dist/project/to-posix.js.map +1 -0
- package/dist/rules/application-command-query-separation.d.ts +6 -0
- package/dist/rules/application-command-query-separation.d.ts.map +1 -0
- package/dist/rules/application-command-query-separation.js +49 -0
- package/dist/rules/application-command-query-separation.js.map +1 -0
- package/dist/rules/application-handler-shape.d.ts +4 -0
- package/dist/rules/application-handler-shape.d.ts.map +1 -0
- package/dist/rules/application-handler-shape.js +51 -0
- package/dist/rules/application-handler-shape.js.map +1 -0
- package/dist/rules/aspects-outside-in.d.ts +2 -0
- package/dist/rules/aspects-outside-in.d.ts.map +1 -0
- package/dist/rules/aspects-outside-in.js +45 -0
- package/dist/rules/aspects-outside-in.js.map +1 -0
- package/dist/rules/authz-actor-explicit.d.ts +5 -0
- package/dist/rules/authz-actor-explicit.d.ts.map +1 -0
- package/dist/rules/authz-actor-explicit.js +106 -0
- package/dist/rules/authz-actor-explicit.js.map +1 -0
- package/dist/rules/authz-declared.d.ts +5 -0
- package/dist/rules/authz-declared.d.ts.map +1 -0
- package/dist/rules/authz-declared.js +167 -0
- package/dist/rules/authz-declared.js.map +1 -0
- package/dist/rules/authz-in-application.d.ts +5 -0
- package/dist/rules/authz-in-application.d.ts.map +1 -0
- package/dist/rules/authz-in-application.js +202 -0
- package/dist/rules/authz-in-application.js.map +1 -0
- package/dist/rules/clean-file-size.d.ts +2 -0
- package/dist/rules/clean-file-size.d.ts.map +1 -0
- package/dist/rules/clean-file-size.js +25 -0
- package/dist/rules/clean-file-size.js.map +1 -0
- package/dist/rules/clean-function-ceiling.d.ts +6 -0
- package/dist/rules/clean-function-ceiling.d.ts.map +1 -0
- package/dist/rules/clean-function-ceiling.js +32 -0
- package/dist/rules/clean-function-ceiling.js.map +1 -0
- package/dist/rules/clean-function-size.d.ts +7 -0
- package/dist/rules/clean-function-size.d.ts.map +1 -0
- package/dist/rules/clean-function-size.js +70 -0
- package/dist/rules/clean-function-size.js.map +1 -0
- package/dist/rules/clean-no-commented-out-code.d.ts +3 -0
- package/dist/rules/clean-no-commented-out-code.d.ts.map +1 -0
- package/dist/rules/clean-no-commented-out-code.js +60 -0
- package/dist/rules/clean-no-commented-out-code.js.map +1 -0
- package/dist/rules/clean-no-escape-hatch.d.ts +15 -0
- package/dist/rules/clean-no-escape-hatch.d.ts.map +1 -0
- package/dist/rules/clean-no-escape-hatch.js +116 -0
- package/dist/rules/clean-no-escape-hatch.js.map +1 -0
- package/dist/rules/clean-no-flag-argument.d.ts +2 -0
- package/dist/rules/clean-no-flag-argument.d.ts.map +1 -0
- package/dist/rules/clean-no-flag-argument.js +80 -0
- package/dist/rules/clean-no-flag-argument.js.map +1 -0
- package/dist/rules/clean-no-hash-private.d.ts +2 -0
- package/dist/rules/clean-no-hash-private.d.ts.map +1 -0
- package/dist/rules/clean-no-hash-private.js +36 -0
- package/dist/rules/clean-no-hash-private.js.map +1 -0
- package/dist/rules/clean-no-noise-comment.d.ts +5 -0
- package/dist/rules/clean-no-noise-comment.d.ts.map +1 -0
- package/dist/rules/clean-no-noise-comment.js +187 -0
- package/dist/rules/clean-no-noise-comment.js.map +1 -0
- package/dist/rules/clean-one-export-per-file.d.ts +10 -0
- package/dist/rules/clean-one-export-per-file.d.ts.map +1 -0
- package/dist/rules/clean-one-export-per-file.js +124 -0
- package/dist/rules/clean-one-export-per-file.js.map +1 -0
- package/dist/rules/clean-stepdown.d.ts +3 -0
- package/dist/rules/clean-stepdown.d.ts.map +1 -0
- package/dist/rules/clean-stepdown.js +33 -0
- package/dist/rules/clean-stepdown.js.map +1 -0
- package/dist/rules/context-boundaries.d.ts +4 -0
- package/dist/rules/context-boundaries.d.ts.map +1 -0
- package/dist/rules/context-boundaries.js +87 -0
- package/dist/rules/context-boundaries.js.map +1 -0
- package/dist/rules/context-extractable.d.ts +5 -0
- package/dist/rules/context-extractable.d.ts.map +1 -0
- package/dist/rules/context-extractable.js +242 -0
- package/dist/rules/context-extractable.js.map +1 -0
- package/dist/rules/declarations-role-declared.d.ts +5 -0
- package/dist/rules/declarations-role-declared.d.ts.map +1 -0
- package/dist/rules/declarations-role-declared.js +142 -0
- package/dist/rules/declarations-role-declared.js.map +1 -0
- package/dist/rules/domain-aggregate-encapsulation.d.ts +4 -0
- package/dist/rules/domain-aggregate-encapsulation.d.ts.map +1 -0
- package/dist/rules/domain-aggregate-encapsulation.js +93 -0
- package/dist/rules/domain-aggregate-encapsulation.js.map +1 -0
- package/dist/rules/domain-events-dispatched-on-save.d.ts +3 -0
- package/dist/rules/domain-events-dispatched-on-save.d.ts.map +1 -0
- package/dist/rules/domain-events-dispatched-on-save.js +87 -0
- package/dist/rules/domain-events-dispatched-on-save.js.map +1 -0
- package/dist/rules/domain-events-transactional-before-commit.d.ts +4 -0
- package/dist/rules/domain-events-transactional-before-commit.d.ts.map +1 -0
- package/dist/rules/domain-events-transactional-before-commit.js +121 -0
- package/dist/rules/domain-events-transactional-before-commit.js.map +1 -0
- package/dist/rules/domain-no-generic-error.d.ts +2 -0
- package/dist/rules/domain-no-generic-error.d.ts.map +1 -0
- package/dist/rules/domain-no-generic-error.js +32 -0
- package/dist/rules/domain-no-generic-error.js.map +1 -0
- package/dist/rules/domain-value-object-immutability.d.ts +4 -0
- package/dist/rules/domain-value-object-immutability.d.ts.map +1 -0
- package/dist/rules/domain-value-object-immutability.js +77 -0
- package/dist/rules/domain-value-object-immutability.js.map +1 -0
- package/dist/rules/events-consumer-idempotent.d.ts +5 -0
- package/dist/rules/events-consumer-idempotent.d.ts.map +1 -0
- package/dist/rules/events-consumer-idempotent.js +115 -0
- package/dist/rules/events-consumer-idempotent.js.map +1 -0
- package/dist/rules/events-name-format.d.ts +2 -0
- package/dist/rules/events-name-format.d.ts.map +1 -0
- package/dist/rules/events-name-format.js +53 -0
- package/dist/rules/events-name-format.js.map +1 -0
- package/dist/rules/events-outbox-required.d.ts +7 -0
- package/dist/rules/events-outbox-required.d.ts.map +1 -0
- package/dist/rules/events-outbox-required.js +82 -0
- package/dist/rules/events-outbox-required.js.map +1 -0
- package/dist/rules/governance-recorded-deviation.d.ts +2 -0
- package/dist/rules/governance-recorded-deviation.d.ts.map +1 -0
- package/dist/rules/governance-recorded-deviation.js +73 -0
- package/dist/rules/governance-recorded-deviation.js.map +1 -0
- package/dist/rules/imports-alias-only.d.ts +5 -0
- package/dist/rules/imports-alias-only.d.ts.map +1 -0
- package/dist/rules/imports-alias-only.js +63 -0
- package/dist/rules/imports-alias-only.js.map +1 -0
- package/dist/rules/layer-application-inward.d.ts +2 -0
- package/dist/rules/layer-application-inward.d.ts.map +1 -0
- package/dist/rules/layer-application-inward.js +66 -0
- package/dist/rules/layer-application-inward.js.map +1 -0
- package/dist/rules/layer-domain-purity.d.ts +4 -0
- package/dist/rules/layer-domain-purity.d.ts.map +1 -0
- package/dist/rules/layer-domain-purity.js +75 -0
- package/dist/rules/layer-domain-purity.js.map +1 -0
- package/dist/rules/layer-sideways.d.ts +3 -0
- package/dist/rules/layer-sideways.d.ts.map +1 -0
- package/dist/rules/layer-sideways.js +42 -0
- package/dist/rules/layer-sideways.js.map +1 -0
- package/dist/rules/ports-abstract-class.d.ts +2 -0
- package/dist/rules/ports-abstract-class.d.ts.map +1 -0
- package/dist/rules/ports-abstract-class.js +74 -0
- package/dist/rules/ports-abstract-class.js.map +1 -0
- package/dist/rules/ports-implements-never-extends.d.ts +5 -0
- package/dist/rules/ports-implements-never-extends.d.ts.map +1 -0
- package/dist/rules/ports-implements-never-extends.js +81 -0
- package/dist/rules/ports-implements-never-extends.js.map +1 -0
- package/dist/rules/ports-no-concrete-dependency.d.ts +2 -0
- package/dist/rules/ports-no-concrete-dependency.d.ts.map +1 -0
- package/dist/rules/ports-no-concrete-dependency.js +32 -0
- package/dist/rules/ports-no-concrete-dependency.js.map +1 -0
- package/dist/rules/ports-no-token-constant.d.ts +5 -0
- package/dist/rules/ports-no-token-constant.d.ts.map +1 -0
- package/dist/rules/ports-no-token-constant.js +109 -0
- package/dist/rules/ports-no-token-constant.js.map +1 -0
- package/dist/rules/ports-value-import.d.ts +3 -0
- package/dist/rules/ports-value-import.d.ts.map +1 -0
- package/dist/rules/ports-value-import.js +60 -0
- package/dist/rules/ports-value-import.js.map +1 -0
- package/dist/rules/purity.d.ts +4 -0
- package/dist/rules/purity.d.ts.map +1 -0
- package/dist/rules/purity.js +65 -0
- package/dist/rules/purity.js.map +1 -0
- package/dist/rules/rules.d.ts +4 -0
- package/dist/rules/rules.d.ts.map +1 -0
- package/dist/rules/rules.js +97 -0
- package/dist/rules/rules.js.map +1 -0
- package/dist/rules/scheduling-job-name.d.ts +5 -0
- package/dist/rules/scheduling-job-name.d.ts.map +1 -0
- package/dist/rules/scheduling-job-name.js +98 -0
- package/dist/rules/scheduling-job-name.js.map +1 -0
- package/dist/rules/scheduling-job-triggers-use-case.d.ts +5 -0
- package/dist/rules/scheduling-job-triggers-use-case.d.ts.map +1 -0
- package/dist/rules/scheduling-job-triggers-use-case.js +129 -0
- package/dist/rules/scheduling-job-triggers-use-case.js.map +1 -0
- package/dist/rules/standard-no-parallel-interface.d.ts +2 -0
- package/dist/rules/standard-no-parallel-interface.d.ts.map +1 -0
- package/dist/rules/standard-no-parallel-interface.js +57 -0
- package/dist/rules/standard-no-parallel-interface.js.map +1 -0
- package/dist/rules/test-no-mocks.d.ts +2 -0
- package/dist/rules/test-no-mocks.d.ts.map +1 -0
- package/dist/rules/test-no-mocks.js +50 -0
- package/dist/rules/test-no-mocks.js.map +1 -0
- package/dist/rules/tracing-platform-only.d.ts +2 -0
- package/dist/rules/tracing-platform-only.d.ts.map +1 -0
- package/dist/rules/tracing-platform-only.js +52 -0
- package/dist/rules/tracing-platform-only.js.map +1 -0
- package/dist/support/ancestors.d.ts +4 -0
- package/dist/support/ancestors.d.ts.map +1 -0
- package/dist/support/ancestors.js +7 -0
- package/dist/support/ancestors.js.map +1 -0
- package/dist/support/calls/accessed-name.d.ts +4 -0
- package/dist/support/calls/accessed-name.d.ts.map +1 -0
- package/dist/support/calls/accessed-name.js +14 -0
- package/dist/support/calls/accessed-name.js.map +1 -0
- package/dist/support/calls/callee-name.d.ts +4 -0
- package/dist/support/calls/callee-name.d.ts.map +1 -0
- package/dist/support/calls/callee-name.js +11 -0
- package/dist/support/calls/callee-name.js.map +1 -0
- package/dist/support/calls/has-spread.d.ts +4 -0
- package/dist/support/calls/has-spread.d.ts.map +1 -0
- package/dist/support/calls/has-spread.js +6 -0
- package/dist/support/calls/has-spread.js.map +1 -0
- package/dist/support/calls/method-chain.d.ts +8 -0
- package/dist/support/calls/method-chain.d.ts.map +1 -0
- package/dist/support/calls/method-chain.js +13 -0
- package/dist/support/calls/method-chain.js.map +1 -0
- package/dist/support/calls/missing-keys.d.ts +7 -0
- package/dist/support/calls/missing-keys.d.ts.map +1 -0
- package/dist/support/calls/missing-keys.js +28 -0
- package/dist/support/calls/missing-keys.js.map +1 -0
- package/dist/support/calls/property-of.d.ts +3 -0
- package/dist/support/calls/property-of.d.ts.map +1 -0
- package/dist/support/calls/property-of.js +8 -0
- package/dist/support/calls/property-of.js.map +1 -0
- package/dist/support/classes/class-finder.d.ts +18 -0
- package/dist/support/classes/class-finder.d.ts.map +1 -0
- package/dist/support/classes/class-finder.js +76 -0
- package/dist/support/classes/class-finder.js.map +1 -0
- package/dist/support/classes/class-name.d.ts +4 -0
- package/dist/support/classes/class-name.d.ts.map +1 -0
- package/dist/support/classes/class-name.js +4 -0
- package/dist/support/classes/class-name.js.map +1 -0
- package/dist/support/classes/constructor-of.d.ts +3 -0
- package/dist/support/classes/constructor-of.d.ts.map +1 -0
- package/dist/support/classes/constructor-of.js +5 -0
- package/dist/support/classes/constructor-of.js.map +1 -0
- package/dist/support/classes/enclosing-member.d.ts +8 -0
- package/dist/support/classes/enclosing-member.d.ts.map +1 -0
- package/dist/support/classes/enclosing-member.js +15 -0
- package/dist/support/classes/enclosing-member.js.map +1 -0
- package/dist/support/classes/exported-classes.d.ts +4 -0
- package/dist/support/classes/exported-classes.d.ts.map +1 -0
- package/dist/support/classes/exported-classes.js +22 -0
- package/dist/support/classes/exported-classes.js.map +1 -0
- package/dist/support/classes/is-callable.d.ts +4 -0
- package/dist/support/classes/is-callable.d.ts.map +1 -0
- package/dist/support/classes/is-callable.js +10 -0
- package/dist/support/classes/is-callable.js.map +1 -0
- package/dist/support/classes/is-constructor.d.ts +3 -0
- package/dist/support/classes/is-constructor.d.ts.map +1 -0
- package/dist/support/classes/is-constructor.js +5 -0
- package/dist/support/classes/is-constructor.js.map +1 -0
- package/dist/support/classes/is-function.d.ts +3 -0
- package/dist/support/classes/is-function.d.ts.map +1 -0
- package/dist/support/classes/is-function.js +5 -0
- package/dist/support/classes/is-function.js.map +1 -0
- package/dist/support/classes/is-inline-export.d.ts +3 -0
- package/dist/support/classes/is-inline-export.d.ts.map +1 -0
- package/dist/support/classes/is-inline-export.js +6 -0
- package/dist/support/classes/is-inline-export.js.map +1 -0
- package/dist/support/classes/is-keyed.d.ts +5 -0
- package/dist/support/classes/is-keyed.d.ts.map +1 -0
- package/dist/support/classes/is-keyed.js +5 -0
- package/dist/support/classes/is-keyed.js.map +1 -0
- package/dist/support/classes/key-name.d.ts +3 -0
- package/dist/support/classes/key-name.d.ts.map +1 -0
- package/dist/support/classes/key-name.js +11 -0
- package/dist/support/classes/key-name.js.map +1 -0
- package/dist/support/classes/member-name.d.ts +4 -0
- package/dist/support/classes/member-name.d.ts.map +1 -0
- package/dist/support/classes/member-name.js +7 -0
- package/dist/support/classes/member-name.js.map +1 -0
- package/dist/support/classes/top-level-classes.d.ts +4 -0
- package/dist/support/classes/top-level-classes.d.ts.map +1 -0
- package/dist/support/classes/top-level-classes.js +10 -0
- package/dist/support/classes/top-level-classes.js.map +1 -0
- package/dist/support/classes/visibility-of.d.ts +4 -0
- package/dist/support/classes/visibility-of.d.ts.map +1 -0
- package/dist/support/classes/visibility-of.js +12 -0
- package/dist/support/classes/visibility-of.js.map +1 -0
- package/dist/support/comments/comment-lines.d.ts +15 -0
- package/dist/support/comments/comment-lines.d.ts.map +1 -0
- package/dist/support/comments/comment-lines.js +47 -0
- package/dist/support/comments/comment-lines.js.map +1 -0
- package/dist/support/comments/is-commented-out-code.d.ts +6 -0
- package/dist/support/comments/is-commented-out-code.d.ts.map +1 -0
- package/dist/support/comments/is-commented-out-code.js +108 -0
- package/dist/support/comments/is-commented-out-code.js.map +1 -0
- package/dist/support/comments/is-directive.d.ts +3 -0
- package/dist/support/comments/is-directive.d.ts.map +1 -0
- package/dist/support/comments/is-directive.js +6 -0
- package/dist/support/comments/is-directive.js.map +1 -0
- package/dist/support/comments/is-fragment.d.ts +3 -0
- package/dist/support/comments/is-fragment.d.ts.map +1 -0
- package/dist/support/comments/is-fragment.js +18 -0
- package/dist/support/comments/is-fragment.js.map +1 -0
- package/dist/support/comments/is-jsdoc.d.ts +3 -0
- package/dist/support/comments/is-jsdoc.d.ts.map +1 -0
- package/dist/support/comments/is-jsdoc.js +5 -0
- package/dist/support/comments/is-jsdoc.js.map +1 -0
- package/dist/support/comments/prose-opening.d.ts +3 -0
- package/dist/support/comments/prose-opening.d.ts.map +1 -0
- package/dist/support/comments/prose-opening.js +3 -0
- package/dist/support/comments/prose-opening.js.map +1 -0
- package/dist/support/comments/reads-as-prose.d.ts +3 -0
- package/dist/support/comments/reads-as-prose.d.ts.map +1 -0
- package/dist/support/comments/reads-as-prose.js +7 -0
- package/dist/support/comments/reads-as-prose.js.map +1 -0
- package/dist/support/declarations/access-decorators.d.ts +3 -0
- package/dist/support/declarations/access-decorators.d.ts.map +1 -0
- package/dist/support/declarations/access-decorators.js +3 -0
- package/dist/support/declarations/access-decorators.js.map +1 -0
- package/dist/support/declarations/declaration-reader.d.ts +19 -0
- package/dist/support/declarations/declaration-reader.d.ts.map +1 -0
- package/dist/support/declarations/declaration-reader.js +46 -0
- package/dist/support/declarations/declaration-reader.js.map +1 -0
- package/dist/support/declarations/declared-role-of.d.ts +5 -0
- package/dist/support/declarations/declared-role-of.d.ts.map +1 -0
- package/dist/support/declarations/declared-role-of.js +12 -0
- package/dist/support/declarations/declared-role-of.js.map +1 -0
- package/dist/support/declarations/declared-role.d.ts +9 -0
- package/dist/support/declarations/declared-role.d.ts.map +1 -0
- package/dist/support/declarations/declared-role.js +2 -0
- package/dist/support/declarations/declared-role.js.map +1 -0
- package/dist/support/declarations/declared-roles.d.ts +4 -0
- package/dist/support/declarations/declared-roles.d.ts.map +1 -0
- package/dist/support/declarations/declared-roles.js +20 -0
- package/dist/support/declarations/declared-roles.js.map +1 -0
- package/dist/support/declarations/is-declared-style.d.ts +3 -0
- package/dist/support/declarations/is-declared-style.d.ts.map +1 -0
- package/dist/support/declarations/is-declared-style.js +4 -0
- package/dist/support/declarations/is-declared-style.js.map +1 -0
- package/dist/support/declarations/written-name.d.ts +11 -0
- package/dist/support/declarations/written-name.d.ts.map +1 -0
- package/dist/support/declarations/written-name.js +22 -0
- package/dist/support/declarations/written-name.js.map +1 -0
- package/dist/support/declarations/written-names.d.ts +3 -0
- package/dist/support/declarations/written-names.d.ts.map +1 -0
- package/dist/support/declarations/written-names.js +7 -0
- package/dist/support/declarations/written-names.js.map +1 -0
- package/dist/support/descendants.d.ts +4 -0
- package/dist/support/descendants.d.ts.map +1 -0
- package/dist/support/descendants.js +21 -0
- package/dist/support/descendants.js.map +1 -0
- package/dist/support/exports/derived-forms-of.d.ts +8 -0
- package/dist/support/exports/derived-forms-of.d.ts.map +1 -0
- package/dist/support/exports/derived-forms-of.js +23 -0
- package/dist/support/exports/derived-forms-of.js.map +1 -0
- package/dist/support/exports/explain-exports.d.ts +11 -0
- package/dist/support/exports/explain-exports.d.ts.map +1 -0
- package/dist/support/exports/explain-exports.js +60 -0
- package/dist/support/exports/explain-exports.js.map +1 -0
- package/dist/support/exports/export-explanation.d.ts +9 -0
- package/dist/support/exports/export-explanation.d.ts.map +1 -0
- package/dist/support/exports/export-explanation.js +2 -0
- package/dist/support/exports/export-explanation.js.map +1 -0
- package/dist/support/exports/is-named-after.d.ts +8 -0
- package/dist/support/exports/is-named-after.d.ts.map +1 -0
- package/dist/support/exports/is-named-after.js +16 -0
- package/dist/support/exports/is-named-after.js.map +1 -0
- package/dist/support/exports/module-shape-of.d.ts +4 -0
- package/dist/support/exports/module-shape-of.d.ts.map +1 -0
- package/dist/support/exports/module-shape-of.js +11 -0
- package/dist/support/exports/module-shape-of.js.map +1 -0
- package/dist/support/exports/module-shape.d.ts +10 -0
- package/dist/support/exports/module-shape.d.ts.map +1 -0
- package/dist/support/exports/module-shape.js +2 -0
- package/dist/support/exports/module-shape.js.map +1 -0
- package/dist/support/exports/shares-private-state.d.ts +11 -0
- package/dist/support/exports/shares-private-state.d.ts.map +1 -0
- package/dist/support/exports/shares-private-state.js +36 -0
- package/dist/support/exports/shares-private-state.js.map +1 -0
- package/dist/support/exports/signature-of.d.ts +8 -0
- package/dist/support/exports/signature-of.d.ts.map +1 -0
- package/dist/support/exports/signature-of.js +44 -0
- package/dist/support/exports/signature-of.js.map +1 -0
- package/dist/support/exports/top-level-declaration.d.ts +10 -0
- package/dist/support/exports/top-level-declaration.d.ts.map +1 -0
- package/dist/support/exports/top-level-declaration.js +2 -0
- package/dist/support/exports/top-level-declaration.js.map +1 -0
- package/dist/support/exports/top-level-declarations.d.ts +5 -0
- package/dist/support/exports/top-level-declarations.d.ts.map +1 -0
- package/dist/support/exports/top-level-declarations.js +48 -0
- package/dist/support/exports/top-level-declarations.js.map +1 -0
- package/dist/support/exports/type-closure.d.ts +5 -0
- package/dist/support/exports/type-closure.d.ts.map +1 -0
- package/dist/support/exports/type-closure.js +18 -0
- package/dist/support/exports/type-closure.js.map +1 -0
- package/dist/support/exports/type-family-of.d.ts +8 -0
- package/dist/support/exports/type-family-of.d.ts.map +1 -0
- package/dist/support/exports/type-family-of.js +43 -0
- package/dist/support/exports/type-family-of.js.map +1 -0
- package/dist/support/exports/type-names-in.d.ts +4 -0
- package/dist/support/exports/type-names-in.d.ts.map +1 -0
- package/dist/support/exports/type-names-in.js +21 -0
- package/dist/support/exports/type-names-in.js.map +1 -0
- package/dist/support/functions/code-lines.d.ts +5 -0
- package/dist/support/functions/code-lines.d.ts.map +1 -0
- package/dist/support/functions/code-lines.js +14 -0
- package/dist/support/functions/code-lines.js.map +1 -0
- package/dist/support/functions/described-function.d.ts +11 -0
- package/dist/support/functions/described-function.d.ts.map +1 -0
- package/dist/support/functions/described-function.js +9 -0
- package/dist/support/functions/described-function.js.map +1 -0
- package/dist/support/functions/function-node.d.ts +3 -0
- package/dist/support/functions/function-node.d.ts.map +1 -0
- package/dist/support/functions/function-node.js +2 -0
- package/dist/support/functions/function-node.js.map +1 -0
- package/dist/support/glob-matcher.d.ts +3 -0
- package/dist/support/glob-matcher.d.ts.map +1 -0
- package/dist/support/glob-matcher.js +8 -0
- package/dist/support/glob-matcher.js.map +1 -0
- package/dist/support/globals/ambient-name.d.ts +8 -0
- package/dist/support/globals/ambient-name.d.ts.map +1 -0
- package/dist/support/globals/ambient-name.js +26 -0
- package/dist/support/globals/ambient-name.js.map +1 -0
- package/dist/support/globals/property-name.d.ts +3 -0
- package/dist/support/globals/property-name.d.ts.map +1 -0
- package/dist/support/globals/property-name.js +10 -0
- package/dist/support/globals/property-name.js.map +1 -0
- package/dist/support/hash-private-fix.d.ts +12 -0
- package/dist/support/hash-private-fix.d.ts.map +1 -0
- package/dist/support/hash-private-fix.js +52 -0
- package/dist/support/hash-private-fix.js.map +1 -0
- package/dist/support/imports/describe-target.d.ts +3 -0
- package/dist/support/imports/describe-target.d.ts.map +1 -0
- package/dist/support/imports/describe-target.js +11 -0
- package/dist/support/imports/describe-target.js.map +1 -0
- package/dist/support/imports/import-listener.d.ts +23 -0
- package/dist/support/imports/import-listener.d.ts.map +1 -0
- package/dist/support/imports/import-listener.js +43 -0
- package/dist/support/imports/import-listener.js.map +1 -0
- package/dist/support/imports/in-context.d.ts +4 -0
- package/dist/support/imports/in-context.d.ts.map +1 -0
- package/dist/support/imports/in-context.js +4 -0
- package/dist/support/imports/in-context.js.map +1 -0
- package/dist/support/imports/in-layer.d.ts +5 -0
- package/dist/support/imports/in-layer.d.ts.map +1 -0
- package/dist/support/imports/in-layer.js +4 -0
- package/dist/support/imports/in-layer.js.map +1 -0
- package/dist/support/imports/in-source-root.d.ts +4 -0
- package/dist/support/imports/in-source-root.d.ts.map +1 -0
- package/dist/support/imports/in-source-root.js +5 -0
- package/dist/support/imports/in-source-root.js.map +1 -0
- package/dist/support/imports/inner-layer.d.ts +4 -0
- package/dist/support/imports/inner-layer.d.ts.map +1 -0
- package/dist/support/imports/inner-layer.js +9 -0
- package/dist/support/imports/inner-layer.js.map +1 -0
- package/dist/support/imports/static-string.d.ts +3 -0
- package/dist/support/imports/static-string.d.ts.map +1 -0
- package/dist/support/imports/static-string.js +11 -0
- package/dist/support/imports/static-string.js.map +1 -0
- package/dist/support/kebab-case.d.ts +7 -0
- package/dist/support/kebab-case.d.ts.map +1 -0
- package/dist/support/kebab-case.js +13 -0
- package/dist/support/kebab-case.js.map +1 -0
- package/dist/support/members/parameter-name.d.ts +3 -0
- package/dist/support/members/parameter-name.d.ts.map +1 -0
- package/dist/support/members/parameter-name.js +7 -0
- package/dist/support/members/parameter-name.js.map +1 -0
- package/dist/support/members/parameter-properties.d.ts +4 -0
- package/dist/support/members/parameter-properties.d.ts.map +1 -0
- package/dist/support/members/parameter-properties.js +6 -0
- package/dist/support/members/parameter-properties.js.map +1 -0
- package/dist/support/members/starts-at-this.d.ts +4 -0
- package/dist/support/members/starts-at-this.d.ts.map +1 -0
- package/dist/support/members/starts-at-this.js +10 -0
- package/dist/support/members/starts-at-this.js.map +1 -0
- package/dist/support/outside-concerns/outside-concern-message.d.ts +3 -0
- package/dist/support/outside-concerns/outside-concern-message.d.ts.map +1 -0
- package/dist/support/outside-concerns/outside-concern-message.js +3 -0
- package/dist/support/outside-concerns/outside-concern-message.js.map +1 -0
- package/dist/support/outside-concerns/outside-concern.d.ts +13 -0
- package/dist/support/outside-concerns/outside-concern.d.ts.map +1 -0
- package/dist/support/outside-concerns/outside-concern.js +31 -0
- package/dist/support/outside-concerns/outside-concern.js.map +1 -0
- package/dist/support/ports/binding-call-reader.d.ts +10 -0
- package/dist/support/ports/binding-call-reader.d.ts.map +1 -0
- package/dist/support/ports/binding-call-reader.js +25 -0
- package/dist/support/ports/binding-call-reader.js.map +1 -0
- package/dist/support/ports/dependency-list-listener.d.ts +10 -0
- package/dist/support/ports/dependency-list-listener.d.ts.map +1 -0
- package/dist/support/ports/dependency-list-listener.js +37 -0
- package/dist/support/ports/dependency-list-listener.js.map +1 -0
- package/dist/support/ports/imported-binding.d.ts +11 -0
- package/dist/support/ports/imported-binding.d.ts.map +1 -0
- package/dist/support/ports/imported-binding.js +2 -0
- package/dist/support/ports/imported-binding.js.map +1 -0
- package/dist/support/ports/imported-bindings.d.ts +6 -0
- package/dist/support/ports/imported-bindings.d.ts.map +1 -0
- package/dist/support/ports/imported-bindings.js +19 -0
- package/dist/support/ports/imported-bindings.js.map +1 -0
- package/dist/support/ports/is-port-file.d.ts +4 -0
- package/dist/support/ports/is-port-file.d.ts.map +1 -0
- package/dist/support/ports/is-port-file.js +13 -0
- package/dist/support/ports/is-port-file.js.map +1 -0
- package/dist/support/purity-rule.d.ts +19 -0
- package/dist/support/purity-rule.d.ts.map +1 -0
- package/dist/support/purity-rule.js +74 -0
- package/dist/support/purity-rule.js.map +1 -0
- package/dist/support/rule/define-rule.d.ts +30 -0
- package/dist/support/rule/define-rule.d.ts.map +1 -0
- package/dist/support/rule/define-rule.js +51 -0
- package/dist/support/rule/define-rule.js.map +1 -0
- package/dist/support/rule/docs-of.d.ts +6 -0
- package/dist/support/rule/docs-of.d.ts.map +1 -0
- package/dist/support/rule/docs-of.js +9 -0
- package/dist/support/rule/docs-of.js.map +1 -0
- package/dist/support/rule/rule-docs.d.ts +9 -0
- package/dist/support/rule/rule-docs.d.ts.map +1 -0
- package/dist/support/rule/rule-docs.js +2 -0
- package/dist/support/rule/rule-docs.js.map +1 -0
- package/dist/support/scheduling/is-job-file.d.ts +4 -0
- package/dist/support/scheduling/is-job-file.d.ts.map +1 -0
- package/dist/support/scheduling/is-job-file.js +11 -0
- package/dist/support/scheduling/is-job-file.js.map +1 -0
- package/dist/support/scheduling/registered-job.d.ts +11 -0
- package/dist/support/scheduling/registered-job.d.ts.map +1 -0
- package/dist/support/scheduling/registered-job.js +17 -0
- package/dist/support/scheduling/registered-job.js.map +1 -0
- package/dist/support/standard-interfaces/boundary-names.d.ts +3 -0
- package/dist/support/standard-interfaces/boundary-names.d.ts.map +1 -0
- package/dist/support/standard-interfaces/boundary-names.js +3 -0
- package/dist/support/standard-interfaces/boundary-names.js.map +1 -0
- package/dist/support/standard-interfaces/parallel-names.d.ts +4 -0
- package/dist/support/standard-interfaces/parallel-names.d.ts.map +1 -0
- package/dist/support/standard-interfaces/parallel-names.js +76 -0
- package/dist/support/standard-interfaces/parallel-names.js.map +1 -0
- package/dist/support/standard-interfaces/standard-names-in.d.ts +3 -0
- package/dist/support/standard-interfaces/standard-names-in.d.ts.map +1 -0
- package/dist/support/standard-interfaces/standard-names-in.js +5 -0
- package/dist/support/standard-interfaces/standard-names-in.js.map +1 -0
- package/dist/support/stepdown/call-graph.d.ts +8 -0
- package/dist/support/stepdown/call-graph.d.ts.map +1 -0
- package/dist/support/stepdown/call-graph.js +27 -0
- package/dist/support/stepdown/call-graph.js.map +1 -0
- package/dist/support/stepdown/member-use.d.ts +7 -0
- package/dist/support/stepdown/member-use.d.ts.map +1 -0
- package/dist/support/stepdown/member-use.js +2 -0
- package/dist/support/stepdown/member-use.js.map +1 -0
- package/dist/support/stepdown/member-uses.d.ts +9 -0
- package/dist/support/stepdown/member-uses.d.ts.map +1 -0
- package/dist/support/stepdown/member-uses.js +27 -0
- package/dist/support/stepdown/member-uses.js.map +1 -0
- package/dist/support/stepdown/misplaced-functions.d.ts +11 -0
- package/dist/support/stepdown/misplaced-functions.d.ts.map +1 -0
- package/dist/support/stepdown/misplaced-functions.js +80 -0
- package/dist/support/stepdown/misplaced-functions.js.map +1 -0
- package/dist/support/stepdown/misplaced-members.d.ts +10 -0
- package/dist/support/stepdown/misplaced-members.d.ts.map +1 -0
- package/dist/support/stepdown/misplaced-members.js +73 -0
- package/dist/support/stepdown/misplaced-members.js.map +1 -0
- package/dist/support/suppressions/shares-line-with-code.d.ts +3 -0
- package/dist/support/suppressions/shares-line-with-code.d.ts.map +1 -0
- package/dist/support/suppressions/shares-line-with-code.js +5 -0
- package/dist/support/suppressions/shares-line-with-code.js.map +1 -0
- package/dist/support/suppressions/suppressed-lines.d.ts +4 -0
- package/dist/support/suppressions/suppressed-lines.d.ts.map +1 -0
- package/dist/support/suppressions/suppressed-lines.js +17 -0
- package/dist/support/suppressions/suppressed-lines.js.map +1 -0
- package/dist/support/types/declared-type-name.d.ts +6 -0
- package/dist/support/types/declared-type-name.d.ts.map +1 -0
- package/dist/support/types/declared-type-name.js +33 -0
- package/dist/support/types/declared-type-name.js.map +1 -0
- package/dist/support/types/parameter-binding.d.ts +4 -0
- package/dist/support/types/parameter-binding.d.ts.map +1 -0
- package/dist/support/types/parameter-binding.js +7 -0
- package/dist/support/types/parameter-binding.js.map +1 -0
- package/dist/support/types/parameter-type-name.d.ts +3 -0
- package/dist/support/types/parameter-type-name.d.ts.map +1 -0
- package/dist/support/types/parameter-type-name.js +6 -0
- package/dist/support/types/parameter-type-name.js.map +1 -0
- package/dist/support/types/type-reference-name.d.ts +4 -0
- package/dist/support/types/type-reference-name.d.ts.map +1 -0
- package/dist/support/types/type-reference-name.js +14 -0
- package/dist/support/types/type-reference-name.js.map +1 -0
- package/dist/support/words/same-word.d.ts +3 -0
- package/dist/support/words/same-word.d.ts.map +1 -0
- package/dist/support/words/same-word.js +75 -0
- package/dist/support/words/same-word.js.map +1 -0
- package/dist/support/words/split-words.d.ts +3 -0
- package/dist/support/words/split-words.d.ts.map +1 -0
- package/dist/support/words/split-words.js +12 -0
- package/dist/support/words/split-words.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/docs/rules/application-command-query-separation.md +54 -0
- package/docs/rules/application-handler-shape.md +52 -0
- package/docs/rules/aspects-outside-in.md +54 -0
- package/docs/rules/authz-actor-explicit.md +70 -0
- package/docs/rules/authz-declared.md +87 -0
- package/docs/rules/authz-in-application.md +88 -0
- package/docs/rules/clean-blank-lines.md +87 -0
- package/docs/rules/clean-braces.md +61 -0
- package/docs/rules/clean-file-size.md +43 -0
- package/docs/rules/clean-formatted.md +32 -0
- package/docs/rules/clean-function-ceiling.md +53 -0
- package/docs/rules/clean-function-size.md +45 -0
- package/docs/rules/clean-no-commented-out-code.md +48 -0
- package/docs/rules/clean-no-escape-hatch.md +80 -0
- package/docs/rules/clean-no-flag-argument.md +50 -0
- package/docs/rules/clean-no-hash-private.md +63 -0
- package/docs/rules/clean-no-noise-comment.md +55 -0
- package/docs/rules/clean-one-export-per-file.md +88 -0
- package/docs/rules/clean-stepdown.md +60 -0
- package/docs/rules/context-declared-relationship.md +49 -0
- package/docs/rules/context-extractable.md +109 -0
- package/docs/rules/context-published-language-is-a-contract.md +47 -0
- package/docs/rules/context-published-language-only.md +47 -0
- package/docs/rules/declarations-role-declared.md +109 -0
- package/docs/rules/domain-aggregate-encapsulation.md +63 -0
- package/docs/rules/domain-events-dispatched-on-save.md +83 -0
- package/docs/rules/domain-events-transactional-before-commit.md +92 -0
- package/docs/rules/domain-no-generic-error.md +40 -0
- package/docs/rules/domain-value-object-immutability.md +52 -0
- package/docs/rules/events-consumer-idempotent.md +68 -0
- package/docs/rules/events-name-format.md +50 -0
- package/docs/rules/events-outbox-required.md +57 -0
- package/docs/rules/governance-recorded-deviation.md +55 -0
- package/docs/rules/imports-alias-only.md +73 -0
- package/docs/rules/layer-application-inward.md +62 -0
- package/docs/rules/layer-domain-purity.md +60 -0
- package/docs/rules/layer-infrastructure-no-presentation.md +46 -0
- package/docs/rules/layer-presentation-no-infrastructure.md +46 -0
- package/docs/rules/ports-abstract-class.md +70 -0
- package/docs/rules/ports-implements-never-extends.md +53 -0
- package/docs/rules/ports-no-concrete-dependency.md +52 -0
- package/docs/rules/ports-no-token-constant.md +57 -0
- package/docs/rules/ports-value-import.md +55 -0
- package/docs/rules/purity-no-ambient-randomness.md +43 -0
- package/docs/rules/purity-no-environment.md +45 -0
- package/docs/rules/purity-no-system-clock.md +49 -0
- package/docs/rules/scheduling-job-name.md +57 -0
- package/docs/rules/scheduling-job-triggers-use-case.md +71 -0
- package/docs/rules/standard-no-parallel-interface.md +95 -0
- package/docs/rules/test-no-mocks.md +47 -0
- package/docs/rules/tracing-platform-only.md +65 -0
- package/package.json +56 -4
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# ddd-ts-kit/ports-no-concrete-dependency
|
|
2
|
+
|
|
3
|
+
Architecture id: `ports/no-concrete-dependency`. Default severity: `error` in `recommended`, `error` in `strict`.
|
|
4
|
+
|
|
5
|
+
Applies to: every linted file.
|
|
6
|
+
|
|
7
|
+
## Why
|
|
8
|
+
|
|
9
|
+
A dependency list names ports, never what implements them. A handler that lists `KnexInvoiceRepository` is wired to one technology, cannot be given a fake, and makes the application layer depend on infrastructure through its own registration.
|
|
10
|
+
|
|
11
|
+
## Reported
|
|
12
|
+
|
|
13
|
+
- a class named in a dependency list and imported from `infrastructure/` of a context
|
|
14
|
+
- a class named in a dependency list and imported from `test/fakes/` of a context
|
|
15
|
+
|
|
16
|
+
Incorrect:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { KnexInvoiceRepository } from '@/contexts/billing/infrastructure/persistence/knex-invoice.repository.js';
|
|
20
|
+
|
|
21
|
+
@CommandHandler(IssueInvoiceCommand, [KnexInvoiceRepository, Clock])
|
|
22
|
+
export class IssueInvoiceHandler {}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Correct:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { InvoiceRepository } from '@/contexts/billing/domain/repositories/invoice.repository.js';
|
|
29
|
+
|
|
30
|
+
@CommandHandler(IssueInvoiceCommand, [InvoiceRepository, Clock])
|
|
31
|
+
export class IssueInvoiceHandler {}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Details
|
|
35
|
+
|
|
36
|
+
A dependency list is the array that names what a constructor receives: the last argument of a declaration decorator of `@ddd-ts-kit/kernel/declarations` (`@CommandHandler(M, [..])`, `@QueryHandler`, `@IntegrationEventHandler`, `@DomainEventHandler`, `@Scheduled`, `@Repository`, `@Gateway`, `@Adapter`, `@Policy`) and the second argument of `.toClass(C, [..])` and `.handledBy(H, [..])` of `@ddd-ts-kit/di`.
|
|
37
|
+
|
|
38
|
+
The first argument of `toClass` and `handledBy` is the implementation and is not part of the list: `builder.bind(InvoiceRepository).toClass(KnexInvoiceRepository, [Database])` is how a module says which class stands behind a port. The origin of a name is read from its import, through relative paths and the configured `importAlias`.
|
|
39
|
+
|
|
40
|
+
## Options
|
|
41
|
+
|
|
42
|
+
None.
|
|
43
|
+
|
|
44
|
+
`rules."ports/no-concrete-dependency"` in `ddd-ts-kit.config.json` set to `off` silences the rule, and `// ddd-ts-kit-disable-next-line ports/no-concrete-dependency -- <reason>` silences one line, exactly as for `ddd-ts-kit check`.
|
|
45
|
+
|
|
46
|
+
## Limits
|
|
47
|
+
|
|
48
|
+
- A concrete class declared in the same file, or reached through a barrel outside `infrastructure/`, is not seen: the compiler refuses a concrete class where its port is expected.
|
|
49
|
+
|
|
50
|
+
## With the CLI checker
|
|
51
|
+
|
|
52
|
+
`ddd-ts-kit check` reports the same id from the text of the files. This rule is the authority for the code.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# ddd-ts-kit/ports-no-token-constant
|
|
2
|
+
|
|
3
|
+
Architecture id: `ports/no-token-constant`. Default severity: `error` in `recommended`, `error` in `strict`.
|
|
4
|
+
|
|
5
|
+
Applies to: every linted file.
|
|
6
|
+
|
|
7
|
+
## Why
|
|
8
|
+
|
|
9
|
+
A port class is its own injection token. A constant next to it, a `token(..)` helper, a symbol or a string is a second name for the same thing: it has to be kept in step by hand, it loses the type, and it hides the dependency list from the compiler.
|
|
10
|
+
|
|
11
|
+
## Reported
|
|
12
|
+
|
|
13
|
+
- a call of `token`, imported from a package of the kit (`@ddd-ts-kit/*`), by name, by alias or through a namespace
|
|
14
|
+
- `Symbol(..)`, `Symbol.for(..)` or a string literal given as first argument of a binding call, and a variable declared as such a symbol given to one
|
|
15
|
+
- an identifier in upper snake case (two characters at least) in a dependency list
|
|
16
|
+
- a file named `*.ports.ts` or `tokens.ts` under the source root, reported on its first line
|
|
17
|
+
|
|
18
|
+
Incorrect:
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
// a constant that stands for the port, in a file that collects them
|
|
22
|
+
export const invoiceRepositoryToken = Symbol('billing.InvoiceRepository');
|
|
23
|
+
|
|
24
|
+
builder.bind(invoiceRepositoryToken).toClass(KnexInvoiceRepository, [Database]);
|
|
25
|
+
builder.bind('clock').toValue(clock);
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Correct:
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
// domain/repositories/invoice.repository.ts
|
|
32
|
+
export abstract class InvoiceRepository extends Repository<Invoice> {}
|
|
33
|
+
|
|
34
|
+
builder.bind(InvoiceRepository).toClass(KnexInvoiceRepository, [Database]);
|
|
35
|
+
builder.bind(Clock).toValue(clock);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Details
|
|
39
|
+
|
|
40
|
+
A dependency list is the array that names what a constructor receives: the last argument of a declaration decorator of `@ddd-ts-kit/kernel/declarations` (`@CommandHandler(M, [..])`, `@QueryHandler`, `@IntegrationEventHandler`, `@DomainEventHandler`, `@Scheduled`, `@Repository`, `@Gateway`, `@Adapter`, `@Policy`) and the second argument of `.toClass(C, [..])` and `.handledBy(H, [..])` of `@ddd-ts-kit/di`.
|
|
41
|
+
|
|
42
|
+
A binding call is `bind`, `rebind`, `resolve`, `fake` or `override`, plain or as a member (`builder.bind(X)`, `app.resolve(X)`), and is read only in a file that imports something from `@ddd-ts-kit/di`; `Promise.resolve`, `path.resolve`, `require.resolve` and `import.meta.resolve` are never binding calls.
|
|
43
|
+
|
|
44
|
+
## Options
|
|
45
|
+
|
|
46
|
+
None.
|
|
47
|
+
|
|
48
|
+
`rules."ports/no-token-constant"` in `ddd-ts-kit.config.json` set to `off` silences the rule, and `// ddd-ts-kit-disable-next-line ports/no-token-constant -- <reason>` silences one line, exactly as for `ddd-ts-kit check`.
|
|
49
|
+
|
|
50
|
+
## Limits
|
|
51
|
+
|
|
52
|
+
- A token made by a home-made helper, or a symbol declared in another file, is not followed.
|
|
53
|
+
- An upper snake case name is reported in a dependency list only: a constant of the domain anywhere else is not a token.
|
|
54
|
+
|
|
55
|
+
## With the CLI checker
|
|
56
|
+
|
|
57
|
+
`ddd-ts-kit check` reports the same id from the text of the files. This rule is the authority for the code.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# ddd-ts-kit/ports-value-import
|
|
2
|
+
|
|
3
|
+
Architecture id: `ports/value-import`. Default severity: `error` in `recommended`, `error` in `strict`. Fixable with `--fix`.
|
|
4
|
+
|
|
5
|
+
Applies to: every linted file.
|
|
6
|
+
|
|
7
|
+
## Why
|
|
8
|
+
|
|
9
|
+
The abstract class of a port is a value: it is what a container binds and resolves. `import type` erases it when the file is compiled, so a dependency list that names a type-only import has nothing to name at run time.
|
|
10
|
+
|
|
11
|
+
## Reported
|
|
12
|
+
|
|
13
|
+
- a name in a dependency list imported with `import type { X }` or `import { type X }`
|
|
14
|
+
- the first argument of `bind` or `rebind` imported that way
|
|
15
|
+
|
|
16
|
+
Incorrect:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import type { Clock } from '@ddd-ts-kit/kernel';
|
|
20
|
+
|
|
21
|
+
@CommandHandler(IssueInvoiceCommand, [Clock])
|
|
22
|
+
export class IssueInvoiceHandler {}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Correct:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { Clock } from '@ddd-ts-kit/kernel';
|
|
29
|
+
|
|
30
|
+
@CommandHandler(IssueInvoiceCommand, [Clock])
|
|
31
|
+
export class IssueInvoiceHandler {}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Details
|
|
35
|
+
|
|
36
|
+
A dependency list is the array that names what a constructor receives: the last argument of a declaration decorator of `@ddd-ts-kit/kernel/declarations` (`@CommandHandler(M, [..])`, `@QueryHandler`, `@IntegrationEventHandler`, `@DomainEventHandler`, `@Scheduled`, `@Repository`, `@Gateway`, `@Adapter`, `@Policy`) and the second argument of `.toClass(C, [..])` and `.handledBy(H, [..])` of `@ddd-ts-kit/di`.
|
|
37
|
+
|
|
38
|
+
A binding call is `bind`, `rebind`, `resolve`, `fake` or `override`, plain or as a member (`builder.bind(X)`, `app.resolve(X)`), and is read only in a file that imports something from `@ddd-ts-kit/di`; `Promise.resolve`, `path.resolve`, `require.resolve` and `import.meta.resolve` are never binding calls. Only `bind` and `rebind` are read by this rule.
|
|
39
|
+
|
|
40
|
+
**The fix.** `import { type X }` loses its keyword; `import type { X, Y }` becomes `import { X, type Y }`, which `@typescript-eslint/consistent-type-imports` then splits if the project asks for separate type imports.
|
|
41
|
+
|
|
42
|
+
## Options
|
|
43
|
+
|
|
44
|
+
None.
|
|
45
|
+
|
|
46
|
+
`rules."ports/value-import"` in `ddd-ts-kit.config.json` set to `off` silences the rule, and `// ddd-ts-kit-disable-next-line ports/value-import -- <reason>` silences one line, exactly as for `ddd-ts-kit check`.
|
|
47
|
+
|
|
48
|
+
## Limits
|
|
49
|
+
|
|
50
|
+
- The compiler reports the same mistake (a type used as a value) when the file is type-checked; this rule reports it at edit time and fixes it.
|
|
51
|
+
- A default or a namespace import is not rewritten by the fix when the declaration is `import type`.
|
|
52
|
+
|
|
53
|
+
## With the CLI checker
|
|
54
|
+
|
|
55
|
+
`ddd-ts-kit check` reports the same id from the text of the file. This rule is the authority, and the only one that fixes.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# ddd-ts-kit/purity-no-ambient-randomness
|
|
2
|
+
|
|
3
|
+
Architecture id: `purity/no-ambient-randomness`. Default severity: `error` in `recommended`, `error` in `strict`.
|
|
4
|
+
|
|
5
|
+
Applies to: `domain/` and `application/` of a context, tests excluded.
|
|
6
|
+
|
|
7
|
+
## Why
|
|
8
|
+
|
|
9
|
+
An identifier drawn inside a rule cannot be predicted by a test nor replayed. Identifiers come from the `IdGenerator` port.
|
|
10
|
+
|
|
11
|
+
## Reported
|
|
12
|
+
|
|
13
|
+
- `Math.random`
|
|
14
|
+
- `crypto.randomUUID`, `getRandomValues`, `randomBytes`, `randomInt`, also imported by name from `node:crypto`
|
|
15
|
+
- an import of `uuid`, `nanoid`, `ulid`, `ulidx`, `cuid`, `@paralleldrive/cuid2`, `ksuid`, `shortid`, `uuidv7`, `hyperid`, `bson`
|
|
16
|
+
|
|
17
|
+
Incorrect:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { v4 } from 'uuid';
|
|
21
|
+
const id = crypto.randomUUID();
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Correct:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
const invoice = Invoice.create(this.ids.next(), this.clock.now());
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Options
|
|
31
|
+
|
|
32
|
+
None.
|
|
33
|
+
|
|
34
|
+
`rules."purity/no-ambient-randomness"` in `ddd-ts-kit.config.json` set to `off` silences the rule, and `// ddd-ts-kit-disable-next-line purity/no-ambient-randomness -- <reason>` silences one line, exactly as for `ddd-ts-kit check`.
|
|
35
|
+
|
|
36
|
+
## Limits
|
|
37
|
+
|
|
38
|
+
- A wrapper around the forbidden access (a helper of the platform that calls `Date.now()`) is not seen here; the layer rules stop the import of that helper.
|
|
39
|
+
- A local declaration that shadows the global (`const process = ...`) is not reported.
|
|
40
|
+
|
|
41
|
+
## With the CLI checker
|
|
42
|
+
|
|
43
|
+
`ddd-ts-kit check` looks for the same names with regular expressions. This rule is the authority: it knows a shadowed name from the global, and code from a string.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# ddd-ts-kit/purity-no-environment
|
|
2
|
+
|
|
3
|
+
Architecture id: `purity/no-environment`. Default severity: `error` in `recommended`, `error` in `strict`.
|
|
4
|
+
|
|
5
|
+
Applies to: `domain/` and `application/` of a context, tests excluded.
|
|
6
|
+
|
|
7
|
+
## Why
|
|
8
|
+
|
|
9
|
+
Configuration, logs, files and the network are the outside world. Reached directly they make a use case depend on the machine it runs on; behind a port they are a parameter.
|
|
10
|
+
|
|
11
|
+
## Reported
|
|
12
|
+
|
|
13
|
+
- `process.env`, `argv`, `cwd`, `exit`, `stdout`, `stderr`, `stdin`
|
|
14
|
+
- any member of `console`
|
|
15
|
+
- a call of the global `fetch`, `new XMLHttpRequest`, `new WebSocket`, `new EventSource`
|
|
16
|
+
- an import of `fs`, `http`, `https`, `http2`, `net`, `dgram`, `dns`, `tls`, `child_process`, `worker_threads`, `os`, `readline`, `axios`, `node-fetch`, `undici`, `got`, `dotenv`
|
|
17
|
+
|
|
18
|
+
Incorrect:
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
const url = process.env['PAYMENT_URL'];
|
|
22
|
+
console.log('charging', amount);
|
|
23
|
+
await fetch(url);
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Correct:
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
await this.paymentGateway.charge(amount);
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Options
|
|
33
|
+
|
|
34
|
+
None.
|
|
35
|
+
|
|
36
|
+
`rules."purity/no-environment"` in `ddd-ts-kit.config.json` set to `off` silences the rule, and `// ddd-ts-kit-disable-next-line purity/no-environment -- <reason>` silences one line, exactly as for `ddd-ts-kit check`.
|
|
37
|
+
|
|
38
|
+
## Limits
|
|
39
|
+
|
|
40
|
+
- A wrapper around the forbidden access (a helper of the platform that calls `Date.now()`) is not seen here; the layer rules stop the import of that helper.
|
|
41
|
+
- A local declaration that shadows the global (`const process = ...`) is not reported.
|
|
42
|
+
|
|
43
|
+
## With the CLI checker
|
|
44
|
+
|
|
45
|
+
`ddd-ts-kit check` looks for the same names with regular expressions. This rule is the authority: it knows a shadowed name from the global, and code from a string.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# ddd-ts-kit/purity-no-system-clock
|
|
2
|
+
|
|
3
|
+
Architecture id: `purity/no-system-clock`. Default severity: `error` in `recommended`, `error` in `strict`.
|
|
4
|
+
|
|
5
|
+
Applies to: `domain/` and `application/` of a context, tests excluded.
|
|
6
|
+
|
|
7
|
+
## Why
|
|
8
|
+
|
|
9
|
+
A rule that reads the clock gives a different answer at every run. Time is an input: the domain receives it, the application takes it from the `Clock` port, a test fixes it with `FixedClock`.
|
|
10
|
+
|
|
11
|
+
## Reported
|
|
12
|
+
|
|
13
|
+
- `new Date()` without argument
|
|
14
|
+
- `Date.now`, `Date()`
|
|
15
|
+
- `performance.now`, `performance.timeOrigin`
|
|
16
|
+
- the same through `globalThis`, `window`, `self` or `global`
|
|
17
|
+
|
|
18
|
+
Incorrect:
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
const overdue = invoice.dueAt < new Date();
|
|
22
|
+
const started = Date.now();
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Correct:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
const overdue = invoice.isOverdue(this.clock.now());
|
|
29
|
+
const due = new Date(issuedAt.getTime() + 30 * DAY);
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Details
|
|
33
|
+
|
|
34
|
+
`new Date(value)` builds a date from data and is allowed.
|
|
35
|
+
|
|
36
|
+
## Options
|
|
37
|
+
|
|
38
|
+
None.
|
|
39
|
+
|
|
40
|
+
`rules."purity/no-system-clock"` in `ddd-ts-kit.config.json` set to `off` silences the rule, and `// ddd-ts-kit-disable-next-line purity/no-system-clock -- <reason>` silences one line, exactly as for `ddd-ts-kit check`.
|
|
41
|
+
|
|
42
|
+
## Limits
|
|
43
|
+
|
|
44
|
+
- A wrapper around the forbidden access (a helper of the platform that calls `Date.now()`) is not seen here; the layer rules stop the import of that helper.
|
|
45
|
+
- A local declaration that shadows the global (`const process = ...`) is not reported.
|
|
46
|
+
|
|
47
|
+
## With the CLI checker
|
|
48
|
+
|
|
49
|
+
`ddd-ts-kit check` looks for the same names with regular expressions. This rule is the authority: it knows a shadowed name from the global, and code from a string.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# ddd-ts-kit/scheduling-job-name
|
|
2
|
+
|
|
3
|
+
Architecture id: `scheduling/job-name`. Default severity: `error` in `recommended`, `error` in `strict`.
|
|
4
|
+
|
|
5
|
+
Applies to: every linted file; the `systemActor` check applies to `*.job.ts` files.
|
|
6
|
+
|
|
7
|
+
## Why
|
|
8
|
+
|
|
9
|
+
The name of a job is its identity: the lock that keeps an occurrence to one run, its settings, its metrics, its line in the audit trail are keyed by it. It is written once as a string literal, never derived from a class name that may be renamed, and it starts with the context the job belongs to, so that it leaves with the context when it is extracted.
|
|
10
|
+
|
|
11
|
+
## Reported
|
|
12
|
+
|
|
13
|
+
- a first argument of `@Scheduled(..)` or of `job(..)` (in a statement ending with `handledBy` or `handledByFactory`) that is not a string literal
|
|
14
|
+
- a name that is not `<context>.<job-name>`: two segments in lower-case kebab-case
|
|
15
|
+
- a name whose first segment is not the context of the file (in a module file, the context of the module)
|
|
16
|
+
- in a `*.job.ts` file: a `systemActor(..)` call that does not pass the name the job is declared with
|
|
17
|
+
|
|
18
|
+
Incorrect:
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
@Scheduled('SendReminders', { every: '15m' }, [CommandBus])
|
|
22
|
+
export class SendRemindersJob implements ScheduledJob {
|
|
23
|
+
async run(execution: JobExecution): Promise<void> {
|
|
24
|
+
await this.commands.execute(new SendRemindersCommand(systemActor('reminders'), execution.scheduledAt));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Correct:
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
@Scheduled('billing.send-reminders', { every: '15m' }, [CommandBus])
|
|
33
|
+
export class SendRemindersJob implements ScheduledJob {
|
|
34
|
+
async run(execution: JobExecution): Promise<void> {
|
|
35
|
+
await this.commands.execute(new SendRemindersCommand(systemActor('billing.send-reminders'), execution.scheduledAt));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Details
|
|
41
|
+
|
|
42
|
+
A template literal without substitution counts as a string literal. Outside a context (`main.ts`, the platform) the format is checked and the first segment is free. In a job file without `@Scheduled` (the explicit style, where the name is written in the module file), `systemActor(..)` must pass a literal that is a job name of the context of the file.
|
|
43
|
+
|
|
44
|
+
## Options
|
|
45
|
+
|
|
46
|
+
None.
|
|
47
|
+
|
|
48
|
+
`rules."scheduling/job-name"` in `ddd-ts-kit.config.json` set to `off` silences the rule, and `// ddd-ts-kit-disable-next-line scheduling/job-name -- <reason>` silences one line, exactly as for `ddd-ts-kit check`.
|
|
49
|
+
|
|
50
|
+
## Limits
|
|
51
|
+
|
|
52
|
+
- That a job name is unique in the project is a fact of the project: `ddd-ts-kit check` holds it.
|
|
53
|
+
- In the explicit style the name given to `systemActor` in the job file is not compared with the name written in the module file.
|
|
54
|
+
|
|
55
|
+
## With the CLI checker
|
|
56
|
+
|
|
57
|
+
`ddd-ts-kit check` reports the same id from the text of the files, and is alone to check that a name is unique project-wide.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# ddd-ts-kit/scheduling-job-triggers-use-case
|
|
2
|
+
|
|
3
|
+
Architecture id: `scheduling/job-triggers-use-case`. Default severity: `error` in `recommended`, `error` in `strict`.
|
|
4
|
+
|
|
5
|
+
Applies to: production files of a context.
|
|
6
|
+
|
|
7
|
+
## Why
|
|
8
|
+
|
|
9
|
+
A job is a schedule, not a use case. It sends a command, and the work is in the handler of that command, where it is authorized, transactional, audited and tested like any other use case, and where an operator can also trigger it by hand. A job that loads aggregates and saves them is a use case that escaped all of that.
|
|
10
|
+
|
|
11
|
+
## Reported
|
|
12
|
+
|
|
13
|
+
In `application/scheduling/*.job.ts`:
|
|
14
|
+
|
|
15
|
+
- no exported class implementing `ScheduledJob`
|
|
16
|
+
- a `run` method that calls no `<something>.execute(..)`, or no `run` method
|
|
17
|
+
- a repository (a class imported from `domain/repositories/`) in the dependency list or as the type of a constructor parameter
|
|
18
|
+
- an import from `domain/aggregates/`, `domain/entities/`, `domain/services/` or `infrastructure/`
|
|
19
|
+
|
|
20
|
+
Anywhere else in a context:
|
|
21
|
+
|
|
22
|
+
- a class carrying `@Scheduled`
|
|
23
|
+
- `job(..).handledBy(Class, ..)` naming a class imported from a file that is not `application/scheduling/*.job.ts`
|
|
24
|
+
|
|
25
|
+
Incorrect:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
// application/scheduling/send-reminders.job.ts
|
|
29
|
+
@Scheduled('billing.send-reminders', { every: '15m' }, [InvoiceRepository, Mailer])
|
|
30
|
+
export class SendRemindersJob implements ScheduledJob {
|
|
31
|
+
async run(): Promise<void> {
|
|
32
|
+
for (const invoice of await this.invoices.overdue()) {
|
|
33
|
+
await this.mailer.remind(invoice);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Correct:
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
// application/scheduling/send-reminders.job.ts
|
|
43
|
+
@Scheduled('billing.send-reminders', { every: '15m' }, [CommandBus])
|
|
44
|
+
export class SendRemindersJob implements ScheduledJob {
|
|
45
|
+
constructor(private readonly commands: CommandBus) {}
|
|
46
|
+
|
|
47
|
+
async run(execution: JobExecution): Promise<void> {
|
|
48
|
+
await this.commands.execute(new SendRemindersCommand(systemActor('billing.send-reminders'), execution.scheduledAt));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Details
|
|
54
|
+
|
|
55
|
+
The rule holds in both styles: an explicit-style job is the same class without `@Scheduled`, registered by `builder.job('<context>.<job>', schedule).handledBy(Job, [CommandBus])` in the module file. Value objects, events, errors and the commands of `application/commands/` may be imported by a job. That a job file of a declared-style project carries `@Scheduled` is `declarations/role-declared`.
|
|
56
|
+
|
|
57
|
+
## Options
|
|
58
|
+
|
|
59
|
+
None.
|
|
60
|
+
|
|
61
|
+
`rules."scheduling/job-triggers-use-case"` in `ddd-ts-kit.config.json` set to `off` silences the rule, and `// ddd-ts-kit-disable-next-line scheduling/job-triggers-use-case -- <reason>` silences one line, exactly as for `ddd-ts-kit check`.
|
|
62
|
+
|
|
63
|
+
## Limits
|
|
64
|
+
|
|
65
|
+
- A command sent through a helper of another file (`this.trigger()`) is not seen: call `execute` in `run`.
|
|
66
|
+
- A job registered with `handledByFactory` names no class and is not followed.
|
|
67
|
+
- A class carrying `@Scheduled` outside a context (the platform) is not judged.
|
|
68
|
+
|
|
69
|
+
## With the CLI checker
|
|
70
|
+
|
|
71
|
+
`ddd-ts-kit check` reports the same id from the text of the files. This rule is the authority for the code.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# ddd-ts-kit/standard-no-parallel-interface
|
|
2
|
+
|
|
3
|
+
Architecture id: `standard/no-parallel-interface`. Default severity: `warn` in `recommended`, `error` in `strict`.
|
|
4
|
+
|
|
5
|
+
Applies to: every production file under the source root; tests excluded.
|
|
6
|
+
|
|
7
|
+
## Why
|
|
8
|
+
|
|
9
|
+
The kernel defines the shapes every project shares (`Actor`, `Session`, `ExecutionContext`, `Logger`, `Metrics`, `Cache`, `Page` and `PageRequest`, `AuditStamp`, `Clock`, `IdGenerator`, `UnitOfWork`, `JobScheduler`, `ScheduledJob`, `ErrorReporter`), so that an adapter, a middleware or a dashboard written once fits them all. A home-made `ILogger` or `UserContext` next to them forks the shape: every adapter needs a translation, and the fields of the project never reach the standard log lines, spans and audit entries.
|
|
10
|
+
|
|
11
|
+
## Reported
|
|
12
|
+
|
|
13
|
+
A class, an interface or a type alias declared under one of these names:
|
|
14
|
+
|
|
15
|
+
| Declared name | Use instead |
|
|
16
|
+
|---|---|
|
|
17
|
+
| `ILogger`, `AppLogger`, `LoggerService`, `LoggerInterface` | `Logger` |
|
|
18
|
+
| `IMetrics`, `MetricsService` | `Metrics` |
|
|
19
|
+
| `ICache`, `CacheService` | `Cache` |
|
|
20
|
+
| `UserContext`, `CurrentUser`, `AuthContext`, `RequestContext` (outside `presentation/` and the platform), `IExecutionContext`, `IActor` | `ExecutionContext` or `Actor` |
|
|
21
|
+
| `UserSession`, `AuthSession`, `SessionData`, `ISession` | `Session` |
|
|
22
|
+
| `PaginatedResult`, `PageResult`, `PaginatedResponse`, `Paginated`, `IPage` | `Page` |
|
|
23
|
+
| `PaginationParams`, `PageParams`, `IPageRequest` | `PageRequest` |
|
|
24
|
+
| `AuditLog`, `AuditLogEntry`, `AuditRecord`, `IAuditEntry` | `AuditEntry` of `@ddd-ts-kit/audit` (`AuditStamp`, also `IAuditStamp`, for audit columns) |
|
|
25
|
+
| `IClock`, `IIdGenerator`, `IUnitOfWork` | `Clock`, `IdGenerator`, `UnitOfWork` |
|
|
26
|
+
| `IJobScheduler`, `JobSchedulerService`, `CronScheduler`, `TaskScheduler` | `JobScheduler` |
|
|
27
|
+
| `IScheduledJob`, `CronJob`, `ScheduledTask`, `BackgroundJob` | `ScheduledJob` |
|
|
28
|
+
| `IErrorReporter`, `ErrorReporterService`, `ErrorTracker`, `ExceptionReporter`, `CrashReporter` | `ErrorReporter` |
|
|
29
|
+
|
|
30
|
+
Incorrect:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
// src/contexts/billing/application/ports/logger.port.ts
|
|
34
|
+
export interface ILogger {
|
|
35
|
+
info(message: string): void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// src/shared-kernel/user-context.ts
|
|
39
|
+
export interface UserContext {
|
|
40
|
+
userId: string;
|
|
41
|
+
tenantId: string;
|
|
42
|
+
plan: string;
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Correct:
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import type { ExecutionContext, Logger } from '@ddd-ts-kit/kernel';
|
|
50
|
+
|
|
51
|
+
// src/platform/kernel-extensions.ts
|
|
52
|
+
declare module '@ddd-ts-kit/kernel' {
|
|
53
|
+
interface ExecutionContextExtensions {
|
|
54
|
+
plan: string;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// src/contexts/billing/infrastructure/external/pino.logger.ts
|
|
59
|
+
export class PinoLogger implements Logger {}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Details
|
|
63
|
+
|
|
64
|
+
The match is the whole declared name, case-sensitive, against an explicit table: the names above, and `I` followed by a standard name. Nothing is inferred from a word inside a name, so `StdoutLogger`, `RedisCache`, `UserSessionPolicy`, `PageLayout` and `FakeLogger` are not reported, and neither are the kernel names themselves, their imports or their uses.
|
|
65
|
+
|
|
66
|
+
A class that `implements` or `extends` the interface it would replace (`class CacheService implements Cache`) is an implementation, not a second interface, and is not reported; name it after its technology all the same. An interface that `extends` the kernel one, and a type alias of it, are reported: the kernel interfaces are extended by declaration merging of `SessionExtensions`, `ExecutionContextExtensions`, `ActorExtensions`, `LogFields` and `MetricLabels`, not by a subtype under another name.
|
|
67
|
+
|
|
68
|
+
`RequestContext` is the context of one transport request: `presentation/` of a context and the platform may declare one.
|
|
69
|
+
|
|
70
|
+
## Options
|
|
71
|
+
|
|
72
|
+
None. The table is changed by `standardInterfaces` in `ddd-ts-kit.config.json`, merged over the defaults: a string adds a name or replaces what to use instead, `false` drops a default.
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"standardInterfaces": {
|
|
77
|
+
"TenantInfo": "TenantScoped",
|
|
78
|
+
"CurrentUser": false
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`rules."standard/no-parallel-interface"` in `ddd-ts-kit.config.json` set to `off` silences the rule, and `// ddd-ts-kit-disable-next-line standard/no-parallel-interface -- <reason>` silences one line, exactly as for `ddd-ts-kit check`.
|
|
84
|
+
|
|
85
|
+
## Limits
|
|
86
|
+
|
|
87
|
+
- A domain concept that carries one of these names for a good reason (an `AuditLog` aggregate in an audit context, a `CurrentUser` read model of an identity context whose glossary defines the term) is reported: the glossary is not read. Drop the entry in `standardInterfaces`, or record the suppression of the line.
|
|
88
|
+
- A parallel shape under a name the table does not hold (`LogService`, `Pagination`, `Principal`) is not seen; add it to `standardInterfaces`.
|
|
89
|
+
- A copy made without a declaration of its own (an inline object type, a re-export under another name, `export { Logger as ILogger }`) is not seen.
|
|
90
|
+
- A class expression (`const ILogger = class {}`) and an enum are not judged.
|
|
91
|
+
- The class exemption reads the names in `implements` and `extends`, not what they resolve to: a local interface called `Logger` exempts the class as well.
|
|
92
|
+
|
|
93
|
+
## With the CLI checker
|
|
94
|
+
|
|
95
|
+
`ddd-ts-kit check` reports the same id from the declarations it reads in the text of the files, with the same table (a test pins the two) and the same exemptions. This rule is the authority.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# ddd-ts-kit/test-no-mocks
|
|
2
|
+
|
|
3
|
+
Architecture id: `test/no-mocks`. Default severity: `warn` in `recommended`, `error` in `strict`.
|
|
4
|
+
|
|
5
|
+
Applies to: test files of a context (`test/**`, `*.spec.ts`, `*.test.ts`).
|
|
6
|
+
|
|
7
|
+
## Why
|
|
8
|
+
|
|
9
|
+
A mock asserts calls, not outcomes, and breaks on every refactoring. A fake is a working in-memory implementation of the port, held to the same contract suite as the real adapter.
|
|
10
|
+
|
|
11
|
+
## Reported
|
|
12
|
+
|
|
13
|
+
- `vi.mock`, `vi.doMock`, `vi.fn`, `vi.spyOn`, `vi.mocked` and their `jest` twins
|
|
14
|
+
- an import of `sinon`, `ts-mockito`, `jest-mock`, `jest-mock-extended`, `vitest-mock-extended`, `testdouble`, `ts-auto-mock`, `typemoq`, `moq.ts`, `@golevelup/ts-jest`, `@golevelup/ts-vitest`
|
|
15
|
+
|
|
16
|
+
Incorrect:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
const save = vi.fn();
|
|
20
|
+
vi.mock('@/contexts/billing/infrastructure/persistence/drizzle-invoice.repository.js');
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Correct:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
const invoices = new FakeInvoiceRepository();
|
|
27
|
+
await handler.execute(command);
|
|
28
|
+
expect(await invoices.findById(id)).toBeDefined();
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Details
|
|
32
|
+
|
|
33
|
+
`vi.useFakeTimers` and `vi.setSystemTime` are not mocks of a collaborator and are allowed, although `FixedClock` is the usual way.
|
|
34
|
+
|
|
35
|
+
## Options
|
|
36
|
+
|
|
37
|
+
None.
|
|
38
|
+
|
|
39
|
+
`rules."test/no-mocks"` in `ddd-ts-kit.config.json` set to `off` silences the rule, and `// ddd-ts-kit-disable-next-line test/no-mocks -- <reason>` silences one line, exactly as for `ddd-ts-kit check`.
|
|
40
|
+
|
|
41
|
+
## Limits
|
|
42
|
+
|
|
43
|
+
- Tests outside a context (`test/e2e`) are not judged.
|
|
44
|
+
|
|
45
|
+
## With the CLI checker
|
|
46
|
+
|
|
47
|
+
`ddd-ts-kit check` reports the same id with regular expressions. This rule is the authority.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# ddd-ts-kit/tracing-platform-only
|
|
2
|
+
|
|
3
|
+
Architecture id: `tracing/platform-only`. Default severity: `error` in `recommended`, `error` in `strict`.
|
|
4
|
+
|
|
5
|
+
Applies to: every file under the source root, tests included, except the platform directory, `main.ts` and `apps/`.
|
|
6
|
+
|
|
7
|
+
## Why
|
|
8
|
+
|
|
9
|
+
Tracing is non-invasive: the platform wires it once, and one action is one trace because every span is opened by the same few places (the request boundary, the bus middleware, the instrumentation around adapters and handlers, the outbox relay). A context that imports the tracing package or the OpenTelemetry API opens spans of its own, with names and attributes nobody reviews, and can no longer be traced differently, or not at all, by changing the composition root alone.
|
|
10
|
+
|
|
11
|
+
## Reported
|
|
12
|
+
|
|
13
|
+
- an import of `@ddd-ts-kit/tracing` or of one of its entries (`/node`, `/testing`) outside the platform directory, `main.ts` and `apps/`
|
|
14
|
+
- an import of any `@opentelemetry/*` package in the same places
|
|
15
|
+
|
|
16
|
+
Incorrect:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
// src/contexts/billing/infrastructure/external/stripe-payment.gateway.ts
|
|
20
|
+
import { trace } from '@opentelemetry/api';
|
|
21
|
+
|
|
22
|
+
export class StripePaymentGateway implements PaymentGateway {
|
|
23
|
+
async charge(invoiceId: string): Promise<void> {
|
|
24
|
+
await trace.getTracer('billing').startActiveSpan('charge', () => this.client.charge(invoiceId));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Correct:
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
// src/platform/tracing.ts: the one place that knows the tracing package
|
|
33
|
+
import { traceApplication, tracedPublisher } from '@ddd-ts-kit/tracing';
|
|
34
|
+
import { initTracing } from '@ddd-ts-kit/tracing/node';
|
|
35
|
+
|
|
36
|
+
// src/contexts/billing/infrastructure/external/stripe-payment.gateway.ts
|
|
37
|
+
export class StripePaymentGateway implements PaymentGateway {
|
|
38
|
+
async charge(invoiceId: string): Promise<void> {
|
|
39
|
+
await this.client.charge(invoiceId);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Details
|
|
45
|
+
|
|
46
|
+
Static imports, type-only imports, `export ... from`, dynamic `import()` and `require()` are all read. The platform directory is `platformDir` of `ddd-ts-kit.config.json`, the source root is `sourceRoot`; `main.ts` is the one at the source root and `apps/` the directory of that name at the source root (`src/apps/<context>/main.ts`, `src/apps/worker/main.ts`).
|
|
47
|
+
|
|
48
|
+
Judged: every layer of a context, its module file and its tests, the shared kernel and any other file under the source root. Not judged: files outside the source root (the `test/` directory at the root of the project, `scripts/`, config files).
|
|
49
|
+
|
|
50
|
+
In `domain/` and `application/` the layer rules refuse the same import under their own id, so one import gives two reports there: `layer/*` says the layer is pure, this rule says where tracing lives.
|
|
51
|
+
|
|
52
|
+
## Options
|
|
53
|
+
|
|
54
|
+
None. `platformDir` and `sourceRoot` of `ddd-ts-kit.config.json` say where the platform and the sources are.
|
|
55
|
+
|
|
56
|
+
`rules."tracing/platform-only"` in `ddd-ts-kit.config.json` set to `off` silences the rule, and `// ddd-ts-kit-disable-next-line tracing/platform-only -- <reason>` silences one line, exactly as for `ddd-ts-kit check`.
|
|
57
|
+
|
|
58
|
+
## Limits
|
|
59
|
+
|
|
60
|
+
- A tracing helper re-exported by a file of the platform and imported from there is not followed: that is how a context is expected to receive nothing at all, and a platform that exports its tracer to the contexts defeats the rule.
|
|
61
|
+
- Another tracing library (a vendor SDK that is not under `@opentelemetry/`) is not recognised.
|
|
62
|
+
|
|
63
|
+
## With the CLI checker
|
|
64
|
+
|
|
65
|
+
`ddd-ts-kit check` reports the same id from the import specifiers it reads in the text of the files, with the same exemptions. This rule is the authority.
|