@ddd-ts-kit/eslint-plugin 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 @@
|
|
|
1
|
+
{"version":3,"file":"property-name.d.ts","sourceRoot":"","sources":["../../../src/support/globals/property-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzE,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAQhF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
export function propertyName(node) {
|
|
3
|
+
if (!node.computed) {
|
|
4
|
+
return node.property.type === AST_NODE_TYPES.Identifier ? node.property.name : undefined;
|
|
5
|
+
}
|
|
6
|
+
return node.property.type === AST_NODE_TYPES.Literal && typeof node.property.value === 'string'
|
|
7
|
+
? node.property.value
|
|
8
|
+
: undefined;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=property-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-name.js","sourceRoot":"","sources":["../../../src/support/globals/property-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,0BAA0B,CAAC;AAEzE,MAAM,UAAU,YAAY,CAAC,IAA+B;IAC1D,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3F,CAAC;IAED,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,cAAc,CAAC,OAAO,IAAI,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,KAAK,QAAQ;QAC7F,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK;QACrB,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
import type { ClassNode } from './classes/class-name.js';
|
|
3
|
+
type Source = Readonly<TSESLint.SourceCode>;
|
|
4
|
+
/**
|
|
5
|
+
* The rewriting of every `#name` of one class into a `private name`, or undefined when it is
|
|
6
|
+
* not safe: the class already has a member called `name`, the file tests `#name in value`,
|
|
7
|
+
* another class declares the same `#name`, or a use is not `this.#name` or `<identifier>.#name`
|
|
8
|
+
* inside the class.
|
|
9
|
+
*/
|
|
10
|
+
export declare function hashPrivateFix(sourceCode: Source, owner: ClassNode, name: string): TSESLint.ReportFixFunction | undefined;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=hash-private-fix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash-private-fix.d.ts","sourceRoot":"","sources":["../../src/support/hash-private-fix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,QAAQ,EAAiB,MAAM,0BAA0B,CAAC;AAExF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAKzD,KAAK,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AAG5C;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,MAAM,GACX,QAAQ,CAAC,iBAAiB,GAAG,SAAS,CAwBxC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
import { constructorOf } from './classes/constructor-of.js';
|
|
3
|
+
import { descendants } from './descendants.js';
|
|
4
|
+
import { parameterName } from './members/parameter-name.js';
|
|
5
|
+
import { parameterProperties } from './members/parameter-properties.js';
|
|
6
|
+
/**
|
|
7
|
+
* The rewriting of every `#name` of one class into a `private name`, or undefined when it is
|
|
8
|
+
* not safe: the class already has a member called `name`, the file tests `#name in value`,
|
|
9
|
+
* another class declares the same `#name`, or a use is not `this.#name` or `<identifier>.#name`
|
|
10
|
+
* inside the class.
|
|
11
|
+
*/
|
|
12
|
+
export function hashPrivateFix(sourceCode, owner, name) {
|
|
13
|
+
const all = [...descendants(sourceCode.ast)].filter((node) => node.type === AST_NODE_TYPES.PrivateIdentifier && node.name === name);
|
|
14
|
+
const keys = all.filter((node) => isMemberKey(node));
|
|
15
|
+
const uses = all.filter((node) => !isMemberKey(node));
|
|
16
|
+
const safe = keys.every((key) => key.parent.parent === owner.body) &&
|
|
17
|
+
uses.every((use) => isPlainUse(use, owner)) &&
|
|
18
|
+
!hasMemberNamed(owner, name);
|
|
19
|
+
if (!safe) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
return (fixer) => [
|
|
23
|
+
...keys.flatMap((key) => [
|
|
24
|
+
fixer.insertTextBefore(firstModifier(sourceCode, key), 'private '),
|
|
25
|
+
fixer.replaceText(key, name),
|
|
26
|
+
]),
|
|
27
|
+
...uses.map((use) => fixer.replaceText(use, name)),
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
function isMemberKey(node) {
|
|
31
|
+
return node.parent.type !== AST_NODE_TYPES.MemberExpression && node.parent.type !== AST_NODE_TYPES.BinaryExpression;
|
|
32
|
+
}
|
|
33
|
+
function isPlainUse(use, owner) {
|
|
34
|
+
const access = use.parent;
|
|
35
|
+
if (access.type !== AST_NODE_TYPES.MemberExpression ||
|
|
36
|
+
use.range[0] < owner.range[0] ||
|
|
37
|
+
use.range[1] > owner.range[1]) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
return access.object.type === AST_NODE_TYPES.ThisExpression || access.object.type === AST_NODE_TYPES.Identifier;
|
|
41
|
+
}
|
|
42
|
+
function hasMemberNamed(owner, name) {
|
|
43
|
+
const members = owner.body.body.some((member) => 'key' in member && !member.computed && member.key.type === AST_NODE_TYPES.Identifier && member.key.name === name);
|
|
44
|
+
return (members || parameterProperties(constructorOf(owner.body)).some((parameter) => parameterName(parameter) === name));
|
|
45
|
+
}
|
|
46
|
+
/** `private` goes before `static`, `readonly`, `async`, `get`, and after the decorators. */
|
|
47
|
+
function firstModifier(sourceCode, key) {
|
|
48
|
+
const member = key.parent;
|
|
49
|
+
const last = 'decorators' in member ? member.decorators.at(-1) : undefined;
|
|
50
|
+
return (last === undefined ? sourceCode.getFirstToken(member) : sourceCode.getTokenAfter(last)) ?? key;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=hash-private-fix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash-private-fix.js","sourceRoot":"","sources":["../../src/support/hash-private-fix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAgC,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAKxE;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAC5B,UAAkB,EAClB,KAAgB,EAChB,IAAY;IAEZ,MAAM,GAAG,GAAG,CAAC,GAAG,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CACjD,CAAC,IAAI,EAAmB,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,iBAAiB,IAAI,IAAI,CAAC,IAAI,KAAK,I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AS,CAAC;IAE3E,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC;AACzG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describe-target.d.ts","sourceRoot":"","sources":["../../../src/support/imports/describe-target.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAY3D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function describeTarget(target) {
|
|
2
|
+
if (target.kind !== 'file') {
|
|
3
|
+
return `"${target.name}"`;
|
|
4
|
+
}
|
|
5
|
+
const { location } = target;
|
|
6
|
+
if (location.area === 'context') {
|
|
7
|
+
return `${location.context}/${location.layer === 'module' ? 'module file' : location.layer}`;
|
|
8
|
+
}
|
|
9
|
+
return location.area === 'other' ? target.path : location.area;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=describe-target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describe-target.js","sourceRoot":"","sources":["../../../src/support/imports/describe-target.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,cAAc,CAAC,MAAoB;IACjD,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC3B,OAAO,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC;IAC5B,CAAC;IAED,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAE5B,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,GAAG,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IAC/F,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type TSESLint, type TSESTree } from '@typescript-eslint/utils';
|
|
2
|
+
import { type ImportTarget } from '../../project/resolve-import.js';
|
|
3
|
+
import type { LintedFile } from '../../project/linted-file.js';
|
|
4
|
+
export interface ImportedName {
|
|
5
|
+
/** The name exported by the module, whatever it is renamed to locally. */
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly node: TSESTree.Node;
|
|
8
|
+
}
|
|
9
|
+
export interface ImportSite {
|
|
10
|
+
readonly specifier: string;
|
|
11
|
+
/** The specifier literal: where the report points. */
|
|
12
|
+
readonly node: TSESTree.Node;
|
|
13
|
+
readonly target: ImportTarget;
|
|
14
|
+
/** The exports taken one by one: `{ a, b as c }`. */
|
|
15
|
+
readonly names: readonly ImportedName[];
|
|
16
|
+
/** True when the module is taken as a whole: default, namespace, `export *`, dynamic import, `require`. */
|
|
17
|
+
readonly whole: boolean;
|
|
18
|
+
}
|
|
19
|
+
type Visit = (site: ImportSite) => void;
|
|
20
|
+
/** Every way a module names another one: static, type-only, re-export, dynamic, `require`, `import()` types. */
|
|
21
|
+
export declare function importListener(file: LintedFile, visit: Visit): TSESLint.RuleListener;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=import-listener.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-listener.d.ts","sourceRoot":"","sources":["../../../src/support/imports/import-listener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAG/D,MAAM,WAAW,YAAY;IAC3B,0EAA0E;IAC1E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,sDAAsD;IACtD,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,qDAAqD;IACrD,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IACxC,2GAA2G;IAC3G,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAMD,KAAK,KAAK,GAAG,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;AAExC,gHAAgH;AAChH,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,GAAG,QAAQ,CAAC,YAAY,CA4BpF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
import { resolveImport } from '../../project/resolve-import.js';
|
|
3
|
+
import { staticString } from './static-string.js';
|
|
4
|
+
const WHOLE = { names: [], whole: true };
|
|
5
|
+
/** Every way a module names another one: static, type-only, re-export, dynamic, `require`, `import()` types. */
|
|
6
|
+
export function importListener(file, visit) {
|
|
7
|
+
const see = (source, taken = WHOLE) => {
|
|
8
|
+
if (source === null || source === undefined) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const specifier = staticString(source);
|
|
12
|
+
if (specifier === undefined) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
visit({ specifier, node: source, target: resolveImport(file.config, file.path, specifier), ...taken });
|
|
16
|
+
};
|
|
17
|
+
return {
|
|
18
|
+
ImportDeclaration: (node) => see(node.source, importedNames(node)),
|
|
19
|
+
ExportNamedDeclaration: (node) => see(node.source, {
|
|
20
|
+
names: node.specifiers.map((specifier) => ({ name: moduleExportName(specifier.local), node: specifier })),
|
|
21
|
+
whole: false,
|
|
22
|
+
}),
|
|
23
|
+
ExportAllDeclaration: (node) => see(node.source),
|
|
24
|
+
ImportExpression: (node) => see(node.source),
|
|
25
|
+
TSImportType: (node) => see(node.source),
|
|
26
|
+
TSExternalModuleReference: (node) => see(node.expression),
|
|
27
|
+
CallExpression: (node) => see(isRequireCall(node) ? node.arguments[0] : undefined),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function importedNames(node) {
|
|
31
|
+
const named = node.specifiers.filter((specifier) => specifier.type === AST_NODE_TYPES.ImportSpecifier);
|
|
32
|
+
return {
|
|
33
|
+
names: named.map((specifier) => ({ name: moduleExportName(specifier.imported), node: specifier })),
|
|
34
|
+
whole: named.length < node.specifiers.length,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function moduleExportName(name) {
|
|
38
|
+
return name.type === AST_NODE_TYPES.Identifier ? name.name : name.value;
|
|
39
|
+
}
|
|
40
|
+
function isRequireCall(node) {
|
|
41
|
+
return (node.callee.type === AST_NODE_TYPES.Identifier && node.callee.name === 'require' && node.arguments.length === 1);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=import-listener.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-listener.js","sourceRoot":"","sources":["../../../src/support/imports/import-listener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAgC,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAAE,aAAa,EAAqB,MAAM,iCAAiC,CAAC;AAEnF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAqBlD,MAAM,KAAK,GAAU,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CA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ources":["../../../src/support/imports/in-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE/D,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,eAAe,GAAG,SAAS,CAEvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-context.js","sourceRoot":"","sources":["../../../src/support/imports/in-context.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,SAAS,CAAC,IAAgB;IACxC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ContextLocation } from '../../project/location.js';
|
|
2
|
+
import type { Layer } from '../../project/layer.js';
|
|
3
|
+
import type { LintedFile } from '../../project/linted-file.js';
|
|
4
|
+
export declare function inLayer(file: LintedFile, layer: Layer): ContextLocation | undefined;
|
|
5
|
+
//# sourceMappingURL=in-layer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-layer.d.ts","sourceRoot":"","sources":["../../../src/support/imports/in-layer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE/D,wBAAgB,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,GAAG,eAAe,GAAG,SAAS,CAEnF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-layer.js","sourceRoot":"","sources":["../../../src/support/imports/in-layer.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,OAAO,CAAC,IAAgB,EAAE,KAAY;IACpD,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,KAAK,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;AACvH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { LintedFile } from '../../project/linted-file.js';
|
|
2
|
+
/** A production or test source of the project itself, as opposed to a script or a config file next to it. */
|
|
3
|
+
export declare function inSourceRoot(file: LintedFile): boolean;
|
|
4
|
+
//# sourceMappingURL=in-source-root.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-source-root.d.ts","sourceRoot":"","sources":["../../../src/support/imports/in-source-root.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE/D,6GAA6G;AAC7G,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAEtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-source-root.js","sourceRoot":"","sources":["../../../src/support/imports/in-source-root.ts"],"names":[],"mappings":"AAEA,6GAA6G;AAC7G,MAAM,UAAU,YAAY,CAAC,IAAgB;IAC3C,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { LintedFile } from '../../project/linted-file.js';
|
|
2
|
+
/** `domain` or `application` for a production file of one of the two layers that hold the model and the use cases. */
|
|
3
|
+
export declare function innerLayer(file: LintedFile): 'domain' | 'application' | undefined;
|
|
4
|
+
//# sourceMappingURL=inner-layer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inner-layer.d.ts","sourceRoot":"","sources":["../../../src/support/imports/inner-layer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE/D,sHAAsH;AACtH,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,QAAQ,GAAG,aAAa,GAAG,SAAS,CAQjF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** `domain` or `application` for a production file of one of the two layers that hold the model and the use cases. */
|
|
2
|
+
export function innerLayer(file) {
|
|
3
|
+
if (file.location.area !== 'context' || file.isTest) {
|
|
4
|
+
return undefined;
|
|
5
|
+
}
|
|
6
|
+
const { layer } = file.location;
|
|
7
|
+
return layer === 'domain' || layer === 'application' ? layer : undefined;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=inner-layer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inner-layer.js","sourceRoot":"","sources":["../../../src/support/imports/inner-layer.ts"],"names":[],"mappings":"AAEA,sHAAsH;AACtH,MAAM,UAAU,UAAU,CAAC,IAAgB;IACzC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QACpD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC;IAEhC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static-string.d.ts","sourceRoot":"","sources":["../../../src/support/imports/static-string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzE,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,MAAM,GAAG,SAAS,CAUpE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
export function staticString(node) {
|
|
3
|
+
if (node.type === AST_NODE_TYPES.Literal) {
|
|
4
|
+
return typeof node.value === 'string' ? node.value : undefined;
|
|
5
|
+
}
|
|
6
|
+
if (node.type !== AST_NODE_TYPES.TemplateLiteral || node.expressions.length > 0) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
return node.quasis[0]?.value.cooked ?? undefined;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=static-string.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static-string.js","sourceRoot":"","sources":["../../../src/support/imports/static-string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,0BAA0B,CAAC;AAEzE,MAAM,UAAU,YAAY,CAAC,IAAmB;IAC9C,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,OAAO,EAAE,CAAC;QACzC,OAAO,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IACjE,CAAC;IAED,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,eAAe,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChF,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,IAAI,SAAS,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `RabbitMqEventBus` is `rabbit-mq-event-bus`, `StandardSchemaV1` is `standard-schema-v1`,
|
|
3
|
+
* `HTTPServer` is `http-server`, `NO_POLICY` is `no-policy`: a name is written in a file name
|
|
4
|
+
* the way its declaration spells it.
|
|
5
|
+
*/
|
|
6
|
+
export declare function kebabCase(name: string): string;
|
|
7
|
+
//# sourceMappingURL=kebab-case.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kebab-case.d.ts","sourceRoot":"","sources":["../../src/support/kebab-case.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM9C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `RabbitMqEventBus` is `rabbit-mq-event-bus`, `StandardSchemaV1` is `standard-schema-v1`,
|
|
3
|
+
* `HTTPServer` is `http-server`, `NO_POLICY` is `no-policy`: a name is written in a file name
|
|
4
|
+
* the way its declaration spells it.
|
|
5
|
+
*/
|
|
6
|
+
export function kebabCase(name) {
|
|
7
|
+
return name
|
|
8
|
+
.replaceAll('_', '-')
|
|
9
|
+
.replaceAll(/([a-z0-9])([A-Z])/g, '$1-$2')
|
|
10
|
+
.replaceAll(/([A-Z])([A-Z][a-z])/g, '$1-$2')
|
|
11
|
+
.toLowerCase();
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=kebab-case.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kebab-case.js","sourceRoot":"","sources":["../../src/support/kebab-case.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,IAAI;SACR,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC;SACpB,UAAU,CAAC,oBAAoB,EAAE,OAAO,CAAC;SACzC,UAAU,CAAC,sBAAsB,EAAE,OAAO,CAAC;SAC3C,WAAW,EAAE,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameter-name.d.ts","sourceRoot":"","sources":["../../../src/support/members/parameter-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzE,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,mBAAmB,GAAG,MAAM,CAK5E"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
export function parameterName(property) {
|
|
3
|
+
const { parameter } = property;
|
|
4
|
+
const target = parameter.type === AST_NODE_TYPES.AssignmentPattern ? parameter.left : parameter;
|
|
5
|
+
return target.name;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=parameter-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameter-name.js","sourceRoot":"","sources":["../../../src/support/members/parameter-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,0BAA0B,CAAC;AAEzE,MAAM,UAAU,aAAa,CAAC,QAAsC;IAClE,MAAM,EAAE,SAAS,EAAE,GAAG,QAAQ,CAAC;IAC/B,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,KAAK,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IAEhG,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type TSESTree } from '@typescript-eslint/utils';
|
|
2
|
+
/** Constructor parameters declared as properties: `constructor(private readonly id: string)`. */
|
|
3
|
+
export declare function parameterProperties(constructor: TSESTree.MethodDefinition | undefined): TSESTree.TSParameterProperty[];
|
|
4
|
+
//# sourceMappingURL=parameter-properties.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameter-properties.d.ts","sourceRoot":"","sources":["../../../src/support/members/parameter-properties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzE,iGAAiG;AACjG,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,QAAQ,CAAC,gBAAgB,GAAG,SAAS,GACjD,QAAQ,CAAC,mBAAmB,EAAE,CAEhC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
/** Constructor parameters declared as properties: `constructor(private readonly id: string)`. */
|
|
3
|
+
export function parameterProperties(constructor) {
|
|
4
|
+
return constructor?.value.params.filter((parameter) => parameter.type === AST_NODE_TYPES.TSParameterProperty) ?? [];
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=parameter-properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameter-properties.js","sourceRoot":"","sources":["../../../src/support/members/parameter-properties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,0BAA0B,CAAC;AAEzE,iGAAiG;AACjG,MAAM,UAAU,mBAAmB,CACjC,WAAkD;IAElD,OAAO,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,cAAc,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAC;AACtH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"starts-at-this.d.ts","sourceRoot":"","sources":["../../../src/support/members/starts-at-this.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzE,uFAAuF;AACvF,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,OAAO,CAQzD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
/** True for `this.x`, `this.a.b`, `this.#x`: an access that starts at the instance. */
|
|
3
|
+
export function startsAtThis(node) {
|
|
4
|
+
let current = node;
|
|
5
|
+
while (current.type === AST_NODE_TYPES.MemberExpression) {
|
|
6
|
+
current = current.object;
|
|
7
|
+
}
|
|
8
|
+
return current.type === AST_NODE_TYPES.ThisExpression && node.type === AST_NODE_TYPES.MemberExpression;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=starts-at-this.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"starts-at-this.js","sourceRoot":"","sources":["../../../src/support/members/starts-at-this.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,0BAA0B,CAAC;AAEzE,uFAAuF;AACvF,MAAM,UAAU,YAAY,CAAC,IAAmB;IAC9C,IAAI,OAAO,GAAG,IAAI,CAAC;IAEnB,OAAO,OAAO,CAAC,IAAI,KAAK,cAAc,CAAC,gBAAgB,EAAE,CAAC;QACxD,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAC3B,CAAC;IAED,OAAO,OAAO,CAAC,IAAI,KAAK,cAAc,CAAC,cAAc,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,gBAAgB,CAAC;AACzG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outside-concern-message.d.ts","sourceRoot":"","sources":["../../../src/support/outside-concerns/outside-concern-message.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,eAAO,MAAM,uBAAuB,6DAA2D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outside-concern-message.js","sourceRoot":"","sources":["../../../src/support/outside-concerns/outside-concern-message.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,MAAM,CAAC,MAAM,uBAAuB,GAAG,wDAAwD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Packages that apply or record a concern from outside the model and the use cases: domain/
|
|
3
|
+
* and application/ never import them, whatever the allow-lists of the config say
|
|
4
|
+
* (docs/ARCHITECTURE.md, "Cross-cutting behaviour" and "Tracing").
|
|
5
|
+
*/
|
|
6
|
+
interface OutsideConcern {
|
|
7
|
+
readonly why: string;
|
|
8
|
+
readonly fix: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const ASPECTS_PACKAGE = "@ddd-ts-kit/aspects";
|
|
11
|
+
export declare function outsideConcern(packageName: string): OutsideConcern | undefined;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=outside-concern.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outside-concern.d.ts","sourceRoot":"","sources":["../../../src/support/outside-concerns/outside-concern.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,UAAU,cAAc;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,eAAe,wBAAwB,CAAC;AA6BrD,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAE9E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const ASPECTS_PACKAGE = '@ddd-ts-kit/aspects';
|
|
2
|
+
const OUTSIDE_CONCERNS = {
|
|
3
|
+
[ASPECTS_PACKAGE]: {
|
|
4
|
+
why: 'an aspect (logging, metrics, retry, timeout, circuit breaking, caching) is applied from outside, never written in the model or in a use case',
|
|
5
|
+
fix: 'Remove the import and apply the aspect at the composition root (`.with(...)` on the binding, or the `decorate` hook), in a bus middleware for what concerns every use case, or on an adapter class in infrastructure/.',
|
|
6
|
+
},
|
|
7
|
+
'@ddd-ts-kit/tracing': {
|
|
8
|
+
why: 'tracing is non-invasive, a span is opened around an adapter or a use case, never by the model or the use case itself',
|
|
9
|
+
fix: 'Remove the import: adapters, use cases, events and jobs are observed from outside by `traceApplication()`, given to the kernel module at the composition root; what has to open a span of its own lives in the platform.',
|
|
10
|
+
},
|
|
11
|
+
'@ddd-ts-kit/redis': {
|
|
12
|
+
why: 'Redis is a technology behind a port',
|
|
13
|
+
fix: 'Depend on the port (`Cache` of @ddd-ts-kit/kernel, or a port in application/ports) and bind the Redis adapter in the platform.',
|
|
14
|
+
},
|
|
15
|
+
'@ddd-ts-kit/scheduling': {
|
|
16
|
+
why: 'the scheduler is a technology behind the `JobScheduler` port, and a job only declares its schedule',
|
|
17
|
+
fix: 'Remove the import: declare the job with `@Scheduled` of @ddd-ts-kit/kernel/declarations (or `builder.job(..)` in the module file) and let the composition root bind the scheduler.',
|
|
18
|
+
},
|
|
19
|
+
'@ddd-ts-kit/sentry': {
|
|
20
|
+
why: 'error reporting is done from outside, behind the `ErrorReporter` port',
|
|
21
|
+
fix: 'Remove the import: failures are reported by the bus middleware, the HTTP error mapper and the job runner wired at the composition root; a use case raises a `DomainError` and reports nothing itself.',
|
|
22
|
+
},
|
|
23
|
+
'@ddd-ts-kit/audit': {
|
|
24
|
+
why: 'the audit trail is recorded from outside the use cases',
|
|
25
|
+
fix: 'Remove the import: the trail is fed by the bus middleware, the authorization hook and an event subscription, all wired at the composition root, never by a use case.',
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
export function outsideConcern(packageName) {
|
|
29
|
+
return OUTSIDE_CONCERNS[packageName];
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=outside-concern.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outside-concern.js","sourceRoot":"","sources":["../../../src/support/outside-concerns/outside-concern.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,eAAe,GAAG,qBAAqB,CAAC;AAErD,MAAM,gBAAgB,GAA6C;IACjE,CAAC,eAAe,CAAC,EAAE;QACjB,GAAG,EAAE,8IAA8I;QACnJ,GAAG,EAAE,wNAAwN;KAC9N;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,sHAAsH;QAC3H,GAAG,EAAE,0NAA0N;KAChO;IACD,mBAAmB,EAAE;QACnB,GAAG,EAAE,qCAAqC;QAC1C,GAAG,EAAE,gIAAgI;KACtI;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,oGAAoG;QACzG,GAAG,EAAE,oLAAoL;KAC1L;IACD,oBAAoB,EAAE;QACpB,GAAG,EAAE,uEAAuE;QAC5E,GAAG,EAAE,uMAAuM;KAC7M;IACD,mBAAmB,EAAE;QACnB,GAAG,EAAE,wDAAwD;QAC7D,GAAG,EAAE,sKAAsK;KAC5K;CACF,CAAC;AAEF,MAAM,UAAU,cAAc,CAAC,WAAmB;IAChD,OAAO,gBAAgB,CAAC,WAAW,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type TSESTree } from '@typescript-eslint/utils';
|
|
2
|
+
/** The name of a binding call (`bind`, `rebind`, `resolve`, `fake`, `override`), or undefined for any other call. */
|
|
3
|
+
type BindingCallReader = (node: TSESTree.CallExpression) => string | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* Reads binding calls, plain or as a member (`builder.bind(X)`, `app.resolve(X)`), only in a
|
|
6
|
+
* program that imports something from `@ddd-ts-kit/di`: elsewhere `resolve('x')` is another call.
|
|
7
|
+
*/
|
|
8
|
+
export declare function bindingCallReader(program: TSESTree.Program): BindingCallReader;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=binding-call-reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binding-call-reader.d.ts","sourceRoot":"","sources":["../../../src/support/ports/binding-call-reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGzE,qHAAqH;AACrH,KAAK,iBAAiB,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,cAAc,KAAK,MAAM,GAAG,SAAS,CAAC;AAO/E;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,GAAG,iBAAiB,CAU9E"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
import { calleeName } from '../calls/callee-name.js';
|
|
3
|
+
const BINDING_CALLS = new Set(['bind', 'rebind', 'resolve', 'fake', 'override']);
|
|
4
|
+
const DI = /^@ddd-ts-kit\/di(?:\/|$)/;
|
|
5
|
+
/** `Promise.resolve`, `path.resolve`, `require.resolve`, `import.meta.resolve` resolve something else. */
|
|
6
|
+
const OTHER_RESOLVERS = new Set(['Promise', 'path', 'require', 'meta']);
|
|
7
|
+
/**
|
|
8
|
+
* Reads binding calls, plain or as a member (`builder.bind(X)`, `app.resolve(X)`), only in a
|
|
9
|
+
* program that imports something from `@ddd-ts-kit/di`: elsewhere `resolve('x')` is another call.
|
|
10
|
+
*/
|
|
11
|
+
export function bindingCallReader(program) {
|
|
12
|
+
const wires = program.body.some((statement) => statement.type === AST_NODE_TYPES.ImportDeclaration && DI.test(statement.source.value));
|
|
13
|
+
return (node) => {
|
|
14
|
+
const name = calleeName(node);
|
|
15
|
+
return wires && name !== undefined && BINDING_CALLS.has(name) && !isOtherResolver(node.callee) ? name : undefined;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function isOtherResolver(callee) {
|
|
19
|
+
if (callee.type !== AST_NODE_TYPES.MemberExpression) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
const receiver = callee.object.type === AST_NODE_TYPES.MetaProperty ? callee.object.property : callee.object;
|
|
23
|
+
return receiver.type === AST_NODE_TYPES.Identifier && OTHER_RESOLVERS.has(receiver.name);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=binding-call-reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binding-call-reader.js","sourceRoot":"","sources":["../../../src/support/ports/binding-call-reader.ts"],"names":[],"mappings":"AAAA,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C,MAAM,CAAC,MAAM,CAAC;IAE7G,OAAO,QAAQ,CAAC,IAAI,KAAK,cAAc,CAAC,UAAU,IAAI,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC3F,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type TSESLint, type TSESTree } from '@typescript-eslint/utils';
|
|
2
|
+
type Visit = (dependency: TSESTree.Identifier) => void;
|
|
3
|
+
/**
|
|
4
|
+
* Visits every name of a dependency list: the array that names what a constructor receives,
|
|
5
|
+
* as last argument of a declaration decorator (`@CommandHandler(M, [..])`, `@Repository(P, [..])`)
|
|
6
|
+
* and as second argument of `.toClass(C, [..])` and `.handledBy(H, [..])`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function dependencyListListener(program: TSESTree.Program, visit: Visit): TSESLint.RuleListener;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=dependency-list-listener.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependency-list-listener.d.ts","sourceRoot":"","sources":["../../../src/support/ports/dependency-list-listener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAKxF,KAAK,KAAK,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,UAAU,KAAK,IAAI,CAAC;AAIvD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,QAAQ,CAAC,YAAY,CA8BrG"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
import { calleeName } from '../calls/callee-name.js';
|
|
3
|
+
import { declarationReader } from '../declarations/declaration-reader.js';
|
|
4
|
+
const LISTING_CALLS = new Set(['toClass', 'handledBy']);
|
|
5
|
+
/**
|
|
6
|
+
* Visits every name of a dependency list: the array that names what a constructor receives,
|
|
7
|
+
* as last argument of a declaration decorator (`@CommandHandler(M, [..])`, `@Repository(P, [..])`)
|
|
8
|
+
* and as second argument of `.toClass(C, [..])` and `.handledBy(H, [..])`.
|
|
9
|
+
*/
|
|
10
|
+
export function dependencyListListener(program, visit) {
|
|
11
|
+
const declarationsOf = declarationReader(program);
|
|
12
|
+
const visitList = (list) => {
|
|
13
|
+
if (list?.type !== AST_NODE_TYPES.ArrayExpression) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
for (const element of list.elements) {
|
|
17
|
+
if (element?.type === AST_NODE_TYPES.Identifier) {
|
|
18
|
+
visit(element);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const judgeClass = (node) => {
|
|
23
|
+
for (const declaration of declarationsOf(node)) {
|
|
24
|
+
visitList(declaration.arguments.at(-1));
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
ClassDeclaration: judgeClass,
|
|
29
|
+
ClassExpression: judgeClass,
|
|
30
|
+
CallExpression(node) {
|
|
31
|
+
if (node.callee.type === AST_NODE_TYPES.MemberExpression && LISTING_CALLS.has(calleeName(node) ?? '')) {
|
|
32
|
+
visitList(node.arguments[1]);
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=dependency-list-listener.js.map
|