@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,73 @@
|
|
|
1
|
+
import { defineRule } from '../support/rule/define-rule.js';
|
|
2
|
+
const DIRECTIVE = /^((?:eslint|ddd-ts-kit)-disable(?:-next-line|-line)?)(?![\w-])(.*)$/s;
|
|
3
|
+
const REASON = /\s-{2,}\s*/;
|
|
4
|
+
const DECISION_RECORD = /\bADR-\d+\b/;
|
|
5
|
+
const OWN_NAME = /(?:^|\/)governance-recorded-deviation$/;
|
|
6
|
+
export const governanceRecordedDeviation = defineRule({
|
|
7
|
+
id: 'governance/recorded-deviation',
|
|
8
|
+
type: 'problem',
|
|
9
|
+
recommended: 'error',
|
|
10
|
+
description: 'A suppression carries a reason that points to a decision record of docs/adr/, and names the rules it silences.',
|
|
11
|
+
messages: {
|
|
12
|
+
unrecorded: '`{{directive}}` on line {{line}} silences a rule without pointing to a decision. Fix the diagnostic; if the deviation is deliberate, record it with `ddd-ts-kit generate adr` (reason, scope, condition for removing it) and end the comment with `-- ADR-<number>: <reason>`.',
|
|
13
|
+
blanket: '`{{directive}}` on line {{line}} names no rule: it silences every rule, the ones nobody thought of included. Name each rule it suppresses, record the decision with `ddd-ts-kit generate adr` and end the comment with `-- ADR-<number>: <reason>`.',
|
|
14
|
+
},
|
|
15
|
+
create({ sourceCode, report }) {
|
|
16
|
+
return {
|
|
17
|
+
Program() {
|
|
18
|
+
for (const comment of sourceCode.getAllComments()) {
|
|
19
|
+
const directive = parseDirective(comment.value);
|
|
20
|
+
const messageId = directive === undefined ? undefined : judge(directive);
|
|
21
|
+
if (directive === undefined || messageId === undefined) {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
report({
|
|
25
|
+
loc: reportedAt(comment, directive),
|
|
26
|
+
messageId,
|
|
27
|
+
data: { directive: `${directive.keyword} ${directive.rules}`.trim(), line: comment.loc.start.line },
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
function parseDirective(comment) {
|
|
35
|
+
const match = DIRECTIVE.exec(comment.trim());
|
|
36
|
+
if (match === null) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
const [, keyword = '', rest = ''] = match;
|
|
40
|
+
const separator = REASON.exec(rest);
|
|
41
|
+
if (separator === null) {
|
|
42
|
+
return { keyword, rules: rest.trim(), reason: '' };
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
keyword,
|
|
46
|
+
rules: rest.slice(0, separator.index).trim(),
|
|
47
|
+
reason: rest.slice(separator.index + separator[0].length),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function judge(directive) {
|
|
51
|
+
if (directive.rules === '') {
|
|
52
|
+
return 'blanket';
|
|
53
|
+
}
|
|
54
|
+
return DECISION_RECORD.test(directive.reason) ? undefined : 'unrecorded';
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* ESLint drops a report made at or after a directive that covers its rule. A directive that
|
|
58
|
+
* covers this very rule is therefore reported just ahead of the range it silences: before the
|
|
59
|
+
* first character of the file for `eslint-disable`, on the line above for `eslint-disable-line`.
|
|
60
|
+
*/
|
|
61
|
+
function reportedAt(comment, directive) {
|
|
62
|
+
if (!silencesThisRule(directive)) {
|
|
63
|
+
return comment.loc;
|
|
64
|
+
}
|
|
65
|
+
if (directive.keyword === 'eslint-disable') {
|
|
66
|
+
return { line: 1, column: -1 };
|
|
67
|
+
}
|
|
68
|
+
return directive.keyword === 'eslint-disable-line' ? { line: comment.loc.start.line - 1, column: 0 } : comment.loc;
|
|
69
|
+
}
|
|
70
|
+
function silencesThisRule(directive) {
|
|
71
|
+
return directive.rules === '' || directive.rules.split(/[\s,]+/).some((rule) => OWN_NAME.test(rule));
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=governance-recorded-deviation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"governance-recorded-deviation.js","sourceRoot":"","sources":["../../src/rules/governance-recorded-deviation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAS5D,MAAM,SAAS,GAAG,sEAAsE,CAAC;AACzF,MAAM,MAAM,GAAG,YAAY,CAAC;AAC5B,MAAM,eAAe,GAAG,aAAa,CAAC;AACtC,MAAM,QAAQ,GAAG,wCAAwC,CAAC;AAE1D,MAAM,CAAC,MAAM,2BAA2B,GAAG,UAAU,CAA2B;IAC9E,EAAE,EAAE,+BAA+B;IACnC,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,OAAO;IACpB,WAAW,EACT,gHAAgH;IAClH,QAAQ,EAAE;QACR,UAAU,EACR,gRAAgR;QAClR,OAAO,EACL,qPAAqP;KACxP;IACD,MAAM,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE;QAC3B,OAAO;YACL,OAAO;gBACL,KAAK,MAAM,OAAO,IAAI,UAAU,CAAC,cAAc,EAAE,EAAE,CAAC;oBAClD,MAAM,SAAS,GAAG,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;oBAChD,MAAM,SAAS,GAAG,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;oBAEzE,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;wBACvD,SAAS;oBACX,CAAC;oBAED,MAAM,CAAC;wBACL,GAAG,EAAE,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC;wBACnC,SAAS;wBACT,IAAI,EAAE,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC,OAAO,IAAI,SAA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AAyB,EAAE,SAAoB;IACjE,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,CAAC;QACjC,OAAO,OAAO,CAAC,GAAG,CAAC;IACrB,CAAC;IAED,IAAI,SAAS,CAAC,OAAO,KAAK,gBAAgB,EAAE,CAAC;QAC3C,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC;IACjC,CAAC;IAED,OAAO,SAAS,CAAC,OAAO,KAAK,qBAAqB,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;AACrH,CAAC;AAED,SAAS,gBAAgB,CAAC,SAAoB;IAC5C,OAAO,SAAS,CAAC,KAAK,KAAK,EAAE,IAAI,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACvG,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
type MessageId = 'relative' | 'unnamed' | 'segment';
|
|
3
|
+
export declare const importsAliasOnly: TSESLint.RuleModule<MessageId, [], import("../index.js").RuleDocs, TSESLint.RuleListener>;
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=imports-alias-only.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imports-alias-only.d.ts","sourceRoot":"","sources":["../../src/rules/imports-alias-only.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAQnE,KAAK,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AAOpD,eAAO,MAAM,gBAAgB,2FA8B3B,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { aliasRoots } from '../project/alias-roots.js';
|
|
3
|
+
import { toAlias } from '../project/to-alias.js';
|
|
4
|
+
import { importListener } from '../support/imports/import-listener.js';
|
|
5
|
+
import { defineRule } from '../support/rule/define-rule.js';
|
|
6
|
+
const RELATIVE = /^\.{1,2}(?:\/|$)/;
|
|
7
|
+
const DOT_SEGMENT = /\/\.{1,2}(?:\/|$)/;
|
|
8
|
+
/** Written by a tool and never linted as project code. */
|
|
9
|
+
const BUILD_PRODUCTS = ['generated'];
|
|
10
|
+
export const importsAliasOnly = defineRule({
|
|
11
|
+
id: 'imports/alias-only',
|
|
12
|
+
type: 'suggestion',
|
|
13
|
+
recommended: 'error',
|
|
14
|
+
fixable: 'code',
|
|
15
|
+
description: 'A file of the project is imported by its alias (`@/...`), never by a relative path, the same directory included; an alias path holds no `.` or `..` segment.',
|
|
16
|
+
messages: {
|
|
17
|
+
relative: '"{{specifier}}" is a relative import. Import the file by its alias, \'{{alias}}\': the alias names the file from the root of the project, so the import reads the same from anywhere and survives a move of this file.',
|
|
18
|
+
unnamed: '"{{specifier}}" is a relative import of a file no alias names. Keep what the code imports under {{directories}}; a file elsewhere (a manifest, a build product) is read at run time, not imported.',
|
|
19
|
+
segment: 'The alias import "{{specifier}}" holds a "." or ".." segment: it can leave {{directory}}/. Write the path of the file from {{directory}}/ after "{{prefix}}", with no "." or ".." segment: an alias names one file of its directory, and the build rewrites it as such.',
|
|
20
|
+
},
|
|
21
|
+
create({ file, report }) {
|
|
22
|
+
const roots = aliasRoots(file.config);
|
|
23
|
+
if (!isJudged(roots, file)) {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
return importListener(file, ({ node, specifier }) => {
|
|
27
|
+
const finding = RELATIVE.test(specifier) ? relative(roots, file, specifier) : dotSegment(roots, specifier);
|
|
28
|
+
if (finding !== undefined) {
|
|
29
|
+
report({ node, ...finding, ...fixOf(node, finding) });
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
/** A source under an aliased tree the team writes: the source root, the tests and the scripts. */
|
|
35
|
+
function isJudged(roots, file) {
|
|
36
|
+
return roots.some(({ directory }) => !BUILD_PRODUCTS.includes(directory) && file.path.startsWith(`${directory}/`));
|
|
37
|
+
}
|
|
38
|
+
function relative(roots, file, specifier) {
|
|
39
|
+
const alias = toAlias(roots, path.posix.join(path.posix.dirname(file.path), specifier));
|
|
40
|
+
if (alias !== undefined) {
|
|
41
|
+
return { messageId: 'relative', data: { specifier, alias } };
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
messageId: 'unnamed',
|
|
45
|
+
data: { specifier, directories: roots.map(({ directory }) => `${directory}/`).join(', ') },
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function dotSegment(roots, specifier) {
|
|
49
|
+
const named = roots.find(({ prefix }) => specifier.startsWith(prefix));
|
|
50
|
+
if (named === undefined || !DOT_SEGMENT.test(`/${specifier.slice(named.prefix.length)}`)) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
return { messageId: 'segment', data: { specifier, directory: named.directory, prefix: named.prefix } };
|
|
54
|
+
}
|
|
55
|
+
/** The specifier rewritten in place, between the quotes it was written with. */
|
|
56
|
+
function fixOf(node, { messageId, data }) {
|
|
57
|
+
const alias = data['alias'];
|
|
58
|
+
if (messageId !== 'relative' || alias === undefined) {
|
|
59
|
+
return {};
|
|
60
|
+
}
|
|
61
|
+
return { fix: (fixer) => fixer.replaceTextRange([node.range[0] + 1, node.range[1] - 1], alias) };
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=imports-alias-only.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imports-alias-only.js","sourceRoot":"","sources":["../../src/rules/imports-alias-only.ts"],"names":[],"mappings":"AAAA,OAAO,I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S,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;QACzF,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;AACzG,CAAC;AAED,gFAAgF;AAChF,SAAS,KAAK,CAAC,IAAmB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAS;IAC5D,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;IAE5B,IAAI,SAAS,KAAK,UAAU,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACpD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;AACnG,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const layerApplicationInward: import("@typescript-eslint/utils/ts-eslint").RuleModule<"builtin" | "outsideConcern" | "outward" | "package", [], import("../index.js").RuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
2
|
+
//# sourceMappingURL=layer-application-inward.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layer-application-inward.d.ts","sourceRoot":"","sources":["../../src/rules/layer-application-inward.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,sBAAsB,8MAkDjC,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { DECLARATIONS_ENTRY } from '../support/declarations/declaration-reader.js';
|
|
2
|
+
import { isDeclaredStyle } from '../support/declarations/is-declared-style.js';
|
|
3
|
+
import { defineRule } from '../support/rule/define-rule.js';
|
|
4
|
+
import { describeTarget } from '../support/imports/describe-target.js';
|
|
5
|
+
import { importListener } from '../support/imports/import-listener.js';
|
|
6
|
+
import { inLayer } from '../support/imports/in-layer.js';
|
|
7
|
+
import { OUTSIDE_CONCERN_MESSAGE } from '../support/outside-concerns/outside-concern-message.js';
|
|
8
|
+
import { outsideConcern } from '../support/outside-concerns/outside-concern.js';
|
|
9
|
+
const INWARD = ['domain', 'application', 'published-language'];
|
|
10
|
+
export const layerApplicationInward = defineRule({
|
|
11
|
+
id: 'layer/application-inward',
|
|
12
|
+
type: 'problem',
|
|
13
|
+
recommended: 'error',
|
|
14
|
+
description: 'application/ imports domain/, application/, published languages and the allowed kernel packages: never infrastructure/, presentation/, a framework or a driver.',
|
|
15
|
+
messages: {
|
|
16
|
+
outsideConcern: OUTSIDE_CONCERN_MESSAGE,
|
|
17
|
+
package: 'The application layer imports the package "{{name}}". Declare a port (an abstract class) in application/ports named after the need, implement it with "{{name}}" in infrastructure/, and bind it in {{context}}.module.ts (in the declared style, declare the adapter with `@Adapter`).',
|
|
18
|
+
builtin: 'The application layer imports the Node built-in "{{name}}". Hide the I/O behind a port in application/ports and implement it in infrastructure/external.',
|
|
19
|
+
outward: 'The application layer imports {{target}}. Depend on a port, the abstract class of application/ports or of domain/repositories, instead, and let the module file, or the declaration of the adapter, bind it.',
|
|
20
|
+
},
|
|
21
|
+
create({ file, report }) {
|
|
22
|
+
const here = inLayer(file, 'application');
|
|
23
|
+
if (here === undefined) {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
const allowed = file.config.applicationAllowedPackages;
|
|
27
|
+
const declares = isDeclaredStyle(file);
|
|
28
|
+
return importListener(file, ({ node, target, specifier }) => {
|
|
29
|
+
// Declarations are pure metadata: a declared use case imports them whatever the allow-list says.
|
|
30
|
+
if (declares && specifier === DECLARATIONS_ENTRY) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (target.kind === 'package') {
|
|
34
|
+
const concern = outsideConcern(target.name);
|
|
35
|
+
if (concern !== undefined) {
|
|
36
|
+
report({
|
|
37
|
+
node,
|
|
38
|
+
messageId: 'outsideConcern',
|
|
39
|
+
data: { importer: 'The application layer', specifier, ...concern },
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
else if (!allowed.includes(target.name)) {
|
|
43
|
+
report({ node, messageId: 'package', data: { name: target.name, context: here.context } });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
else if (target.kind === 'builtin') {
|
|
47
|
+
report({ node, messageId: 'builtin', data: { name: specifier } });
|
|
48
|
+
}
|
|
49
|
+
else if (pointsOutward(here, target)) {
|
|
50
|
+
report({ node, messageId: 'outward', data: { target: describeTarget(target) } });
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
function pointsOutward(here, target) {
|
|
56
|
+
const there = target.location;
|
|
57
|
+
if (there.area === 'shared-kernel') {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
if (there.area !== 'context') {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
// Another context: the context/* rules decide.
|
|
64
|
+
return there.context === here.context && !INWARD.includes(there.layer);
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=layer-application-inward.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layer-application-inward.js","sourceRoot":"","sources":["../../src/rules/layer-application-inward.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,uC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OAAO,KAAK,IAAI,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
type MessageId = 'package' | 'declarations' | 'outsideConcern' | 'builtin' | 'upstreamContract' | 'outerLayer';
|
|
2
|
+
export declare const layerDomainPurity: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageId, [], import("../index.js").RuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
3
|
+
export {};
|
|
4
|
+
//# sourceMappingURL=layer-domain-purity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layer-domain-purity.d.ts","sourceRoot":"","sources":["../../src/rules/layer-domain-purity.ts"],"names":[],"mappings":"AAWA,KAAK,SAAS,GAAG,SAAS,GAAG,cAAc,GAAG,gBAAgB,GAAG,SAAS,GAAG,kBAAkB,GAAG,YAAY,CAAC;AAE/G,eAAO,MAAM,iBAAiB,mKAsD5B,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { DECLARATIONS_ENTRY } from '../support/declarations/declaration-reader.js';
|
|
2
|
+
import { isDeclaredStyle } from '../support/declarations/is-declared-style.js';
|
|
3
|
+
import { defineRule } from '../support/rule/define-rule.js';
|
|
4
|
+
import { describeTarget } from '../support/imports/describe-target.js';
|
|
5
|
+
import { importListener } from '../support/imports/import-listener.js';
|
|
6
|
+
import { inLayer } from '../support/imports/in-layer.js';
|
|
7
|
+
import { OUTSIDE_CONCERN_MESSAGE } from '../support/outside-concerns/outside-concern-message.js';
|
|
8
|
+
import { outsideConcern } from '../support/outside-concerns/outside-concern.js';
|
|
9
|
+
export const layerDomainPurity = defineRule({
|
|
10
|
+
id: 'layer/domain-purity',
|
|
11
|
+
type: 'problem',
|
|
12
|
+
recommended: 'error',
|
|
13
|
+
description: 'domain/ imports only its own domain/, the shared kernel and the allowed kernel packages: no framework, ORM, validation library or Node built-in.',
|
|
14
|
+
messages: {
|
|
15
|
+
outsideConcern: OUTSIDE_CONCERN_MESSAGE,
|
|
16
|
+
package: 'The domain imports the package "{{name}}". Remove the import: express the need as plain TypeScript or as a port (an abstract class) in application/ports, and keep decorators and schemas of "{{name}}" in infrastructure or presentation.',
|
|
17
|
+
declarations: `The domain imports "${DECLARATIONS_ENTRY}": the domain declares nothing. Aggregates, entities, value objects, events, services and repository ports carry no decorator and no dependency list. Remove the import: put the decorator on the class of application/ or infrastructure/ that plays the role, and keep ports as abstract classes in domain/repositories and application/ports.`,
|
|
18
|
+
builtin: 'The domain imports the Node built-in "{{name}}". Receive the value (an id, a date, a hash) as a parameter, produced by a port such as IdGenerator or Clock in the application layer.',
|
|
19
|
+
upstreamContract: 'The domain of "{{here}}" imports the published language of "{{there}}". Translate the upstream contract in application/integration/handlers or infrastructure/anti-corruption and hand the domain its own types.',
|
|
20
|
+
outerLayer: 'The domain imports {{target}}. Invert the dependency: declare what the domain needs as a port, an abstract class of domain/repositories (or of application/ports), and let the outer layer implement it.',
|
|
21
|
+
},
|
|
22
|
+
create({ file, report }) {
|
|
23
|
+
const here = inLayer(file, 'domain');
|
|
24
|
+
if (here === undefined) {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
27
|
+
const allowed = file.config.domainAllowedPackages;
|
|
28
|
+
const declares = isDeclaredStyle(file);
|
|
29
|
+
return importListener(file, ({ node, target, specifier }) => {
|
|
30
|
+
if (declares && specifier === DECLARATIONS_ENTRY) {
|
|
31
|
+
report({ node, messageId: 'declarations' });
|
|
32
|
+
}
|
|
33
|
+
else if (target.kind === 'package') {
|
|
34
|
+
const concern = outsideConcern(target.name);
|
|
35
|
+
if (concern !== undefined) {
|
|
36
|
+
report({ node, messageId: 'outsideConcern', data: { importer: 'The domain', specifier, ...concern } });
|
|
37
|
+
}
|
|
38
|
+
else if (!allowed.includes(target.name)) {
|
|
39
|
+
report({ node, messageId: 'package', data: { name: target.name } });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else if (target.kind === 'builtin') {
|
|
43
|
+
report({ node, messageId: 'builtin', data: { name: specifier } });
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
const messageId = judgeFile(here, target);
|
|
47
|
+
if (messageId !== undefined) {
|
|
48
|
+
report({
|
|
49
|
+
node,
|
|
50
|
+
messageId,
|
|
51
|
+
data: { here: here.context, there: contextOf(target), target: describeTarget(target) },
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
function judgeFile(here, target) {
|
|
59
|
+
const there = target.location;
|
|
60
|
+
if (there.area === 'shared-kernel') {
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
if (there.area !== 'context') {
|
|
64
|
+
return 'outerLayer';
|
|
65
|
+
}
|
|
66
|
+
if (there.context === here.context) {
|
|
67
|
+
return there.layer === 'domain' ? undefined : 'outerLayer';
|
|
68
|
+
}
|
|
69
|
+
// The internals of another context are reported once, by context/published-language-only.
|
|
70
|
+
return there.layer === 'published-language' ? 'upstreamContract' : undefined;
|
|
71
|
+
}
|
|
72
|
+
function contextOf(target) {
|
|
73
|
+
return target.location.area === 'context' ? target.location.context : '';
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=layer-domain-purity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layer-domain-purity.js","sourceRoot":"","sources":["../../src/rules/layer-domain-purity.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAA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B,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;QACnC,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC;IAC7D,CAAC;IAED,0FAA0F;IAC1F,OAAO,KAAK,CAAC,KAAK,KAAK,oBAAoB,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/E,CAAC;AAED,SAAS,SAAS,CAAC,MAA+C;IAChE,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;AAC3E,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const layerPresentationNoInfrastructure: import("@typescript-eslint/utils/ts-eslint").RuleModule<"forbidden", [], import("../index.js").RuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
2
|
+
export declare const layerInfrastructureNoPresentation: import("@typescript-eslint/utils/ts-eslint").RuleModule<"forbidden", [], import("../index.js").RuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
3
|
+
//# sourceMappingURL=layer-sideways.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layer-sideways.d.ts","sourceRoot":"","sources":["../../src/rules/layer-sideways.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,iCAAiC,qKAO5C,CAAC;AAEH,eAAO,MAAM,iCAAiC,qKAO5C,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { defineRule } from '../support/rule/define-rule.js';
|
|
2
|
+
import { importListener } from '../support/imports/import-listener.js';
|
|
3
|
+
import { inLayer } from '../support/imports/in-layer.js';
|
|
4
|
+
export const layerPresentationNoInfrastructure = sidewaysRule({
|
|
5
|
+
id: 'layer/presentation-no-infrastructure',
|
|
6
|
+
from: 'presentation',
|
|
7
|
+
to: 'infrastructure',
|
|
8
|
+
description: 'presentation/ imports application/ (and domain types for mapping), never infrastructure/.',
|
|
9
|
+
instead: 'Send a command or a query through the bus of application/ instead; the adapter is bound to its port in {{context}}.module.ts.',
|
|
10
|
+
});
|
|
11
|
+
export const layerInfrastructureNoPresentation = sidewaysRule({
|
|
12
|
+
id: 'layer/infrastructure-no-presentation',
|
|
13
|
+
from: 'infrastructure',
|
|
14
|
+
to: 'presentation',
|
|
15
|
+
description: 'infrastructure/ implements ports of application/ and domain/, never imports presentation/.',
|
|
16
|
+
instead: 'Move the shared type to application/ (a port or a use case result) and let both sides import it from there.',
|
|
17
|
+
});
|
|
18
|
+
function sidewaysRule(rule) {
|
|
19
|
+
return defineRule({
|
|
20
|
+
id: rule.id,
|
|
21
|
+
type: 'problem',
|
|
22
|
+
recommended: 'error',
|
|
23
|
+
description: rule.description,
|
|
24
|
+
messages: { forbidden: `${rule.from}/ imports ${rule.to}/ ({{path}}). ${rule.instead}` },
|
|
25
|
+
create({ file, report }) {
|
|
26
|
+
const here = inLayer(file, rule.from);
|
|
27
|
+
if (here === undefined) {
|
|
28
|
+
return {};
|
|
29
|
+
}
|
|
30
|
+
return importListener(file, ({ node, target }) => {
|
|
31
|
+
if (target.kind !== 'file' || target.location.area !== 'context') {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (target.location.layer !== rule.to || target.location.context !== here.context) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
report({ node, messageId: 'forbidden', data: { path: target.path, context: here.context } });
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=layer-sideways.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layer-sideways.js","sourceRoot":"","sources":["../../src/rules/layer-sideways.ts"],"names":[],"mappings":"AACA,OAA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CAAC;oBACjE,OAAO;gBACT,CAAC;gBAED,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,KAAK,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;oBAClF,OAAO;gBACT,CAAC;gBAED,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YAC/F,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const portsAbstractClass: import("@typescript-eslint/utils/ts-eslint").RuleModule<"concrete" | "interface" | "member", [], import("../index.js").RuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
2
|
+
//# sourceMappingURL=ports-abstract-class.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ports-abstract-class.d.ts","sourceRoot":"","sources":["../../src/rules/ports-abstract-class.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,kBAAkB,6LAsC7B,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
import { className } from '../support/classes/class-name.js';
|
|
3
|
+
import { memberName } from '../support/classes/member-name.js';
|
|
4
|
+
import { visibilityOf } from '../support/classes/visibility-of.js';
|
|
5
|
+
import { defineRule } from '../support/rule/define-rule.js';
|
|
6
|
+
import { staticString } from '../support/imports/static-string.js';
|
|
7
|
+
import { isPortFile } from '../support/ports/is-port-file.js';
|
|
8
|
+
const PORT = 'A port is an abstract class with abstract members only: the class is the contract and the injection token at once.';
|
|
9
|
+
export const portsAbstractClass = defineRule({
|
|
10
|
+
id: 'ports/abstract-class',
|
|
11
|
+
type: 'problem',
|
|
12
|
+
recommended: 'error',
|
|
13
|
+
description: 'A port is an abstract class with abstract members only: no constructor, no private or protected member, no body, no initializer.',
|
|
14
|
+
messages: {
|
|
15
|
+
concrete: `{{className}} is declared in a port file but is not abstract. ${PORT} Write \`export abstract class {{className}}\` and move what it implements to an adapter in infrastructure/ that \`implements {{className}}\`.`,
|
|
16
|
+
member: `{{className}} has {{what}}. ${PORT} Keep \`abstract\` method signatures and \`abstract readonly\` properties here (and \`static readonly tokenKey\` when the port is published in a package), and move the rest to the adapter.`,
|
|
17
|
+
interface: '{{name}} is an interface in a port file. Declare the port as an abstract class: it is also its injection token. Write `export abstract class {{name}}` with `abstract` members; a data shape that travels through the port may stay a `type`.',
|
|
18
|
+
},
|
|
19
|
+
create({ file, report }) {
|
|
20
|
+
if (!isPortFile(file.config, file.path)) {
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
23
|
+
const judge = (node) => {
|
|
24
|
+
if (!node.abstract) {
|
|
25
|
+
report({ node: node.id ?? node, messageId: 'concrete', data: { className: className(node) } });
|
|
26
|
+
}
|
|
27
|
+
for (const member of node.body.body) {
|
|
28
|
+
const what = defectOf(member);
|
|
29
|
+
if (what !== undefined) {
|
|
30
|
+
report({ node: member, messageId: 'member', data: { className: className(node), what } });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
return {
|
|
35
|
+
ClassDeclaration: judge,
|
|
36
|
+
ClassExpression: judge,
|
|
37
|
+
'ExportNamedDeclaration > TSInterfaceDeclaration': (node) => report({ node: node.id, messageId: 'interface', data: { name: node.id.name } }),
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
/** What a member is that a port cannot hold, in the words of a report. */
|
|
42
|
+
function defectOf(member) {
|
|
43
|
+
const name = memberName(member) ?? 'a computed member';
|
|
44
|
+
if (member.type === AST_NODE_TYPES.MethodDefinition && member.kind === 'constructor') {
|
|
45
|
+
return 'a constructor';
|
|
46
|
+
}
|
|
47
|
+
if (visibilityOf(member) !== 'public') {
|
|
48
|
+
return `the ${visibilityOf(member)} member ${name}`;
|
|
49
|
+
}
|
|
50
|
+
return isAbstract(member) || isTokenKey(member) ? undefined : concreteMember(member, name);
|
|
51
|
+
}
|
|
52
|
+
function isAbstract(member) {
|
|
53
|
+
return (member.type === AST_NODE_TYPES.TSAbstractMethodDefinition ||
|
|
54
|
+
member.type === AST_NODE_TYPES.TSAbstractPropertyDefinition);
|
|
55
|
+
}
|
|
56
|
+
function concreteMember(member, name) {
|
|
57
|
+
if (member.type === AST_NODE_TYPES.MethodDefinition) {
|
|
58
|
+
return `the method ${name} with a body`;
|
|
59
|
+
}
|
|
60
|
+
return member.type === AST_NODE_TYPES.PropertyDefinition && member.value !== null
|
|
61
|
+
? `the property ${name} with an initializer`
|
|
62
|
+
: `the member ${name} that is not abstract`;
|
|
63
|
+
}
|
|
64
|
+
/** `static readonly tokenKey = 'billing.PaymentGateway'`: the identity of a port loaded twice. */
|
|
65
|
+
function isTokenKey(member) {
|
|
66
|
+
if (member.type !== AST_NODE_TYPES.PropertyDefinition ||
|
|
67
|
+
!member.static ||
|
|
68
|
+
!member.readonly ||
|
|
69
|
+
memberName(member) !== 'tokenKey') {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
return member.value !== null && staticString(member.value) !== undefined;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=ports-abstract-class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ports-abstract-class.js","sourceRoot":"","sources":["../../src/rules/ports-abstract-class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,U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Ac,IAAI,cAAc,CAAC;IAC1C,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,kBAAkB,IAAI,MAAM,CAAC,KAAK,KAAK,IAAI;QAC/E,CAAC,CAAC,gBAAgB,IAAI,sBAAsB;QAC5C,CAAC,CAAC,cAAc,IAAI,uBAAuB,CAAC;AAChD,CAAC;AAED,kGAAkG;AAClG,SAAS,UAAU,CAAC,MAA6B;IAC/C,IACE,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,kBAAkB;QACjD,CAAC,MAAM,CAAC,MAAM;QACd,CAAC,MAAM,CAAC,QAAQ;QAChB,UAAU,CAAC,MAAM,CAAC,KAAK,UAAU,EACjC,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,MAAM,CAAC,KAAK,KAAK,IAAI,IAAI,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC;AAC3E,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
type MessageId = 'notImplemented' | 'extended';
|
|
3
|
+
export declare const portsImplementsNeverExtends: TSESLint.RuleModule<MessageId, [], import("../index.js").RuleDocs, TSESLint.RuleListener>;
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=ports-implements-never-extends.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ports-implements-never-extends.d.ts","sourceRoot":"","sources":["../../src/rules/ports-implements-never-extends.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,QAAQ,EAAiB,MAAM,0BAA0B,CAAC;AAUxF,KAAK,SAAS,GAAG,gBAAgB,GAAG,UAAU,CAAC;AAM/C,eAAO,MAAM,2BAA2B,2FA+CtC,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
import { calleeName } from '../support/calls/callee-name.js';
|
|
3
|
+
import { className } from '../support/classes/class-name.js';
|
|
4
|
+
import { declarationReader } from '../support/declarations/declaration-reader.js';
|
|
5
|
+
import { defineRule } from '../support/rule/define-rule.js';
|
|
6
|
+
import { inContext } from '../support/imports/in-context.js';
|
|
7
|
+
import { importedBindings } from '../support/ports/imported-bindings.js';
|
|
8
|
+
import { isPortFile } from '../support/ports/is-port-file.js';
|
|
9
|
+
import { classFinder } from '../support/classes/class-finder.js';
|
|
10
|
+
const ADAPTER_DECLARATIONS = new Set(['Repository', 'Gateway', 'Adapter']);
|
|
11
|
+
const BINDERS = new Set(['bind', 'rebind']);
|
|
12
|
+
export const portsImplementsNeverExtends = defineRule({
|
|
13
|
+
id: 'ports/implements-never-extends',
|
|
14
|
+
type: 'problem',
|
|
15
|
+
recommended: 'error',
|
|
16
|
+
description: 'An adapter implements its port and never extends it: the port is a contract, not a base class.',
|
|
17
|
+
messages: {
|
|
18
|
+
notImplemented: '{{className}} is the adapter of {{port}} but does not implement it. Write `class {{className}} implements {{port}}`: the compiler then checks the adapter against the port, and a reader sees which contract the class honours.',
|
|
19
|
+
extended: '{{className}} extends {{port}}, which is a port. Write `class {{className}} implements {{port}}`: a port has abstract members only and is never a base class, so that a fake, an in-memory class or a remote client fits the same contract.',
|
|
20
|
+
},
|
|
21
|
+
create({ file, sourceCode, context, report }) {
|
|
22
|
+
const declarationsOf = declarationReader(sourceCode.ast);
|
|
23
|
+
const findClass = classFinder(file, sourceCode.ast, context.languageOptions.parser);
|
|
24
|
+
const imported = importedBindings(file, sourceCode.ast);
|
|
25
|
+
const isAdapterLayer = inContext(file)?.layer === 'infrastructure' && !file.isTest;
|
|
26
|
+
const importedPort = (node) => {
|
|
27
|
+
const parent = node.superClass?.type === AST_NODE_TYPES.Identifier ? node.superClass : undefined;
|
|
28
|
+
const target = parent === undefined ? undefined : imported.get(parent.name)?.target;
|
|
29
|
+
return parent !== undefined && isAdapterLayer && target?.kind === 'file' && isPortFile(file.config, target.path)
|
|
30
|
+
? [parent]
|
|
31
|
+
: [];
|
|
32
|
+
};
|
|
33
|
+
const judgeClass = (node) => {
|
|
34
|
+
const ports = declarationsOf(node).flatMap((declaration) => ADAPTER_DECLARATIONS.has(declaration.name) ? portNames(declaration.arguments[0]) : []);
|
|
35
|
+
const findings = ports.flatMap((port) => defectsOf(node, port, node.id ?? node));
|
|
36
|
+
const extended = findings.length > 0 ? [] : importedPort(node);
|
|
37
|
+
for (const parent of extended) {
|
|
38
|
+
report({ node: parent, messageId: 'extended', data: { className: className(node), port: parent.name } });
|
|
39
|
+
}
|
|
40
|
+
findings.forEach(report);
|
|
41
|
+
};
|
|
42
|
+
return {
|
|
43
|
+
ClassDeclaration: judgeClass,
|
|
44
|
+
ClassExpression: judgeClass,
|
|
45
|
+
CallExpression: (node) => judgeBinding(node, findClass, report),
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
function judgeBinding(node, findClass, report) {
|
|
50
|
+
const [bound] = boundPair(node);
|
|
51
|
+
const [implementation] = node.arguments;
|
|
52
|
+
const site = bound === undefined || implementation?.type !== AST_NODE_TYPES.Identifier || implementation.name === bound
|
|
53
|
+
? undefined
|
|
54
|
+
: findClass(implementation.name);
|
|
55
|
+
if (bound !== undefined && site !== undefined) {
|
|
56
|
+
defectsOf(site.node, bound, implementation ?? node).forEach(report);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function portNames(port) {
|
|
60
|
+
return port?.type === AST_NODE_TYPES.Identifier ? [port.name] : [];
|
|
61
|
+
}
|
|
62
|
+
/** `bind(Port).toClass(..)` and `rebind(Port).toClass(..)`, plain or on a builder: the name of the port. */
|
|
63
|
+
function boundPair(node) {
|
|
64
|
+
const { callee } = node;
|
|
65
|
+
if (callee.type !== AST_NODE_TYPES.MemberExpression ||
|
|
66
|
+
calleeName(node) !== 'toClass' ||
|
|
67
|
+
callee.object.type !== AST_NODE_TYPES.CallExpression) {
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
70
|
+
return BINDERS.has(calleeName(callee.object) ?? '') ? portNames(callee.object.arguments[0]) : [];
|
|
71
|
+
}
|
|
72
|
+
function defectsOf(node, port, at) {
|
|
73
|
+
const data = { className: className(node), port };
|
|
74
|
+
const isExtended = node.superClass?.type === AST_NODE_TYPES.Identifier && node.superClass.name === port;
|
|
75
|
+
const isImplemented = node.implements.some((implemented) => implemented.expression.type === AST_NODE_TYPES.Identifier && implemented.expression.name === port);
|
|
76
|
+
if (isExtended) {
|
|
77
|
+
return [{ node: at, messageId: 'extended', data }];
|
|
78
|
+
}
|
|
79
|
+
return isImplemented ? [] : [{ node: at, messageId: 'notImplemented', data }];
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=ports-implements-never-extends.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ports-implements-never-extends.js","sourceRoot":"","sources":["../../src/rules/ports-implements-never-extends.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAgC,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAkB,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,UAAU,EAAe,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAoB,MAAM,oCAAoC,CAAC;AAKnF,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AAC3E,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CA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