@nielspeter/eess-ts 0.2.0 → 0.4.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 +87 -34
- package/dist/builders/call-rule-builder.d.ts +66 -26
- package/dist/builders/call-rule-builder.d.ts.map +1 -1
- package/dist/builders/call-rule-builder.js +73 -31
- package/dist/builders/call-rule-builder.js.map +1 -1
- package/dist/builders/class-rule-builder.d.ts +125 -26
- package/dist/builders/class-rule-builder.d.ts.map +1 -1
- package/dist/builders/class-rule-builder.js +134 -30
- package/dist/builders/class-rule-builder.js.map +1 -1
- package/dist/builders/correspondence-builder.d.ts +287 -0
- package/dist/builders/correspondence-builder.d.ts.map +1 -0
- package/dist/builders/correspondence-builder.js +393 -0
- package/dist/builders/correspondence-builder.js.map +1 -0
- package/dist/builders/correspondence-findings.d.ts +104 -0
- package/dist/builders/correspondence-findings.d.ts.map +1 -0
- package/dist/builders/correspondence-findings.js +301 -0
- package/dist/builders/correspondence-findings.js.map +1 -0
- package/dist/builders/cross-layer-builder.d.ts +99 -16
- package/dist/builders/cross-layer-builder.d.ts.map +1 -1
- package/dist/builders/cross-layer-builder.js +181 -35
- package/dist/builders/cross-layer-builder.js.map +1 -1
- package/dist/builders/function-rule-builder.d.ts +144 -25
- package/dist/builders/function-rule-builder.d.ts.map +1 -1
- package/dist/builders/function-rule-builder.js +173 -26
- package/dist/builders/function-rule-builder.js.map +1 -1
- package/dist/builders/jsx-rule-builder.d.ts +70 -14
- package/dist/builders/jsx-rule-builder.d.ts.map +1 -1
- package/dist/builders/jsx-rule-builder.js +73 -14
- package/dist/builders/jsx-rule-builder.js.map +1 -1
- package/dist/builders/module-rule-builder.d.ts +2 -2
- package/dist/builders/module-rule-builder.d.ts.map +1 -1
- package/dist/builders/module-rule-builder.js +12 -3
- package/dist/builders/module-rule-builder.js.map +1 -1
- package/dist/builders/scoped-function-rule-builder.d.ts +11 -0
- package/dist/builders/scoped-function-rule-builder.d.ts.map +1 -1
- package/dist/builders/scoped-function-rule-builder.js +12 -0
- package/dist/builders/scoped-function-rule-builder.js.map +1 -1
- package/dist/builders/slice-discovery-message.d.ts +36 -0
- package/dist/builders/slice-discovery-message.d.ts.map +1 -0
- package/dist/builders/slice-discovery-message.js +181 -0
- package/dist/builders/slice-discovery-message.js.map +1 -0
- package/dist/builders/slice-rule-builder.d.ts +151 -12
- package/dist/builders/slice-rule-builder.d.ts.map +1 -1
- package/dist/builders/slice-rule-builder.js +242 -35
- package/dist/builders/slice-rule-builder.js.map +1 -1
- package/dist/builders/type-rule-builder.d.ts +95 -24
- package/dist/builders/type-rule-builder.d.ts.map +1 -1
- package/dist/builders/type-rule-builder.js +105 -29
- package/dist/builders/type-rule-builder.js.map +1 -1
- package/dist/{helpers → builders}/within.d.ts +2 -2
- package/dist/builders/within.d.ts.map +1 -0
- package/dist/{helpers → builders}/within.js +1 -1
- package/dist/builders/within.js.map +1 -0
- package/dist/cli/commands/baseline.d.ts +3 -2
- package/dist/cli/commands/baseline.d.ts.map +1 -1
- package/dist/cli/commands/baseline.js +68 -6
- package/dist/cli/commands/baseline.js.map +1 -1
- package/dist/cli/commands/check.d.ts +7 -2
- package/dist/cli/commands/check.d.ts.map +1 -1
- package/dist/cli/commands/check.js +241 -45
- package/dist/cli/commands/check.js.map +1 -1
- package/dist/cli/commands/doctor.d.ts +29 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +224 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/explain.d.ts +2 -1
- package/dist/cli/commands/explain.d.ts.map +1 -1
- package/dist/cli/commands/explain.js +19 -10
- package/dist/cli/commands/explain.js.map +1 -1
- package/dist/cli/commands/init.d.ts +9 -3
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +162 -137
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/import-rule-module.d.ts +29 -0
- package/dist/cli/import-rule-module.d.ts.map +1 -0
- package/dist/cli/import-rule-module.js +60 -0
- package/dist/cli/import-rule-module.js.map +1 -0
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +98 -33
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/load-rules.d.ts +6 -11
- package/dist/cli/load-rules.d.ts.map +1 -1
- package/dist/cli/load-rules.js +21 -29
- package/dist/cli/load-rules.js.map +1 -1
- package/dist/cli/resolve-config.d.ts.map +1 -1
- package/dist/cli/resolve-config.js +24 -14
- package/dist/cli/resolve-config.js.map +1 -1
- package/dist/cli/rule-file-findings.d.ts +178 -0
- package/dist/cli/rule-file-findings.d.ts.map +1 -0
- package/dist/cli/rule-file-findings.js +293 -0
- package/dist/cli/rule-file-findings.js.map +1 -0
- package/dist/cli/watch.d.ts +20 -7
- package/dist/cli/watch.d.ts.map +1 -1
- package/dist/cli/watch.js +39 -14
- package/dist/cli/watch.js.map +1 -1
- package/dist/conditions/body-analysis-function.d.ts.map +1 -1
- package/dist/conditions/body-analysis-function.js +16 -7
- package/dist/conditions/body-analysis-function.js.map +1 -1
- package/dist/conditions/body-analysis-module.d.ts.map +1 -1
- package/dist/conditions/body-analysis-module.js +14 -9
- package/dist/conditions/body-analysis-module.js.map +1 -1
- package/dist/conditions/body-analysis.d.ts.map +1 -1
- package/dist/conditions/body-analysis.js +16 -7
- package/dist/conditions/body-analysis.js.map +1 -1
- package/dist/conditions/call.d.ts.map +1 -1
- package/dist/conditions/call.js +38 -17
- package/dist/conditions/call.js.map +1 -1
- package/dist/conditions/catch-analysis.d.ts +2 -1
- package/dist/conditions/catch-analysis.d.ts.map +1 -1
- package/dist/conditions/catch-analysis.js.map +1 -1
- package/dist/conditions/cross-layer.d.ts +2 -10
- package/dist/conditions/cross-layer.d.ts.map +1 -1
- package/dist/conditions/cross-layer.js +227 -23
- package/dist/conditions/cross-layer.js.map +1 -1
- package/dist/conditions/dependency.d.ts +35 -6
- package/dist/conditions/dependency.d.ts.map +1 -1
- package/dist/conditions/dependency.js +299 -45
- package/dist/conditions/dependency.js.map +1 -1
- package/dist/conditions/exports.d.ts.map +1 -1
- package/dist/conditions/exports.js +10 -0
- package/dist/conditions/exports.js.map +1 -1
- package/dist/conditions/function.d.ts.map +1 -1
- package/dist/conditions/function.js +19 -5
- package/dist/conditions/function.js.map +1 -1
- package/dist/conditions/helpers.d.ts +2 -1
- package/dist/conditions/helpers.d.ts.map +1 -1
- package/dist/conditions/helpers.js +4 -1
- package/dist/conditions/helpers.js.map +1 -1
- package/dist/conditions/jsx.d.ts.map +1 -1
- package/dist/conditions/jsx.js +7 -2
- package/dist/conditions/jsx.js.map +1 -1
- package/dist/conditions/match-identity.d.ts +43 -0
- package/dist/conditions/match-identity.d.ts.map +1 -0
- package/dist/conditions/match-identity.js +43 -0
- package/dist/conditions/match-identity.js.map +1 -0
- package/dist/conditions/members.d.ts.map +1 -1
- package/dist/conditions/members.js +17 -4
- package/dist/conditions/members.js.map +1 -1
- package/dist/conditions/reverse-dependency.d.ts +18 -5
- package/dist/conditions/reverse-dependency.d.ts.map +1 -1
- package/dist/conditions/reverse-dependency.js +109 -92
- package/dist/conditions/reverse-dependency.js.map +1 -1
- package/dist/conditions/slice.d.ts +86 -2
- package/dist/conditions/slice.d.ts.map +1 -1
- package/dist/conditions/slice.js +234 -53
- package/dist/conditions/slice.js.map +1 -1
- package/dist/conditions/structural.d.ts.map +1 -1
- package/dist/conditions/structural.js +16 -4
- package/dist/conditions/structural.js.map +1 -1
- package/dist/core/check-all.d.ts +19 -0
- package/dist/core/check-all.d.ts.map +1 -0
- package/dist/core/check-all.js +96 -0
- package/dist/core/check-all.js.map +1 -0
- package/dist/core/combinators.d.ts +48 -0
- package/dist/core/combinators.d.ts.map +1 -0
- package/dist/core/combinators.js +56 -0
- package/dist/core/combinators.js.map +1 -0
- package/dist/core/descendant-cache.d.ts +36 -0
- package/dist/core/descendant-cache.d.ts.map +1 -0
- package/dist/core/descendant-cache.js +119 -0
- package/dist/core/descendant-cache.js.map +1 -0
- package/dist/core/diagnose.d.ts +234 -0
- package/dist/core/diagnose.d.ts.map +1 -0
- package/dist/core/diagnose.js +382 -0
- package/dist/core/diagnose.js.map +1 -0
- package/dist/core/disk-set.d.ts +48 -0
- package/dist/core/disk-set.d.ts.map +1 -0
- package/dist/core/disk-set.js +218 -0
- package/dist/core/disk-set.js.map +1 -0
- package/dist/core/element-cache.d.ts +75 -0
- package/dist/core/element-cache.d.ts.map +1 -0
- package/dist/core/element-cache.js +32 -0
- package/dist/core/element-cache.js.map +1 -0
- package/dist/core/empty-project-advice.d.ts +75 -0
- package/dist/core/empty-project-advice.d.ts.map +1 -0
- package/dist/core/empty-project-advice.js +61 -0
- package/dist/core/empty-project-advice.js.map +1 -0
- package/dist/core/exclusion-comments.d.ts +54 -0
- package/dist/core/exclusion-comments.d.ts.map +1 -0
- package/dist/core/exclusion-comments.js +310 -0
- package/dist/core/exclusion-comments.js.map +1 -0
- package/dist/core/execute-rule.d.ts +150 -0
- package/dist/core/execute-rule.d.ts.map +1 -0
- package/dist/core/execute-rule.js +580 -0
- package/dist/core/execute-rule.js.map +1 -0
- package/dist/core/glob-diagnosis.d.ts +78 -0
- package/dist/core/glob-diagnosis.d.ts.map +1 -0
- package/dist/core/glob-diagnosis.js +134 -0
- package/dist/core/glob-diagnosis.js.map +1 -0
- package/dist/core/glob-evaluator.d.ts +48 -0
- package/dist/core/glob-evaluator.d.ts.map +1 -0
- package/dist/core/glob-evaluator.js +89 -0
- package/dist/core/glob-evaluator.js.map +1 -0
- package/dist/core/import-candidates.d.ts +60 -0
- package/dist/core/import-candidates.d.ts.map +1 -0
- package/dist/core/import-candidates.js +93 -0
- package/dist/core/import-candidates.js.map +1 -0
- package/dist/core/import-options.d.ts +55 -2
- package/dist/core/import-options.d.ts.map +1 -1
- package/dist/core/import-options.js +64 -0
- package/dist/core/import-options.js.map +1 -1
- package/dist/core/line-index.d.ts +3 -0
- package/dist/core/line-index.d.ts.map +1 -0
- package/dist/core/line-index.js +229 -0
- package/dist/core/line-index.js.map +1 -0
- package/dist/core/metric-violation.d.ts +86 -0
- package/dist/core/metric-violation.d.ts.map +1 -0
- package/dist/core/metric-violation.js +132 -0
- package/dist/core/metric-violation.js.map +1 -0
- package/dist/core/module-edges.d.ts +361 -0
- package/dist/core/module-edges.d.ts.map +1 -0
- package/dist/core/module-edges.js +592 -0
- package/dist/core/module-edges.js.map +1 -0
- package/dist/core/object-literal-functions.d.ts +42 -0
- package/dist/core/object-literal-functions.d.ts.map +1 -0
- package/dist/core/object-literal-functions.js +75 -0
- package/dist/core/object-literal-functions.js.map +1 -0
- package/dist/core/orphan-exclusions.d.ts +44 -0
- package/dist/core/orphan-exclusions.d.ts.map +1 -0
- package/dist/core/orphan-exclusions.js +214 -0
- package/dist/core/orphan-exclusions.js.map +1 -0
- package/dist/core/pair-condition.d.ts +32 -3
- package/dist/core/pair-condition.d.ts.map +1 -1
- package/dist/core/path-universe.d.ts +54 -0
- package/dist/core/path-universe.d.ts.map +1 -0
- package/dist/core/path-universe.js +65 -0
- package/dist/core/path-universe.js.map +1 -0
- package/dist/core/per-root-compiler-options.d.ts +20 -0
- package/dist/core/per-root-compiler-options.d.ts.map +1 -0
- package/dist/core/per-root-compiler-options.js +57 -0
- package/dist/core/per-root-compiler-options.js.map +1 -0
- package/dist/core/project-relative.d.ts +98 -0
- package/dist/core/project-relative.d.ts.map +1 -0
- package/dist/core/project-relative.js +185 -0
- package/dist/core/project-relative.js.map +1 -0
- package/dist/core/project.d.ts +7 -1
- package/dist/core/project.d.ts.map +1 -1
- package/dist/core/project.js +24 -0
- package/dist/core/project.js.map +1 -1
- package/dist/core/rule-builder.d.ts +282 -0
- package/dist/core/rule-builder.d.ts.map +1 -0
- package/dist/core/rule-builder.js +445 -0
- package/dist/core/rule-builder.js.map +1 -0
- package/dist/core/rule-declaration.d.ts +32 -0
- package/dist/core/rule-declaration.d.ts.map +1 -0
- package/dist/core/rule-declaration.js +126 -0
- package/dist/core/rule-declaration.js.map +1 -0
- package/dist/core/terminal-builder.d.ts +625 -0
- package/dist/core/terminal-builder.d.ts.map +1 -0
- package/dist/core/terminal-builder.js +787 -0
- package/dist/core/terminal-builder.js.map +1 -0
- package/dist/core/terminal-execution.d.ts +23 -0
- package/dist/core/terminal-execution.d.ts.map +1 -0
- package/dist/core/terminal-execution.js +71 -0
- package/dist/core/terminal-execution.js.map +1 -0
- package/dist/core/vacuity-diagnosis.d.ts +103 -0
- package/dist/core/vacuity-diagnosis.d.ts.map +1 -0
- package/dist/core/vacuity-diagnosis.js +415 -0
- package/dist/core/vacuity-diagnosis.js.map +1 -0
- package/dist/core/violation.d.ts +16 -11
- package/dist/core/violation.d.ts.map +1 -1
- package/dist/core/violation.js +33 -13
- package/dist/core/violation.js.map +1 -1
- package/dist/graphql/index.js +1 -1
- package/dist/graphql/index.js.map +1 -1
- package/dist/graphql/resolver-rule-builder.d.ts +98 -23
- package/dist/graphql/resolver-rule-builder.d.ts.map +1 -1
- package/dist/graphql/resolver-rule-builder.js +151 -21
- package/dist/graphql/resolver-rule-builder.js.map +1 -1
- package/dist/graphql/schema-loader.d.ts +21 -0
- package/dist/graphql/schema-loader.d.ts.map +1 -1
- package/dist/graphql/schema-loader.js +81 -12
- package/dist/graphql/schema-loader.js.map +1 -1
- package/dist/graphql/schema-rule-builder.d.ts +57 -20
- package/dist/graphql/schema-rule-builder.d.ts.map +1 -1
- package/dist/graphql/schema-rule-builder.js +101 -25
- package/dist/graphql/schema-rule-builder.js.map +1 -1
- package/dist/helpers/baseline-diagnostics.d.ts +45 -0
- package/dist/helpers/baseline-diagnostics.d.ts.map +1 -0
- package/dist/helpers/baseline-diagnostics.js +168 -0
- package/dist/helpers/baseline-diagnostics.js.map +1 -0
- package/dist/helpers/baseline-generator.d.ts +19 -0
- package/dist/helpers/baseline-generator.d.ts.map +1 -0
- package/dist/helpers/baseline-generator.js +18 -0
- package/dist/helpers/baseline-generator.js.map +1 -0
- package/dist/helpers/baseline.d.ts +336 -0
- package/dist/helpers/baseline.d.ts.map +1 -0
- package/dist/helpers/baseline.js +664 -0
- package/dist/helpers/baseline.js.map +1 -0
- package/dist/helpers/body-traversal.d.ts +27 -2
- package/dist/helpers/body-traversal.d.ts.map +1 -1
- package/dist/helpers/body-traversal.js +122 -16
- package/dist/helpers/body-traversal.js.map +1 -1
- package/dist/helpers/callback-extractor.d.ts.map +1 -1
- package/dist/helpers/callback-extractor.js +48 -47
- package/dist/helpers/callback-extractor.js.map +1 -1
- package/dist/helpers/complexity.d.ts +13 -5
- package/dist/helpers/complexity.d.ts.map +1 -1
- package/dist/helpers/complexity.js +15 -6
- package/dist/helpers/complexity.js.map +1 -1
- package/dist/helpers/diff-aware.d.ts +44 -0
- package/dist/helpers/diff-aware.d.ts.map +1 -0
- package/dist/helpers/diff-aware.js +84 -0
- package/dist/helpers/diff-aware.js.map +1 -0
- package/dist/helpers/matchers.d.ts +68 -7
- package/dist/helpers/matchers.d.ts.map +1 -1
- package/dist/helpers/matchers.js +114 -20
- package/dist/helpers/matchers.js.map +1 -1
- package/dist/helpers/slice-graph.d.ts +100 -8
- package/dist/helpers/slice-graph.d.ts.map +1 -1
- package/dist/helpers/slice-graph.js +126 -34
- package/dist/helpers/slice-graph.js.map +1 -1
- package/dist/helpers/tarjan.d.ts +0 -14
- package/dist/helpers/tarjan.d.ts.map +1 -1
- package/dist/helpers/tarjan.js +29 -16
- package/dist/helpers/tarjan.js.map +1 -1
- package/dist/index.d.ts +56 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +57 -13
- package/dist/index.js.map +1 -1
- package/dist/models/arch-call.d.ts +3 -2
- package/dist/models/arch-call.d.ts.map +1 -1
- package/dist/models/arch-call.js.map +1 -1
- package/dist/models/arch-function.d.ts +28 -6
- package/dist/models/arch-function.d.ts.map +1 -1
- package/dist/models/arch-function.js +106 -3
- package/dist/models/arch-function.js.map +1 -1
- package/dist/models/arch-jsx-element.js +2 -2
- package/dist/models/arch-jsx-element.js.map +1 -1
- package/dist/models/slice.d.ts +33 -9
- package/dist/models/slice.d.ts.map +1 -1
- package/dist/models/slice.js +129 -19
- package/dist/models/slice.js.map +1 -1
- package/dist/predicates/call.d.ts.map +1 -1
- package/dist/predicates/call.js +5 -0
- package/dist/predicates/call.js.map +1 -1
- package/dist/predicates/identity.d.ts +21 -0
- package/dist/predicates/identity.d.ts.map +1 -1
- package/dist/predicates/identity.js +75 -3
- package/dist/predicates/identity.js.map +1 -1
- package/dist/predicates/index.d.ts +1 -1
- package/dist/predicates/index.d.ts.map +1 -1
- package/dist/predicates/index.js +1 -1
- package/dist/predicates/index.js.map +1 -1
- package/dist/predicates/metrics.d.ts +4 -2
- package/dist/predicates/metrics.d.ts.map +1 -1
- package/dist/predicates/metrics.js +4 -2
- package/dist/predicates/metrics.js.map +1 -1
- package/dist/predicates/module.d.ts +4 -12
- package/dist/predicates/module.d.ts.map +1 -1
- package/dist/predicates/module.js +57 -37
- package/dist/predicates/module.js.map +1 -1
- package/dist/presets/agent-guardrails.d.ts +22 -15
- package/dist/presets/agent-guardrails.d.ts.map +1 -1
- package/dist/presets/agent-guardrails.js +124 -19
- package/dist/presets/agent-guardrails.js.map +1 -1
- package/dist/presets/boundaries.d.ts +45 -2
- package/dist/presets/boundaries.d.ts.map +1 -1
- package/dist/presets/boundaries.js +132 -23
- package/dist/presets/boundaries.js.map +1 -1
- package/dist/presets/data-layer.d.ts +22 -2
- package/dist/presets/data-layer.d.ts.map +1 -1
- package/dist/presets/data-layer.js +58 -16
- package/dist/presets/data-layer.js.map +1 -1
- package/dist/presets/index.d.ts +7 -5
- package/dist/presets/index.d.ts.map +1 -1
- package/dist/presets/index.js +9 -3
- package/dist/presets/index.js.map +1 -1
- package/dist/presets/layered.d.ts +46 -2
- package/dist/presets/layered.d.ts.map +1 -1
- package/dist/presets/layered.js +66 -29
- package/dist/presets/layered.js.map +1 -1
- package/dist/presets/recommended.d.ts +80 -9
- package/dist/presets/recommended.d.ts.map +1 -1
- package/dist/presets/recommended.js +25 -23
- package/dist/presets/recommended.js.map +1 -1
- package/dist/presets/shared.d.ts +270 -2
- package/dist/presets/shared.d.ts.map +1 -1
- package/dist/presets/shared.js +338 -4
- package/dist/presets/shared.js.map +1 -1
- package/dist/rules/code-quality.d.ts.map +1 -1
- package/dist/rules/code-quality.js +15 -6
- package/dist/rules/code-quality.js.map +1 -1
- package/dist/rules/hygiene.d.ts +1 -1
- package/dist/rules/hygiene.js +1 -1
- package/dist/rules/metrics-function.d.ts +2 -1
- package/dist/rules/metrics-function.d.ts.map +1 -1
- package/dist/rules/metrics-function.js +33 -6
- package/dist/rules/metrics-function.js.map +1 -1
- package/dist/rules/metrics.d.ts +2 -1
- package/dist/rules/metrics.d.ts.map +1 -1
- package/dist/rules/metrics.js +39 -9
- package/dist/rules/metrics.js.map +1 -1
- package/dist/smells/duplicate-bodies.d.ts +58 -5
- package/dist/smells/duplicate-bodies.d.ts.map +1 -1
- package/dist/smells/duplicate-bodies.js +137 -56
- package/dist/smells/duplicate-bodies.js.map +1 -1
- package/dist/smells/fingerprint.d.ts +8 -1
- package/dist/smells/fingerprint.d.ts.map +1 -1
- package/dist/smells/fingerprint.js +21 -3
- package/dist/smells/fingerprint.js.map +1 -1
- package/dist/smells/inconsistent-siblings.d.ts +128 -7
- package/dist/smells/inconsistent-siblings.d.ts.map +1 -1
- package/dist/smells/inconsistent-siblings.js +288 -86
- package/dist/smells/inconsistent-siblings.js.map +1 -1
- package/dist/smells/sibling-files.d.ts +47 -0
- package/dist/smells/sibling-files.d.ts.map +1 -0
- package/dist/smells/sibling-files.js +104 -0
- package/dist/smells/sibling-files.js.map +1 -0
- package/dist/smells/similar-pairs.d.ts +27 -0
- package/dist/smells/similar-pairs.d.ts.map +1 -0
- package/dist/smells/similar-pairs.js +52 -0
- package/dist/smells/similar-pairs.js.map +1 -0
- package/dist/smells/smell-builder.d.ts +57 -12
- package/dist/smells/smell-builder.d.ts.map +1 -1
- package/dist/smells/smell-builder.js +111 -14
- package/dist/smells/smell-builder.js.map +1 -1
- package/dist/tsconfig/index.d.ts +19 -0
- package/dist/tsconfig/index.d.ts.map +1 -0
- package/dist/tsconfig/index.js +20 -0
- package/dist/tsconfig/index.js.map +1 -0
- package/dist/tsconfig/tsconfig-builder.d.ts +42 -9
- package/dist/tsconfig/tsconfig-builder.d.ts.map +1 -1
- package/dist/tsconfig/tsconfig-builder.js +64 -16
- package/dist/tsconfig/tsconfig-builder.js.map +1 -1
- package/package.json +3 -2
- package/dist/core/module-dependencies.d.ts +0 -28
- package/dist/core/module-dependencies.d.ts.map +0 -1
- package/dist/core/module-dependencies.js +0 -35
- package/dist/core/module-dependencies.js.map +0 -1
- package/dist/helpers/within.d.ts.map +0 -1
- package/dist/helpers/within.js.map +0 -1
|
@@ -1,17 +1,199 @@
|
|
|
1
|
+
import { setCorrespondence } from '@nielspeter/eess';
|
|
2
|
+
import { UNSUPPRESSABLE } from '@nielspeter/eess';
|
|
3
|
+
import { marksOwnEmptyDiscovery } from '@nielspeter/eess';
|
|
1
4
|
/**
|
|
2
5
|
* Every element in the left layer must have at least one match in the right layer.
|
|
3
6
|
*
|
|
4
7
|
* Produces a violation for each left-layer file that has no matching pair.
|
|
5
8
|
* "Match" is determined by the mapping function provided via `.mapping()`.
|
|
6
9
|
*
|
|
7
|
-
*
|
|
10
|
+
* This is an existence/coverage check, so it shares the set-difference +
|
|
11
|
+
* non-vacuity core (`setCorrespondence`, F2) with `crossProject()` — the two
|
|
12
|
+
* "every X has a matching Y" engines cannot drift, and neither can silently
|
|
13
|
+
* green on an empty side: a left layer that matched **zero** files is a
|
|
14
|
+
* mis-globbed layer that enforces nothing, so it now fails (ADR-008) rather
|
|
15
|
+
* than passing vacuously.
|
|
16
|
+
*
|
|
17
|
+
* @param explicitLayers - Optional, and kept only so existing callers compile.
|
|
18
|
+
* The builder supplies its own resolved layers through the context, and those
|
|
19
|
+
* win — see `PairConditionContext`.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* The finding for a layer that resolved no files, shared by all three conditions.
|
|
23
|
+
*
|
|
24
|
+
* A layer with no files makes every pair through it unchecked, so the condition
|
|
25
|
+
* enforces nothing — [ts-archunit bug 0040](https://github.com/nielspeter/ts-archunit/blob/main/bugs/fixed/0040-a-crosslayer-rule-reports-nothing-when-its-layer-resolves-nothing.md).
|
|
26
|
+
* `haveMatchingCounterpart` guarded this from the start; `haveConsistentExports`
|
|
27
|
+
* and `satisfyPairCondition` did not, and measured **4 violations → 0** on a dead
|
|
28
|
+
* layer. Now one helper, so a fourth condition cannot arrive without it and the
|
|
29
|
+
* three cannot drift.
|
|
30
|
+
*
|
|
31
|
+
* ## Why here and not in the dead-glob gate
|
|
32
|
+
*
|
|
33
|
+
* The gate can see that a `.layer()` glob is dead, and plan 0080 admits discovery
|
|
34
|
+
* globs to it for exactly that reason. But the gate short-circuits before the
|
|
35
|
+
* condition runs, so it would **replace** this finding — and this one is better:
|
|
36
|
+
* it names the layer, and its remedy has been corrected three times to point at
|
|
37
|
+
* the `.layer()` call the reader must edit (bug 0042). `PairFinalBuilder`
|
|
38
|
+
* therefore declares `ownsDiscoveryDiagnosis()`, and the knowledge stays with the
|
|
39
|
+
* code that has it.
|
|
40
|
+
*/
|
|
41
|
+
function emptyLayerFinding(layer, layerCount, context) {
|
|
42
|
+
return {
|
|
43
|
+
rule: context.rule,
|
|
44
|
+
element: layer.name,
|
|
45
|
+
file: '',
|
|
46
|
+
line: 1,
|
|
47
|
+
message: `Layer "${layer.name}" matched 0 files — a pairing over an empty layer enforces nothing. Fix the layer glob.`,
|
|
48
|
+
because: context.because,
|
|
49
|
+
ruleId: context.ruleId,
|
|
50
|
+
// Its own remedy, never the author's (bug 0042, a live recurrence of
|
|
51
|
+
// bug 0021). This used to be `suggestion: context.suggestion` /
|
|
52
|
+
// `docs: context.docs`, which failed two ways at once. With author
|
|
53
|
+
// metadata it printed the author's fix for a real violation as this
|
|
54
|
+
// finding's `Fix:` — measured, an empty-layer finding advising "Split
|
|
55
|
+
// the cycle by extracting a shared module." With none, `suggestion` is
|
|
56
|
+
// optional on `ConditionContext`, so the finding shipped with no remedy
|
|
57
|
+
// at all — the only producer in the census that could. (It said "of the
|
|
58
|
+
// thirteen" until the census grew to fifteen. The count is derived in
|
|
59
|
+
// `tests/core/every-config-finding-is-classified.test.ts`; repeating it
|
|
60
|
+
// here only created something to go stale.)
|
|
61
|
+
//
|
|
62
|
+
// `execute-rule.ts`'s bug-0021 guard cannot help here. It withholds the
|
|
63
|
+
// author's text from producers that leave the field unset; this one
|
|
64
|
+
// assigned it, so there was nothing to withhold. Same escape
|
|
65
|
+
// `correspondence-builder.ts` closed with a producer-side remedy.
|
|
66
|
+
//
|
|
67
|
+
// `ruleId` and `because` are **redundant with enrichment**, which
|
|
68
|
+
// backfills both — removing either leaves the suite green, measured.
|
|
69
|
+
// Kept for locality: a reader of this producer should see the whole
|
|
70
|
+
// finding, and `terminal-builder.ts` documents the same discovery.
|
|
71
|
+
// Neither claims a cause, which is why they are safe to carry where
|
|
72
|
+
// `suggestion` and `docs` are not.
|
|
73
|
+
//
|
|
74
|
+
// The removal clause is COMPUTED, because no fixed text is true for
|
|
75
|
+
// both chain lengths — and the first version of this remedy shipped
|
|
76
|
+
// the false one. "Or remove the layer from the chain" is impossible
|
|
77
|
+
// on a two-layer chain: `.mapping()` throws `RangeError` below two
|
|
78
|
+
// layers (`cross-layer-builder.ts:111`) and this finding cannot fire
|
|
79
|
+
// below two either (`:27`), so the advice was unreachable on exactly
|
|
80
|
+
// the shape that produces it. Measured. That is bug 0017's shape, in
|
|
81
|
+
// the change whose subject was bug 0017's shape — which is the best
|
|
82
|
+
// argument in this file for rule 2's behavioural corollary: a remedy
|
|
83
|
+
// is a claim, and reading well is not evidence.
|
|
84
|
+
//
|
|
85
|
+
// **Third** version of this sentence. Each earlier one was wrong, and
|
|
86
|
+
// each was wrong in a way worth keeping written down:
|
|
87
|
+
//
|
|
88
|
+
// 1. "or remove the layer from the chain" — impossible on a
|
|
89
|
+
// two-layer chain, which is the only shape that produces this
|
|
90
|
+
// finding. Replaced by the computed clause below.
|
|
91
|
+
// 2. "in the `Layer[]` passed to this condition" — true only while
|
|
92
|
+
// the condition judged a caller-supplied copy. Bug 0040 removed
|
|
93
|
+
// that array, so the remedy came to point at something that no
|
|
94
|
+
// longer exists.
|
|
95
|
+
//
|
|
96
|
+
// Both were bug 0017's shape, and neither was catchable by asserting
|
|
97
|
+
// the message's content: the guard checked that it named the layer,
|
|
98
|
+
// which all three versions do. Only applying the fix found them.
|
|
99
|
+
//
|
|
100
|
+
// The glob named here IS now the `.layer()` glob, so the remedy names
|
|
101
|
+
// the call the reader has to edit.
|
|
102
|
+
suggestion: `Fix the .layer("${layer.name}", "${layer.pattern}") glob so it matches at ` +
|
|
103
|
+
`least one file.` +
|
|
104
|
+
(layerCount >= 3
|
|
105
|
+
? ` Or drop the layer: ${String(layerCount - 1)} would remain, still a valid chain.`
|
|
106
|
+
: ` Dropping the layer is not available here — a chain needs two, and this one has` +
|
|
107
|
+
` ${String(layerCount)}. Delete the rule instead if the layer should not exist.`) +
|
|
108
|
+
` Until then every pair through this layer is unchecked, so the rule reports` +
|
|
109
|
+
` nothing whether the code complies or not. ${UNSUPPRESSABLE}`,
|
|
110
|
+
// Config-level meta-finding: no source file, so it must survive
|
|
111
|
+
// diff-aware/baseline or the guard re-greens under standard CI.
|
|
112
|
+
bypassFilters: true,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The finding for a layer set too small to judge, shared by all three conditions.
|
|
117
|
+
*
|
|
118
|
+
* A pair condition needs two layers. Below that all three used to `return []` —
|
|
119
|
+
* **silently**, which is the exact false green this library exists to remove,
|
|
120
|
+
* inside the library. Review measured the divergence that exposed it: with an
|
|
121
|
+
* empty `context.layers` and a two-layer argument, `haveMatchingCounterpart`
|
|
122
|
+
* reported 2 findings and its two siblings reported 0.
|
|
123
|
+
*
|
|
124
|
+
* Unreachable through the DSL — `.mapping()` throws below two layers
|
|
125
|
+
* (`cross-layer-builder.ts:111`) — so this is the direct-`evaluate()` path, which
|
|
126
|
+
* is public: `PairCondition` is an interface external code can call and the
|
|
127
|
+
* conditions are exported. Same reachability as the defect fixed in v0.43.1.
|
|
128
|
+
*
|
|
129
|
+
* A finding rather than a `throw`, because a condition that throws takes down the
|
|
130
|
+
* whole run and this is recoverable information about one rule.
|
|
8
131
|
*/
|
|
9
|
-
|
|
132
|
+
function unusableLayersFinding(count, context) {
|
|
10
133
|
return {
|
|
134
|
+
rule: context.rule,
|
|
135
|
+
element: '(layer set)',
|
|
136
|
+
file: '',
|
|
137
|
+
line: 1,
|
|
138
|
+
message: `A pair condition was evaluated against ${String(count)} layer(s) — it needs two, ` +
|
|
139
|
+
`so it judged nothing.`,
|
|
140
|
+
because: context.because,
|
|
141
|
+
ruleId: context.ruleId,
|
|
142
|
+
// Its own remedy, never the author's (bug 0021/0042).
|
|
143
|
+
suggestion: `Build the rule through crossLayer(project).layer(...).layer(...).mapping(...), which ` +
|
|
144
|
+
`guarantees at least two layers. If you are calling evaluate() directly, pass a ` +
|
|
145
|
+
`PairConditionContext whose \`layers\` holds every layer the pairs were drawn from — ` +
|
|
146
|
+
`with fewer than two there are no pairs to judge, so the condition reports nothing ` +
|
|
147
|
+
`whether the code complies or not. ${UNSUPPRESSABLE}`,
|
|
148
|
+
bypassFilters: true,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
export function haveMatchingCounterpart(explicitLayers) {
|
|
152
|
+
// Registers itself as owning the empty-layer diagnosis (plan 0081).
|
|
153
|
+
return marksOwnEmptyDiscovery({
|
|
11
154
|
description: 'have a matching counterpart in the paired layer',
|
|
12
155
|
evaluate(pairs, context) {
|
|
156
|
+
// The BUILDER's layers by default (bug 0040). The argument is kept, and
|
|
157
|
+
// optional, so every existing caller still compiles — but the context
|
|
158
|
+
// wins, because a hand-built array is a second copy of the builder's
|
|
159
|
+
// resolution and judging the copy is the defect.
|
|
160
|
+
//
|
|
161
|
+
// Note the silent semantic change this implies, and it is the fix rather
|
|
162
|
+
// than a side effect: a caller who deliberately passed a NARROWER array
|
|
163
|
+
// now gets the builder's. Pinned by a precedence test.
|
|
164
|
+
// `>= 2`, not `> 0`. A pair condition needs two layers to mean anything, so
|
|
165
|
+
// a context carrying ONE must not win over a usable argument: with
|
|
166
|
+
// `> 0` it did, and the condition then returned `[]` at the guard below —
|
|
167
|
+
// a silent vacuous pass, which is the class ADR-008 exists for. Measured:
|
|
168
|
+
// context 1 layer + argument 2 layers → 0 findings.
|
|
169
|
+
//
|
|
170
|
+
// Safe for every builder path, and that is why the threshold can move: the
|
|
171
|
+
// builder cannot produce fewer than two, because `.mapping()` throws below
|
|
172
|
+
// two (`cross-layer-builder.ts:111`). So this cannot let the argument win
|
|
173
|
+
// over a real builder resolution — the defect bug 0040 fixed — it only
|
|
174
|
+
// removes the unusable-context case.
|
|
175
|
+
const fromContext = context.layers.length >= 2 ? context.layers : undefined;
|
|
176
|
+
const layers = fromContext ?? explicitLayers ?? [];
|
|
13
177
|
if (layers.length < 2)
|
|
14
|
-
return [];
|
|
178
|
+
return [unusableLayersFinding(layers.length, context)];
|
|
179
|
+
// EVERY layer, before the pair loop — including the last one.
|
|
180
|
+
//
|
|
181
|
+
// This check used to live inside the loop below, which walks `layers[i]` for
|
|
182
|
+
// `i < length - 1`, so the **final** layer was never examined. Bug 0040
|
|
183
|
+
// named that its "missing case" and rated it worse than the silence, and it
|
|
184
|
+
// is: measured on a dead final layer, this condition produced **0**
|
|
185
|
+
// configuration findings and **2** ordinary ones reading *"has no matching
|
|
186
|
+
// counterpart in layer ghost"*. An agent obeying that writes files into a
|
|
187
|
+
// layer whose glob is wrong, they still do not match, and it improvises —
|
|
188
|
+
// bug 0017's shape.
|
|
189
|
+
//
|
|
190
|
+
// Its two siblings already checked all layers, so the three disagreed about
|
|
191
|
+
// the same input. Hoisting it here makes them consistent and closes the
|
|
192
|
+
// missing case with one code path rather than three.
|
|
193
|
+
const empty = layers.filter((layer) => layer.files.length === 0);
|
|
194
|
+
if (empty.length > 0) {
|
|
195
|
+
return empty.map((layer) => emptyLayerFinding(layer, layers.length, context));
|
|
196
|
+
}
|
|
15
197
|
const violations = [];
|
|
16
198
|
// Check consecutive layer pairs
|
|
17
199
|
for (let i = 0; i < layers.length - 1; i++) {
|
|
@@ -26,26 +208,28 @@ export function haveMatchingCounterpart(layers) {
|
|
|
26
208
|
matchedLeftFiles.add(pair.left.getFilePath());
|
|
27
209
|
}
|
|
28
210
|
}
|
|
29
|
-
// Find unmatched left files
|
|
211
|
+
// Find unmatched left files via the shared set-difference core (F2).
|
|
212
|
+
const { missing } = setCorrespondence(leftLayer.files.map((file) => file.getFilePath()), matchedLeftFiles);
|
|
213
|
+
const missingPaths = new Set(missing);
|
|
30
214
|
for (const file of leftLayer.files) {
|
|
31
|
-
if (!
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
215
|
+
if (!missingPaths.has(file.getFilePath()))
|
|
216
|
+
continue;
|
|
217
|
+
violations.push({
|
|
218
|
+
rule: context.rule,
|
|
219
|
+
element: file.getBaseName(),
|
|
220
|
+
file: file.getFilePath(),
|
|
221
|
+
line: 1,
|
|
222
|
+
message: `File "${file.getBaseName()}" in layer "${leftLayer.name}" has no matching counterpart in layer "${rightLayer.name}"`,
|
|
223
|
+
because: context.because,
|
|
224
|
+
ruleId: context.ruleId,
|
|
225
|
+
suggestion: context.suggestion,
|
|
226
|
+
docs: context.docs,
|
|
227
|
+
});
|
|
44
228
|
}
|
|
45
229
|
}
|
|
46
230
|
return violations;
|
|
47
231
|
},
|
|
48
|
-
};
|
|
232
|
+
});
|
|
49
233
|
}
|
|
50
234
|
/**
|
|
51
235
|
* The matched pair must have consistent exported symbol names.
|
|
@@ -54,10 +238,20 @@ export function haveMatchingCounterpart(layers) {
|
|
|
54
238
|
* Every symbol extracted from the left file must appear in the right file.
|
|
55
239
|
*/
|
|
56
240
|
export function haveConsistentExports(extractLeft, extractRight) {
|
|
57
|
-
|
|
241
|
+
// Registers itself as owning the empty-layer diagnosis (plan 0081).
|
|
242
|
+
return marksOwnEmptyDiscovery({
|
|
58
243
|
description: 'have consistent exports between paired layers',
|
|
59
244
|
evaluate(pairs, context) {
|
|
60
245
|
const violations = [];
|
|
246
|
+
// The guard `haveMatchingCounterpart` had and this did not. Measured on a
|
|
247
|
+
// dead left layer: **4 violations → 0**, a false green (bug 0040).
|
|
248
|
+
if (context.layers.length < 2) {
|
|
249
|
+
return [unusableLayersFinding(context.layers.length, context)];
|
|
250
|
+
}
|
|
251
|
+
const empty = context.layers.filter((layer) => layer.files.length === 0);
|
|
252
|
+
if (empty.length > 0) {
|
|
253
|
+
return empty.map((layer) => emptyLayerFinding(layer, context.layers.length, context));
|
|
254
|
+
}
|
|
61
255
|
for (const pair of pairs) {
|
|
62
256
|
const leftSymbols = extractLeft(pair.left);
|
|
63
257
|
const rightSymbols = new Set(extractRight(pair.right));
|
|
@@ -79,7 +273,7 @@ export function haveConsistentExports(extractLeft, extractRight) {
|
|
|
79
273
|
}
|
|
80
274
|
return violations;
|
|
81
275
|
},
|
|
82
|
-
};
|
|
276
|
+
});
|
|
83
277
|
}
|
|
84
278
|
/**
|
|
85
279
|
* Custom pair assertion — shorthand for inline PairCondition.
|
|
@@ -88,9 +282,19 @@ export function haveConsistentExports(extractLeft, extractRight) {
|
|
|
88
282
|
* to signal failure, or `null` if the pair is consistent.
|
|
89
283
|
*/
|
|
90
284
|
export function satisfyPairCondition(description, fn) {
|
|
91
|
-
|
|
285
|
+
// Registers itself as owning the empty-layer diagnosis (plan 0081).
|
|
286
|
+
return marksOwnEmptyDiscovery({
|
|
92
287
|
description,
|
|
93
|
-
evaluate(pairs,
|
|
288
|
+
evaluate(pairs, context) {
|
|
289
|
+
// Same guard, same reason (bug 0040). A custom pair assertion over an empty
|
|
290
|
+
// layer is asserted about nothing, whatever the callback does.
|
|
291
|
+
if (context.layers.length < 2) {
|
|
292
|
+
return [unusableLayersFinding(context.layers.length, context)];
|
|
293
|
+
}
|
|
294
|
+
const empty = context.layers.filter((layer) => layer.files.length === 0);
|
|
295
|
+
if (empty.length > 0) {
|
|
296
|
+
return empty.map((layer) => emptyLayerFinding(layer, context.layers.length, context));
|
|
297
|
+
}
|
|
94
298
|
const violations = [];
|
|
95
299
|
for (const pair of pairs) {
|
|
96
300
|
const result = fn(pair);
|
|
@@ -100,6 +304,6 @@ export function satisfyPairCondition(description, fn) {
|
|
|
100
304
|
}
|
|
101
305
|
return violations;
|
|
102
306
|
},
|
|
103
|
-
};
|
|
307
|
+
});
|
|
104
308
|
}
|
|
105
309
|
//# sourceMappingURL=cross-layer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross-layer.js","sourceRoot":"","sources":["../../src/conditions/cross-layer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cross-layer.js","sourceRoot":"","sources":["../../src/conditions/cross-layer.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAEzD;;;;;;;;;;;;;;;;GAgBG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAS,iBAAiB,CACxB,KAAY,EACZ,UAAkB,EAClB,OAA6B;IAE7B,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,OAAO,EAAE,KAAK,CAAC,IAAI;QACnB,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,CAAC;QACP,OAAO,EAAE,UAAU,KAAK,CAAC,IAAI,yFAAyF;QACtH,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,MAAM,EAAE,OAAO,CAAC,MAAM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|
|
|
3
3
|
export type { ImportOptions } from '../core/import-options.js';
|
|
4
4
|
import type { ImportOptions } from '../core/import-options.js';
|
|
5
5
|
/**
|
|
6
|
-
* Every import in the module must
|
|
7
|
-
*
|
|
6
|
+
* Every import in the module must match at least one of the globs — against its
|
|
7
|
+
* resolved path or, for a non-relative specifier, the specifier as written.
|
|
8
|
+
* Imports that match no glob produce violations.
|
|
8
9
|
*
|
|
9
10
|
* @example
|
|
10
11
|
* modules(p)
|
|
@@ -15,7 +16,8 @@ import type { ImportOptions } from '../core/import-options.js';
|
|
|
15
16
|
export declare function onlyImportFrom(globs: string[], options: ImportOptions): Condition<SourceFile>;
|
|
16
17
|
export declare function onlyImportFrom(...globs: string[]): Condition<SourceFile>;
|
|
17
18
|
/**
|
|
18
|
-
* No import in the module may
|
|
19
|
+
* No import in the module may match any of the globs — against its resolved
|
|
20
|
+
* path or, for a non-relative specifier, the specifier as written.
|
|
19
21
|
* Imports that match a glob produce violations.
|
|
20
22
|
*
|
|
21
23
|
* @example
|
|
@@ -31,9 +33,36 @@ export declare function notImportFrom(...globs: string[]): Condition<SourceFile>
|
|
|
31
33
|
* Completes the import-condition family: onlyImportFrom (all),
|
|
32
34
|
* notImportFrom (none), dependOn (at least one).
|
|
33
35
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
36
|
+
* **Sees every kind of module edge**, not just static imports: `import`,
|
|
37
|
+
* `export … from`, `import()` and `type X = import('…').Y`. (CJS `require` is
|
|
38
|
+
* classified and deliberately not enforced — see `DEPENDENCY_KINDS`.)
|
|
39
|
+
*
|
|
40
|
+
* **What counts as a dependency differs per kind, and the asymmetry is
|
|
41
|
+
* deliberate.** This is the only condition in the library where it does:
|
|
42
|
+
*
|
|
43
|
+
* | edge | satisfies `dependOn`? |
|
|
44
|
+
* | --------------------------------- | ---------------------------------- |
|
|
45
|
+
* | `import { x } from '…'` | yes |
|
|
46
|
+
* | `import type { X } from '…'` | **yes** — unchanged; opt out with `{ ignoreTypeImports: true }` |
|
|
47
|
+
* | `export { x } from '…'` | yes |
|
|
48
|
+
* | `export type { X } from '…'` | **no** — erased, so nothing loads |
|
|
49
|
+
* | `await import('…')` | yes |
|
|
50
|
+
* | `type X = import('…').Y` | **no** — erased |
|
|
51
|
+
*
|
|
52
|
+
* For `kind === 'import'` the behaviour is exactly what it was before v0.28.0:
|
|
53
|
+
* an `import type` of the target satisfies the rule, and `{ ignoreTypeImports:
|
|
54
|
+
* true }` is the shipped opt-in that makes it fail. Requiring runtime there
|
|
55
|
+
* would be a green→red change to a contract that already has an opt-out.
|
|
56
|
+
*
|
|
57
|
+
* For the other kinds it requires **runtime**, because the alternative creates a
|
|
58
|
+
* new false green: `export type { SecurityConfig } from './security.js'` would
|
|
59
|
+
* satisfy `dependOn('**\/security/**')` while the server installs nothing — and
|
|
60
|
+
* on the baseline side that reads as "the violation was fixed".
|
|
61
|
+
*
|
|
62
|
+
* **This is a red→green reversal from v0.27.0.** Before v0.28.0 a runtime
|
|
63
|
+
* re-export or dynamic import left this condition *unsatisfied*, so rules that
|
|
64
|
+
* failed may now pass. That is the fix, not a regression: the dependency was
|
|
65
|
+
* always there and the condition could not see it.
|
|
37
66
|
*
|
|
38
67
|
* @example
|
|
39
68
|
* modules(p)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency.d.ts","sourceRoot":"","sources":["../../src/conditions/dependency.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAqB,MAAM,UAAU,CAAA;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAoB,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"dependency.d.ts","sourceRoot":"","sources":["../../src/conditions/dependency.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAqB,MAAM,UAAU,CAAA;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAoB,MAAM,kBAAkB,CAAA;AAkBnE,YAAY,EAAE,aAAa,EAAE,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