@nielspeter/eess-ts 0.2.1 → 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 +61 -35
- 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 -24
- 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
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import type { GlobNode } from '@nielspeter/eess';
|
|
2
|
+
import type { ArchProject } from './project.js';
|
|
3
|
+
import type { CollectResult } from './terminal-builder.js';
|
|
4
|
+
import type { Predicate } from '@nielspeter/eess';
|
|
5
|
+
import type { Condition, ConditionContext } from '@nielspeter/eess';
|
|
6
|
+
import type { RuleDescription } from '@nielspeter/eess';
|
|
7
|
+
import type { Selection, ElementInfo } from '@nielspeter/eess';
|
|
8
|
+
import { TerminalBuilder } from './terminal-builder.js';
|
|
9
|
+
/**
|
|
10
|
+
* Abstract base class for the predicate/condition rule builders.
|
|
11
|
+
*
|
|
12
|
+
* Concrete entry points (plans 0007+) extend this and:
|
|
13
|
+
* 1. Implement `getElements()` to return the elements to check
|
|
14
|
+
* 2. Add predicate methods that call `addPredicate()`
|
|
15
|
+
* 3. Add condition methods that call `addCondition()`
|
|
16
|
+
*
|
|
17
|
+
* The builder accumulates predicates and conditions. Nothing executes
|
|
18
|
+
* until a terminal method (`.check()`, `.warn()`, `.severity()`) is called.
|
|
19
|
+
*
|
|
20
|
+
* Extends `TerminalBuilder`, which owns everything that is not about the
|
|
21
|
+
* predicate/condition pipeline: `because`, `rule`, `excluding`, `violations`,
|
|
22
|
+
* `check`, `warn`, `asSeverity`, `severity`. Those used to exist twice, once
|
|
23
|
+
* here and once there, and the two copies had already drifted — this class's
|
|
24
|
+
* `excluding()` documented matching against element/file/message while the
|
|
25
|
+
* other still claimed element only, and the more accurate one was the one
|
|
26
|
+
* fewer builders inherited.
|
|
27
|
+
*
|
|
28
|
+
* The cost of the second root was not duplication, it was silent
|
|
29
|
+
* non-coverage: the materialized subject set (plan 0064) and the
|
|
30
|
+
* empty-selector guard (plan 0067) were added here and never reached the
|
|
31
|
+
* seven builders on the other branch. Plan 0069 needs `globs()` to reach all
|
|
32
|
+
* thirteen, so it goes on the root and the root is now singular.
|
|
33
|
+
*/
|
|
34
|
+
export declare abstract class RuleBuilder<T> extends TerminalBuilder {
|
|
35
|
+
protected readonly project: ArchProject;
|
|
36
|
+
protected _predicates: Predicate<T>[];
|
|
37
|
+
protected _conditions: Condition<T>[];
|
|
38
|
+
protected _phase: 'predicate' | 'condition';
|
|
39
|
+
protected _reachedShould: boolean;
|
|
40
|
+
protected _misplaced: string[];
|
|
41
|
+
/** `.expectEmpty()` — plan 0074. Asserts the selection is empty, and fails when it is not. */
|
|
42
|
+
constructor(project: ArchProject);
|
|
43
|
+
/**
|
|
44
|
+
* Begin the predicate phase. Returns a COPY, per bug 0016 — a held selection
|
|
45
|
+
* is never edited by narrowing it. Every ordinary chain is unaffected,
|
|
46
|
+
* because the copy is what the chain continues on; what changed is that
|
|
47
|
+
* `held.that()...` no longer reaches back into `held`.
|
|
48
|
+
* Purely a readability marker — `.that().haveNameMatching(...)` reads like English.
|
|
49
|
+
* Explicitly resets phase to 'predicate' — defensive against `.should().that()` misuse.
|
|
50
|
+
*/
|
|
51
|
+
that(): this;
|
|
52
|
+
/**
|
|
53
|
+
* Add another predicate (AND). Returns `this` for chaining.
|
|
54
|
+
* `.that().extend('Base').and().resideInFolder('src/repos/**')` means both must match.
|
|
55
|
+
*/
|
|
56
|
+
and(): this;
|
|
57
|
+
/**
|
|
58
|
+
* Begin the condition phase. Returns a forked builder for named selection safety.
|
|
59
|
+
* Creates a fresh builder with the same predicates but empty conditions.
|
|
60
|
+
* Sets phase to 'condition' so dual-use methods dispatch correctly.
|
|
61
|
+
*/
|
|
62
|
+
should(): this;
|
|
63
|
+
/**
|
|
64
|
+
* Add another condition that must ALSO pass (AND).
|
|
65
|
+
* `.should().notContain(call('x')).andShould().notContain(call('y'))` means both must hold.
|
|
66
|
+
*/
|
|
67
|
+
andShould(): this;
|
|
68
|
+
/**
|
|
69
|
+
* Plug in a custom predicate or condition.
|
|
70
|
+
*
|
|
71
|
+
* After `.that()` — pass a `Predicate<T>` to filter elements.
|
|
72
|
+
* After `.should()` — pass a `Condition<T>` to assert against filtered elements.
|
|
73
|
+
*
|
|
74
|
+
* Dispatch is structural: if the object has a `test` method it is treated
|
|
75
|
+
* as a predicate; if it has `evaluate` it is treated as a condition.
|
|
76
|
+
*/
|
|
77
|
+
satisfy(custom: Predicate<T> | Condition<T>): this;
|
|
78
|
+
/**
|
|
79
|
+
* Return the predicate-filtered elements as a labelled `Selection<T>` for
|
|
80
|
+
* cross-validation (`crossProject()`). The set is exactly the elements this
|
|
81
|
+
* rule would evaluate — the same filtering `.check()` applies.
|
|
82
|
+
*
|
|
83
|
+
* **Restored in plan 0165 Phase 2.** `select()` is eess's, not upstream's: it
|
|
84
|
+
* is the side of the kernel's two-sided join, and `@nielspeter/eess-crossvalidate`
|
|
85
|
+
* is built entirely on it — four of its five source files failed `tsc` and 33 of
|
|
86
|
+
* its tests failed without it. The wholesale engine copy of plan 0165 dropped it
|
|
87
|
+
* along with the rest of eess's `RuleBuilder`.
|
|
88
|
+
*
|
|
89
|
+
* Stateless by construction, which is why it can live here while the kernel keeps
|
|
90
|
+
* its own copy: it reads `getElements()` and `_predicates` and returns a plain
|
|
91
|
+
* object. The duplication that matters — and that Phase 1 measured breaking — is
|
|
92
|
+
* module-level STATE, not a pure method.
|
|
93
|
+
*
|
|
94
|
+
* @param opts.label - human-readable name of this side ("diagram class")
|
|
95
|
+
* @param opts.identify - map an element to its message metadata (name/file/line)
|
|
96
|
+
*/
|
|
97
|
+
select(opts: {
|
|
98
|
+
label: string;
|
|
99
|
+
identify: (element: T) => ElementInfo;
|
|
100
|
+
}): Selection<T>;
|
|
101
|
+
/** This rule as declared — the input every description and advice reads. */
|
|
102
|
+
private asDeclared;
|
|
103
|
+
/**
|
|
104
|
+
* Return a structured description of this rule without executing it.
|
|
105
|
+
* Used by the `explain` CLI subcommand.
|
|
106
|
+
*/
|
|
107
|
+
describeRule(): RuleDescription;
|
|
108
|
+
/**
|
|
109
|
+
* Return the subject set this rule would evaluate: the elements matched by
|
|
110
|
+
* the predicate chain (`.that()...`), before any condition runs. Executes the
|
|
111
|
+
* predicate filter and returns the materialized set.
|
|
112
|
+
*
|
|
113
|
+
* Distinct from the abstract `getElements()`, which is the *pre-filter*
|
|
114
|
+
* population. This is the materialization contract (F1, plan 0064) that
|
|
115
|
+
* composable primitives build on — `crossProject().side(selection, keyFn)`
|
|
116
|
+
* keys each subject, and `.expectNonEmpty()` (plan 0064+) asserts the set is
|
|
117
|
+
* non-empty. It does not evaluate conditions and never warns about their
|
|
118
|
+
* absence, so it is safe to call on a bare `.that()` selection.
|
|
119
|
+
*
|
|
120
|
+
* Note (ADR-007): the returned `T` is the builder's element type (e.g. a
|
|
121
|
+
* ts-morph `ClassDeclaration` for `classes()`), so this is an acknowledged
|
|
122
|
+
* raw-node seam for callers that derive keys from subjects.
|
|
123
|
+
*/
|
|
124
|
+
subjects(): readonly T[];
|
|
125
|
+
/**
|
|
126
|
+
* The selector and condition globs this rule declares.
|
|
127
|
+
*
|
|
128
|
+
* `position` is derived, not declared: a predicate registered while
|
|
129
|
+
* `_phase` is `'predicate'` is a selector, one registered after `.should()`
|
|
130
|
+
* is a condition. That is a structural fact about where the code is, which
|
|
131
|
+
* is why it is not on `DeclaredGlob` for an author to get wrong.
|
|
132
|
+
*/
|
|
133
|
+
globs(): readonly GlobNode[];
|
|
134
|
+
/**
|
|
135
|
+
* The project this rule was built against.
|
|
136
|
+
*
|
|
137
|
+
* Used by `within()` to create scoped builders, and by `doctor` to find the
|
|
138
|
+
* project to compare globs against — which must be the one the rules
|
|
139
|
+
* actually ran on, not one the CLI guessed at.
|
|
140
|
+
*/
|
|
141
|
+
/**
|
|
142
|
+
* Plan 0074: is EVERY condition satisfied by an empty selection?
|
|
143
|
+
*
|
|
144
|
+
* `.every()`, not `.some()` — `andShould()` ANDs, so a rule reading
|
|
145
|
+
* `.should().notExist().andShould().beExported()` still asserts something
|
|
146
|
+
* about subjects that exist, and exempting it on the strength of one
|
|
147
|
+
* cardinality condition would silence the other. 0069's appendix names this
|
|
148
|
+
* as an implementation constraint; the first cut used `.some()`.
|
|
149
|
+
*
|
|
150
|
+
* An empty condition list is NOT exempt: `[].every()` is `true`, and a rule
|
|
151
|
+
* with no conditions is the assertion-less case that its own gate reports.
|
|
152
|
+
*/
|
|
153
|
+
assertsCardinality(): boolean;
|
|
154
|
+
/**
|
|
155
|
+
* The project this rule was built against.
|
|
156
|
+
*
|
|
157
|
+
* Public because the empty-project and dead-glob findings are constructed by
|
|
158
|
+
* `TerminalBuilder`, which has no project of its own to consult.
|
|
159
|
+
*/
|
|
160
|
+
getProject(): ArchProject;
|
|
161
|
+
/**
|
|
162
|
+
* Whether this rule asserts anything about the elements it selected.
|
|
163
|
+
*
|
|
164
|
+
* `.that()...` with no `.should()` selects a set and then says nothing about
|
|
165
|
+
* it, so it can never fail — proposal 019. Exposed as a method because
|
|
166
|
+
* `_conditions` is protected and `doctor` must not duck-type a private name.
|
|
167
|
+
*
|
|
168
|
+
* **A misplaced predicate disqualifies the rule even when conditions exist**,
|
|
169
|
+
* which `_conditions.length > 0` alone did not. Measured on the shipped 0.23.0
|
|
170
|
+
* branch, and it is the worst shape of the seven rather than a corner:
|
|
171
|
+
*
|
|
172
|
+
* functions(p).that().haveNameMatching(/^parse/).should().notExist().areAsync()
|
|
173
|
+
* subjects 4 -> 0 violations 4 -> 0 diagnose() [] check() passes
|
|
174
|
+
*
|
|
175
|
+
* `areAsync()` after `.should()` lands in `addPredicate` and retroactively
|
|
176
|
+
* narrows the set every condition is evaluated over — here to nothing, so
|
|
177
|
+
* `notExist` holds vacuously. The rule reads as deliberate, its description
|
|
178
|
+
* reads as deliberate, and it certifies nothing. Every other assertion-less
|
|
179
|
+
* shape at least looks unfinished; this one does not, so the author has no
|
|
180
|
+
* reason to look. Under ADR-008 the finding is not optional: the remedy is
|
|
181
|
+
* one method call and nothing about it is a judgement call.
|
|
182
|
+
*/
|
|
183
|
+
assertsSomething(): boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Three assertion-less states, three remedies (plan 0070). Branching on
|
|
186
|
+
* `_reachedShould`/`_misplaced`, never `_phase` — `.should().that()` lands
|
|
187
|
+
* in the predicate phase having reached `.should()`, and would be told a
|
|
188
|
+
* verifiable falsehood by any phase-derived message.
|
|
189
|
+
*/
|
|
190
|
+
assertionAdvice(): string;
|
|
191
|
+
/**
|
|
192
|
+
* The root's collection hook. `evaluate()` is this builder's pipeline —
|
|
193
|
+
* filter by predicates, run conditions, add the empty-selector finding —
|
|
194
|
+
* and the root's terminal methods do the rest.
|
|
195
|
+
*/
|
|
196
|
+
protected collectViolations(): CollectResult;
|
|
197
|
+
/**
|
|
198
|
+
* Units this rule examined — plan 0098: the POST-predicate subjects, which is
|
|
199
|
+
* exactly what `subjects()` returns and what the conditions receive.
|
|
200
|
+
*
|
|
201
|
+
* Public for the same structural reason as `assertsSomething()`: `diagnose()`
|
|
202
|
+
* reads it through a structural interface and a protected member cannot
|
|
203
|
+
* satisfy one. One definition, two readers — `collectViolations()` above and
|
|
204
|
+
* the preview — so the number the gate carries and the number the preview
|
|
205
|
+
* reports cannot drift apart.
|
|
206
|
+
*/
|
|
207
|
+
examinedUnits(): number;
|
|
208
|
+
/**
|
|
209
|
+
* Register a predicate. Called by concrete builder methods like
|
|
210
|
+
* `.haveNameMatching()`, `.extend()`, etc.
|
|
211
|
+
*/
|
|
212
|
+
protected addPredicate(predicate: Predicate<T>): this;
|
|
213
|
+
/**
|
|
214
|
+
* Register a condition. Called by concrete builder methods like
|
|
215
|
+
* `.notContain()`, `.notExist()`, etc.
|
|
216
|
+
*/
|
|
217
|
+
protected addCondition(condition: Condition<T>): this;
|
|
218
|
+
/**
|
|
219
|
+
* Subclasses implement this to return the elements to check.
|
|
220
|
+
* Called lazily during `.check()` / `.warn()`.
|
|
221
|
+
*/
|
|
222
|
+
protected abstract getElements(): T[];
|
|
223
|
+
/**
|
|
224
|
+
* An independent copy, carrying **both** lists. See `TerminalBuilder.copy`.
|
|
225
|
+
*
|
|
226
|
+
* Nothing on this class clears the conditions any more (bug 0020): a rule
|
|
227
|
+
* that asserted something must never be turned into one that asserts nothing
|
|
228
|
+
* by a chain method, which is what `.should()` used to do via `fork()`.
|
|
229
|
+
* `.should().beExported().that().areAsync()` keeps `beExported`, and a second
|
|
230
|
+
* `.should()` accumulates exactly as `.andShould()` does.
|
|
231
|
+
*/
|
|
232
|
+
protected copy(): this;
|
|
233
|
+
/**
|
|
234
|
+
* A copy carrying everything, including the conditions, with `_reason`
|
|
235
|
+
* resolved from metadata. The only caller is `.should()`.
|
|
236
|
+
*
|
|
237
|
+
* **The name is historical.** It used to clear the conditions, which is what
|
|
238
|
+
* distinguished it from `copy()`, and that clearing was
|
|
239
|
+
* [bug 0156](../../../../work/bugs/0156-should-twice-silently-drops-the-first-assertion.md):
|
|
240
|
+
* a second `.should()` on a builder that already carried a condition discarded
|
|
241
|
+
* it, so `.should().notExist().should().beExported()` enforced only the second
|
|
242
|
+
* and lost four findings with no output. Measured. Removed in 0.23.0 —
|
|
243
|
+
* conditions accumulate, and a second `.should()` behaves as `.andShould()`.
|
|
244
|
+
*
|
|
245
|
+
* What is left is `copy()` plus the `_reason` resolution, so the method is now
|
|
246
|
+
* thin enough to inline. It stays because it is `protected` on an exported
|
|
247
|
+
* class: deleting it is a compile break for an external subclass that
|
|
248
|
+
* overrides or calls it, which is the same compatibility argument that keeps
|
|
249
|
+
* `globs()` concrete and `assertsSomething()` exempt-by-default. Do not read
|
|
250
|
+
* the name as a description of the behaviour.
|
|
251
|
+
*/
|
|
252
|
+
protected fork(): this;
|
|
253
|
+
/**
|
|
254
|
+
* Materialize the subject set: all elements narrowed by the predicate chain
|
|
255
|
+
* (the post-`.that()` set), before any condition runs. Shared by the
|
|
256
|
+
* `RuleBuilder` execution pipeline (`evaluate`) and the public `subjects()`
|
|
257
|
+
* accessor so those two cannot diverge (F1). Note: a few builders keep their
|
|
258
|
+
* own separate materialization for other paths (e.g. `CallRuleBuilder`'s
|
|
259
|
+
* `within()` matcher) — those are not routed through here.
|
|
260
|
+
*/
|
|
261
|
+
protected filterElements(): T[];
|
|
262
|
+
/**
|
|
263
|
+
* Build the config-level meta-finding for an empty selector under
|
|
264
|
+
* `.expectNonEmpty()`. A typed literal (no `createViolation` — there is no
|
|
265
|
+
* Node), ADR-005-clean, flagged `bypassFilters` so diff/baseline keep it.
|
|
266
|
+
*/
|
|
267
|
+
private emptySelectionViolation;
|
|
268
|
+
/**
|
|
269
|
+
* Execute the full pipeline: filter elements with predicates,
|
|
270
|
+
* evaluate conditions, return violations.
|
|
271
|
+
*/
|
|
272
|
+
private evaluate;
|
|
273
|
+
/**
|
|
274
|
+
* Build the `ConditionContext` passed to each condition.
|
|
275
|
+
*
|
|
276
|
+
* Subclasses with builder-specific context fields (e.g. `CallRuleBuilder`'s
|
|
277
|
+
* `_identifyByArgument`) override this to extend the base context.
|
|
278
|
+
* Call `super.buildConditionContext()` and spread the result.
|
|
279
|
+
*/
|
|
280
|
+
protected buildConditionContext(): ConditionContext;
|
|
281
|
+
}
|
|
282
|
+
//# sourceMappingURL=rule-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-builder.d.ts","sourceRoot":"","sources":["../../src/core/rule-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EA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