@codeperfect/eslint-plugin 2.0.0 → 2.2.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 +3 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/application/custom-rules.d.ts +8 -8
- package/dist/application/custom-rules.js +14 -14
- package/dist/application/index.d.ts +1 -1
- package/dist/application/index.d.ts.map +1 -1
- package/dist/application/index.js +2 -2
- package/dist/codeperfect-eslint-plugin-1.0.0.tgz +0 -0
- package/dist/domain/architecture/consistent-barrel-files/barrel-file-utilities.d.ts +3 -4
- package/dist/domain/architecture/consistent-barrel-files/barrel-file-utilities.d.ts.map +1 -1
- package/dist/domain/architecture/consistent-barrel-files/barrel-file-utilities.js +5 -3
- package/dist/domain/architecture/consistent-barrel-files/consistent-barrel-files-listeners.d.ts.map +1 -1
- package/dist/domain/architecture/consistent-barrel-files/consistent-barrel-files-listeners.js +17 -7
- package/dist/domain/architecture/consistent-barrel-files/exports-only-rule.d.ts.map +1 -1
- package/dist/domain/architecture/consistent-barrel-files/exports-only-rule.js +36 -4
- package/dist/domain/architecture/consistent-barrel-files/index.d.ts +2 -0
- package/dist/domain/architecture/consistent-barrel-files/index.d.ts.map +1 -1
- package/dist/domain/architecture/consistent-barrel-files/index.js +3 -1
- package/dist/domain/architecture/consistent-barrel-files/no-import-export-aliases-rule.d.ts +5 -0
- package/dist/domain/architecture/consistent-barrel-files/no-import-export-aliases-rule.d.ts.map +1 -0
- package/dist/domain/architecture/consistent-barrel-files/no-import-export-aliases-rule.js +247 -0
- package/dist/domain/architecture/consistent-barrel-files/no-import-export-extensions-rule.d.ts +5 -0
- package/dist/domain/architecture/consistent-barrel-files/no-import-export-extensions-rule.d.ts.map +1 -0
- package/dist/domain/architecture/consistent-barrel-files/no-import-export-extensions-rule.js +136 -0
- package/dist/domain/architecture/consistent-barrel-files/no-reexports-outside-barrels-rule.d.ts.map +1 -1
- package/dist/domain/architecture/consistent-barrel-files/no-reexports-outside-barrels-rule.js +8 -3
- package/dist/domain/architecture/consistent-barrel-files/rule.d.ts.map +1 -1
- package/dist/domain/architecture/consistent-barrel-files/rule.js +12 -5
- package/dist/domain/architecture/index.d.ts +2 -1
- package/dist/domain/architecture/index.d.ts.map +1 -1
- package/dist/domain/architecture/index.js +3 -2
- package/dist/domain/architecture/no-unused-exports/index.d.ts +3 -0
- package/dist/domain/architecture/no-unused-exports/index.d.ts.map +1 -0
- package/dist/domain/architecture/no-unused-exports/index.js +2 -0
- package/dist/domain/architecture/no-unused-exports/no-unused-exports-options.d.ts +50 -0
- package/dist/domain/architecture/no-unused-exports/no-unused-exports-options.d.ts.map +1 -0
- package/dist/domain/architecture/no-unused-exports/no-unused-exports-options.js +141 -0
- package/dist/domain/architecture/no-unused-exports/no-unused-exports-utilities.d.ts +49 -0
- package/dist/domain/architecture/no-unused-exports/no-unused-exports-utilities.d.ts.map +1 -0
- package/dist/domain/architecture/no-unused-exports/no-unused-exports-utilities.js +608 -0
- package/dist/domain/architecture/no-unused-exports/rule.d.ts +5 -0
- package/dist/domain/architecture/no-unused-exports/rule.d.ts.map +1 -0
- package/dist/domain/architecture/no-unused-exports/rule.js +82 -0
- package/dist/domain/architecture/no-unused-exports/types.d.ts +32 -0
- package/dist/domain/architecture/no-unused-exports/types.d.ts.map +1 -0
- package/dist/domain/architecture/no-unused-exports/types.js +2 -0
- package/dist/domain/core/no-multiple-declarators/rule.d.ts.map +1 -1
- package/dist/domain/core/no-multiple-declarators/rule.js +58 -6
- package/dist/domain/core/no-multiple-declarators/types.d.ts +3 -1
- package/dist/domain/core/no-multiple-declarators/types.d.ts.map +1 -1
- package/dist/domain/core/no-multiple-declarators/types.js +5 -2
- package/dist/domain/core/prefer-interface-types/rule.d.ts.map +1 -1
- package/dist/domain/core/prefer-interface-types/rule.js +94 -23
- package/dist/domain/custom-rule-documentation.d.ts +3 -14
- package/dist/domain/custom-rule-documentation.d.ts.map +1 -1
- package/dist/domain/custom-rule-documentation.js +3 -2
- package/dist/domain/docs/no-interface-member-docs/comment-utilities.d.ts.map +1 -1
- package/dist/domain/docs/no-interface-member-docs/comment-utilities.js +11 -2
- package/dist/domain/docs/no-interface-member-docs/parameter-tags.d.ts.map +1 -1
- package/dist/domain/docs/no-interface-member-docs/parameter-tags.js +1 -1
- package/dist/domain/docs/no-interface-member-docs/parameter-utilities.js +1 -1
- package/dist/domain/docs/no-interface-member-docs/rule.d.ts.map +1 -1
- package/dist/domain/docs/no-interface-member-docs/rule.js +12 -4
- package/dist/domain/docs/require-example-language/examples.d.ts +4 -15
- package/dist/domain/docs/require-example-language/examples.d.ts.map +1 -1
- package/dist/domain/docs/require-example-language/examples.js +119 -26
- package/dist/domain/docs/require-example-language/fixes.d.ts +1 -21
- package/dist/domain/docs/require-example-language/fixes.d.ts.map +1 -1
- package/dist/domain/docs/require-example-language/fixes.js +5 -2
- package/dist/domain/docs/require-example-language/reporting.d.ts +2 -38
- package/dist/domain/docs/require-example-language/reporting.d.ts.map +1 -1
- package/dist/domain/docs/require-example-language/reporting.js +2 -2
- package/dist/domain/docs/require-example-language/rule.d.ts.map +1 -1
- package/dist/domain/docs/require-example-language/rule.js +7 -3
- package/dist/domain/docs/require-example-language/types.d.ts +1 -1
- package/dist/domain/docs/require-example-language/types.d.ts.map +1 -1
- package/dist/domain/docs/require-example-language/types.js +1 -1
- package/dist/domain/docs/single-line-jsdoc/rule.d.ts +1 -2
- package/dist/domain/docs/single-line-jsdoc/rule.d.ts.map +1 -1
- package/dist/domain/docs/single-line-jsdoc/rule.js +18 -13
- package/dist/domain/index.d.ts +2 -3
- package/dist/domain/index.d.ts.map +1 -1
- package/dist/domain/index.js +3 -4
- package/dist/domain/testing/aaa/analyzer.analysis.d.ts +2 -78
- package/dist/domain/testing/aaa/analyzer.analysis.d.ts.map +1 -1
- package/dist/domain/testing/aaa/analyzer.analysis.helpers.d.ts +121 -3
- package/dist/domain/testing/aaa/analyzer.analysis.helpers.d.ts.map +1 -1
- package/dist/domain/testing/aaa/analyzer.analysis.helpers.js +199 -4
- package/dist/domain/testing/aaa/analyzer.analysis.js +30 -188
- package/dist/domain/testing/aaa/analyzer.assertions.d.ts +1 -92
- package/dist/domain/testing/aaa/analyzer.assertions.d.ts.map +1 -1
- package/dist/domain/testing/aaa/analyzer.assertions.helpers.d.ts +93 -0
- package/dist/domain/testing/aaa/analyzer.assertions.helpers.d.ts.map +1 -0
- package/dist/domain/testing/aaa/analyzer.assertions.helpers.js +184 -0
- package/dist/domain/testing/aaa/analyzer.assertions.js +5 -283
- package/dist/domain/testing/aaa/analyzer.assertions.operands.d.ts +62 -0
- package/dist/domain/testing/aaa/analyzer.assertions.operands.d.ts.map +1 -0
- package/dist/domain/testing/aaa/analyzer.assertions.operands.js +106 -0
- package/dist/domain/testing/aaa/analyzer.classification.d.ts +1 -74
- package/dist/domain/testing/aaa/analyzer.classification.d.ts.map +1 -1
- package/dist/domain/testing/aaa/analyzer.classification.helpers.d.ts +75 -0
- package/dist/domain/testing/aaa/analyzer.classification.helpers.d.ts.map +1 -0
- package/dist/domain/testing/aaa/analyzer.classification.helpers.js +202 -0
- package/dist/domain/testing/aaa/analyzer.classification.js +5 -201
- package/dist/domain/testing/aaa/analyzer.classification.traversal.d.ts +13 -0
- package/dist/domain/testing/aaa/analyzer.classification.traversal.d.ts.map +1 -0
- package/dist/domain/testing/aaa/analyzer.classification.traversal.js +32 -0
- package/dist/domain/testing/aaa/analyzer.super.d.ts +6 -13
- package/dist/domain/testing/aaa/analyzer.super.d.ts.map +1 -1
- package/dist/domain/testing/aaa/analyzer.super.helpers.d.ts +14 -0
- package/dist/domain/testing/aaa/analyzer.super.helpers.d.ts.map +1 -0
- package/dist/domain/testing/aaa/analyzer.super.helpers.js +64 -0
- package/dist/domain/testing/aaa/analyzer.super.js +29 -61
- package/dist/domain/testing/aaa/index.d.ts +1 -2
- package/dist/domain/testing/aaa/index.d.ts.map +1 -1
- package/dist/domain/testing/aaa/index.js +2 -2
- package/dist/domain/testing/aaa/types.d.ts +1 -1
- package/dist/domain/testing/aaa/types.d.ts.map +1 -1
- package/dist/domain/testing/aaa/types.js +1 -1
- package/dist/domain/testing/assert-actual-expected-names/rule.d.ts.map +1 -1
- package/dist/domain/testing/assert-actual-expected-names/rule.js +33 -5
- package/dist/domain/testing/enforce-aaa-phase-purity/index.d.ts +2 -1
- package/dist/domain/testing/enforce-aaa-phase-purity/index.d.ts.map +1 -1
- package/dist/domain/testing/enforce-aaa-phase-purity/index.js +3 -2
- package/dist/domain/testing/enforce-aaa-phase-purity/phase-purity-identifiers.d.ts +1 -1
- package/dist/domain/testing/enforce-aaa-phase-purity/phase-purity-identifiers.d.ts.map +1 -1
- package/dist/domain/testing/enforce-aaa-phase-purity/phase-purity-identifiers.js +1 -1
- package/dist/domain/testing/enforce-aaa-phase-purity/phase-purity-reporting.d.ts +1 -1
- package/dist/domain/testing/enforce-aaa-phase-purity/phase-purity-reporting.d.ts.map +1 -1
- package/dist/domain/testing/enforce-aaa-phase-purity/phase-purity-reporting.js +78 -16
- package/dist/domain/testing/{require-aaa-sections → enforce-aaa-structure}/missing-section-fixes.d.ts +1 -1
- package/dist/domain/testing/enforce-aaa-structure/missing-section-fixes.d.ts.map +1 -0
- package/dist/domain/testing/enforce-aaa-structure/missing-section-fixes.js +150 -0
- package/dist/domain/testing/enforce-aaa-structure/rule.d.ts.map +1 -1
- package/dist/domain/testing/enforce-aaa-structure/rule.js +165 -3
- package/dist/domain/testing/index.d.ts +0 -3
- package/dist/domain/testing/index.d.ts.map +1 -1
- package/dist/domain/testing/index.js +1 -4
- package/dist/domain/testing/prefer-vi-mocked-import/fix-import-statements.d.ts +1 -15
- package/dist/domain/testing/prefer-vi-mocked-import/fix-import-statements.d.ts.map +1 -1
- package/dist/domain/testing/prefer-vi-mocked-import/fix-import-statements.js +2 -71
- package/dist/domain/testing/prefer-vi-mocked-import/fix-imports.d.ts.map +1 -1
- package/dist/domain/testing/prefer-vi-mocked-import/fix-imports.js +4 -2
- package/dist/domain/testing/prefer-vi-mocked-import/fix.d.ts +1 -13
- package/dist/domain/testing/prefer-vi-mocked-import/fix.d.ts.map +1 -1
- package/dist/domain/testing/prefer-vi-mocked-import/fix.js +3 -21
- package/dist/domain/testing/prefer-vi-mocked-import/match-bindings.d.ts.map +1 -1
- package/dist/domain/testing/prefer-vi-mocked-import/match-bindings.js +2 -1
- package/dist/domain/testing/prefer-vi-mocked-import/match-declarations.d.ts.map +1 -1
- package/dist/domain/testing/prefer-vi-mocked-import/match-declarations.js +1 -1
- package/dist/domain/testing/prefer-vi-mocked-import/match-rewrites.js +6 -6
- package/dist/domain/testing/prefer-vi-mocked-import/match.d.ts +1 -12
- package/dist/domain/testing/prefer-vi-mocked-import/match.d.ts.map +1 -1
- package/dist/domain/testing/prefer-vi-mocked-import/match.js +149 -15
- package/dist/domain/testing/prefer-vi-mocked-import/rule.d.ts.map +1 -1
- package/dist/domain/testing/prefer-vi-mocked-import/rule.js +6 -3
- package/dist/domain/testing/require-act-result-capture/rule.d.ts.map +1 -1
- package/dist/domain/testing/require-act-result-capture/rule.js +42 -10
- package/dist/domain/testing/require-test-companion/index.d.ts +0 -1
- package/dist/domain/testing/require-test-companion/index.d.ts.map +1 -1
- package/dist/domain/testing/require-test-companion/index.js +1 -2
- package/dist/domain/testing/require-test-companion/require-test-companion-listeners.d.ts +2 -1
- package/dist/domain/testing/require-test-companion/require-test-companion-listeners.d.ts.map +1 -1
- package/dist/domain/testing/require-test-companion/require-test-companion-listeners.js +13 -58
- package/dist/domain/testing/require-test-companion/require-test-companion-options.d.ts +2 -1
- package/dist/domain/testing/require-test-companion/require-test-companion-options.d.ts.map +1 -1
- package/dist/domain/testing/require-test-companion/require-test-companion-options.js +6 -5
- package/dist/domain/testing/require-test-companion/rule.d.ts.map +1 -1
- package/dist/domain/testing/require-test-companion/rule.js +34 -9
- package/dist/domain/testing/single-act-statement/rule.d.ts.map +1 -1
- package/dist/domain/testing/single-act-statement/rule.js +11 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/infrastructure/codeperfect-plugin.d.ts +6 -6
- package/dist/infrastructure/codeperfect-plugin.js +5 -5
- package/dist/infrastructure/presets.d.ts.map +1 -1
- package/dist/infrastructure/presets.js +23 -7
- package/package.json +37 -38
- package/dist/domain/architecture/consistent-barrel-files/exports-only-rule-test-utilities.d.ts +0 -41
- package/dist/domain/architecture/consistent-barrel-files/exports-only-rule-test-utilities.d.ts.map +0 -1
- package/dist/domain/architecture/consistent-barrel-files/exports-only-rule-test-utilities.js +0 -87
- package/dist/domain/architecture/consistent-barrel-files/no-reexports-outside-barrels-test-utilities.d.ts +0 -40
- package/dist/domain/architecture/consistent-barrel-files/no-reexports-outside-barrels-test-utilities.d.ts.map +0 -1
- package/dist/domain/architecture/consistent-barrel-files/no-reexports-outside-barrels-test-utilities.js +0 -91
- package/dist/domain/architecture/consistent-barrel-files/rule.repeat-runs.d.ts +0 -4
- package/dist/domain/architecture/consistent-barrel-files/rule.repeat-runs.d.ts.map +0 -1
- package/dist/domain/architecture/consistent-barrel-files/rule.repeat-runs.js +0 -4
- package/dist/domain/architecture/consistent-barrel-files/test-helpers.d.ts +0 -141
- package/dist/domain/architecture/consistent-barrel-files/test-helpers.d.ts.map +0 -1
- package/dist/domain/architecture/consistent-barrel-files/test-helpers.file-writers.d.ts +0 -20
- package/dist/domain/architecture/consistent-barrel-files/test-helpers.file-writers.d.ts.map +0 -1
- package/dist/domain/architecture/consistent-barrel-files/test-helpers.file-writers.js +0 -25
- package/dist/domain/architecture/consistent-barrel-files/test-helpers.js +0 -235
- package/dist/domain/core/no-multiple-declarators/rule-test-helpers.d.ts +0 -101
- package/dist/domain/core/no-multiple-declarators/rule-test-helpers.d.ts.map +0 -1
- package/dist/domain/core/no-multiple-declarators/rule-test-helpers.js +0 -108
- package/dist/domain/core/no-multiple-declarators/rule.fixes.d.ts +0 -35
- package/dist/domain/core/no-multiple-declarators/rule.fixes.d.ts.map +0 -1
- package/dist/domain/core/no-multiple-declarators/rule.fixes.js +0 -95
- package/dist/domain/core/no-multiple-declarators/rule.guardrails.d.ts +0 -4
- package/dist/domain/core/no-multiple-declarators/rule.guardrails.d.ts.map +0 -1
- package/dist/domain/core/no-multiple-declarators/rule.guardrails.js +0 -4
- package/dist/domain/core/no-multiple-declarators/rule.mocked-types.d.ts +0 -4
- package/dist/domain/core/no-multiple-declarators/rule.mocked-types.d.ts.map +0 -1
- package/dist/domain/core/no-multiple-declarators/rule.mocked-types.js +0 -4
- package/dist/domain/core/prefer-interface-types/test-helpers.d.ts +0 -110
- package/dist/domain/core/prefer-interface-types/test-helpers.d.ts.map +0 -1
- package/dist/domain/core/prefer-interface-types/test-helpers.js +0 -116
- package/dist/domain/docs/no-interface-member-docs/comment-utilities-test-helpers.d.ts +0 -89
- package/dist/domain/docs/no-interface-member-docs/comment-utilities-test-helpers.d.ts.map +0 -1
- package/dist/domain/docs/no-interface-member-docs/comment-utilities-test-helpers.js +0 -129
- package/dist/domain/docs/no-interface-member-docs/test-helpers.d.ts +0 -103
- package/dist/domain/docs/no-interface-member-docs/test-helpers.d.ts.map +0 -1
- package/dist/domain/docs/no-interface-member-docs/test-helpers.js +0 -157
- package/dist/domain/docs/require-example-language/create-fixer.d.ts +0 -5
- package/dist/domain/docs/require-example-language/create-fixer.d.ts.map +0 -1
- package/dist/domain/docs/require-example-language/create-fixer.js +0 -5
- package/dist/domain/docs/single-line-jsdoc/rule.edge-cases.d.ts +0 -4
- package/dist/domain/docs/single-line-jsdoc/rule.edge-cases.d.ts.map +0 -1
- package/dist/domain/docs/single-line-jsdoc/rule.edge-cases.js +0 -5
- package/dist/domain/docs/single-line-jsdoc/rule.node-lookups.d.ts +0 -4
- package/dist/domain/docs/single-line-jsdoc/rule.node-lookups.d.ts.map +0 -1
- package/dist/domain/docs/single-line-jsdoc/rule.node-lookups.js +0 -5
- package/dist/domain/docs/test-helpers.d.ts +0 -50
- package/dist/domain/docs/test-helpers.d.ts.map +0 -1
- package/dist/domain/docs/test-helpers.js +0 -107
- package/dist/domain/testing/aaa/analyzer.classification.member-patterns.d.ts +0 -9
- package/dist/domain/testing/aaa/analyzer.classification.member-patterns.d.ts.map +0 -1
- package/dist/domain/testing/aaa/analyzer.classification.member-patterns.js +0 -10
- package/dist/domain/testing/aaa/analyzer.d.ts +0 -46
- package/dist/domain/testing/aaa/analyzer.d.ts.map +0 -1
- package/dist/domain/testing/aaa/analyzer.js +0 -59
- package/dist/domain/testing/enforce-aaa-phase-purity/phase-purity-reporting.behavior.d.ts +0 -4
- package/dist/domain/testing/enforce-aaa-phase-purity/phase-purity-reporting.behavior.d.ts.map +0 -1
- package/dist/domain/testing/enforce-aaa-phase-purity/phase-purity-reporting.behavior.js +0 -4
- package/dist/domain/testing/enforce-aaa-phase-purity/rule-test-helpers.d.ts +0 -42
- package/dist/domain/testing/enforce-aaa-phase-purity/rule-test-helpers.d.ts.map +0 -1
- package/dist/domain/testing/enforce-aaa-phase-purity/rule-test-helpers.js +0 -188
- package/dist/domain/testing/enforce-aaa-phase-purity/rule.d.ts +0 -5
- package/dist/domain/testing/enforce-aaa-phase-purity/rule.d.ts.map +0 -1
- package/dist/domain/testing/enforce-aaa-phase-purity/rule.js +0 -34
- package/dist/domain/testing/prefer-vi-mocked-import/rule-test-helpers.d.ts +0 -20
- package/dist/domain/testing/prefer-vi-mocked-import/rule-test-helpers.d.ts.map +0 -1
- package/dist/domain/testing/prefer-vi-mocked-import/rule-test-helpers.js +0 -39
- package/dist/domain/testing/prefer-vitest-incremental-casts/ast-helpers.d.ts +0 -86
- package/dist/domain/testing/prefer-vitest-incremental-casts/ast-helpers.d.ts.map +0 -1
- package/dist/domain/testing/prefer-vitest-incremental-casts/ast-helpers.js +0 -150
- package/dist/domain/testing/prefer-vitest-incremental-casts/index.d.ts +0 -2
- package/dist/domain/testing/prefer-vitest-incremental-casts/index.d.ts.map +0 -1
- package/dist/domain/testing/prefer-vitest-incremental-casts/index.js +0 -2
- package/dist/domain/testing/prefer-vitest-incremental-casts/match-input.d.ts +0 -14
- package/dist/domain/testing/prefer-vitest-incremental-casts/match-input.d.ts.map +0 -1
- package/dist/domain/testing/prefer-vitest-incremental-casts/match-input.js +0 -81
- package/dist/domain/testing/prefer-vitest-incremental-casts/match.d.ts +0 -13
- package/dist/domain/testing/prefer-vitest-incremental-casts/match.d.ts.map +0 -1
- package/dist/domain/testing/prefer-vitest-incremental-casts/match.js +0 -189
- package/dist/domain/testing/prefer-vitest-incremental-casts/replacement-helpers.d.ts +0 -25
- package/dist/domain/testing/prefer-vitest-incremental-casts/replacement-helpers.d.ts.map +0 -1
- package/dist/domain/testing/prefer-vitest-incremental-casts/replacement-helpers.js +0 -92
- package/dist/domain/testing/prefer-vitest-incremental-casts/rule-test-helpers.d.ts +0 -32
- package/dist/domain/testing/prefer-vitest-incremental-casts/rule-test-helpers.d.ts.map +0 -1
- package/dist/domain/testing/prefer-vitest-incremental-casts/rule-test-helpers.js +0 -164
- package/dist/domain/testing/prefer-vitest-incremental-casts/rule.d.ts +0 -5
- package/dist/domain/testing/prefer-vitest-incremental-casts/rule.d.ts.map +0 -1
- package/dist/domain/testing/prefer-vitest-incremental-casts/rule.guardrails.d.ts +0 -4
- package/dist/domain/testing/prefer-vitest-incremental-casts/rule.guardrails.d.ts.map +0 -1
- package/dist/domain/testing/prefer-vitest-incremental-casts/rule.guardrails.js +0 -4
- package/dist/domain/testing/prefer-vitest-incremental-casts/rule.input-shapes.d.ts +0 -4
- package/dist/domain/testing/prefer-vitest-incremental-casts/rule.input-shapes.d.ts.map +0 -1
- package/dist/domain/testing/prefer-vitest-incremental-casts/rule.input-shapes.js +0 -4
- package/dist/domain/testing/prefer-vitest-incremental-casts/rule.js +0 -62
- package/dist/domain/testing/prefer-vitest-incremental-casts/rule.signature-fallback.d.ts +0 -4
- package/dist/domain/testing/prefer-vitest-incremental-casts/rule.signature-fallback.d.ts.map +0 -1
- package/dist/domain/testing/prefer-vitest-incremental-casts/rule.signature-fallback.js +0 -4
- package/dist/domain/testing/prefer-vitest-incremental-casts/type-helpers.d.ts +0 -24
- package/dist/domain/testing/prefer-vitest-incremental-casts/type-helpers.d.ts.map +0 -1
- package/dist/domain/testing/prefer-vitest-incremental-casts/type-helpers.js +0 -113
- package/dist/domain/testing/prefer-vitest-incremental-casts/type-shape-helpers.d.ts +0 -36
- package/dist/domain/testing/prefer-vitest-incremental-casts/type-shape-helpers.d.ts.map +0 -1
- package/dist/domain/testing/prefer-vitest-incremental-casts/type-shape-helpers.js +0 -138
- package/dist/domain/testing/prefer-vitest-incremental-casts/types.d.ts +0 -203
- package/dist/domain/testing/prefer-vitest-incremental-casts/types.d.ts.map +0 -1
- package/dist/domain/testing/prefer-vitest-incremental-casts/types.js +0 -2
- package/dist/domain/testing/require-aaa-sections/index.d.ts +0 -2
- package/dist/domain/testing/require-aaa-sections/index.d.ts.map +0 -1
- package/dist/domain/testing/require-aaa-sections/index.js +0 -2
- package/dist/domain/testing/require-aaa-sections/missing-section-fixes.d.ts.map +0 -1
- package/dist/domain/testing/require-aaa-sections/missing-section-fixes.js +0 -150
- package/dist/domain/testing/require-aaa-sections/rule.d.ts +0 -5
- package/dist/domain/testing/require-aaa-sections/rule.d.ts.map +0 -1
- package/dist/domain/testing/require-aaa-sections/rule.js +0 -129
- package/dist/domain/testing/require-aaa-sections/rule.reporting.d.ts +0 -104
- package/dist/domain/testing/require-aaa-sections/rule.reporting.d.ts.map +0 -1
- package/dist/domain/testing/require-aaa-sections/rule.reporting.js +0 -217
- package/dist/domain/testing/require-test-companion/require-test-companion-test-helpers.d.ts +0 -51
- package/dist/domain/testing/require-test-companion/require-test-companion-test-helpers.d.ts.map +0 -1
- package/dist/domain/testing/require-test-companion/require-test-companion-test-helpers.js +0 -184
- package/dist/domain/testing/require-test-companion/require-test-companion-utilities.d.ts +0 -28
- package/dist/domain/testing/require-test-companion/require-test-companion-utilities.d.ts.map +0 -1
- package/dist/domain/testing/require-test-companion/require-test-companion-utilities.js +0 -26
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { NoUnusedExportsState } from "./types.js";
|
|
2
|
+
/** Default public API files where exported symbols are intentionally exposed. */
|
|
3
|
+
export declare const DEFAULT_PUBLIC_API_FILES: readonly ["**/src/index.ts", "**/__tests__/**/*.ts"];
|
|
4
|
+
/** Default glob patterns used to classify test files. */
|
|
5
|
+
export declare const DEFAULT_TEST_FILE_PATTERNS: readonly ["**/*.{test,spec,e2e}.ts", "**/__tests__/**/*.ts"];
|
|
6
|
+
/**
|
|
7
|
+
* Checks whether one file path is lintable.
|
|
8
|
+
* @param filename Input filename.
|
|
9
|
+
* @returns True when the path is absolute and matches source-file scope.
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const ok = isLintableFilename("/repo/src/feature.ts");
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare const isLintableFilename: (filename: string) => boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Builds normalized options from raw rule options.
|
|
18
|
+
* @param options Raw rule options.
|
|
19
|
+
* @returns Normalized options state.
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const state = getOptions([{}]);
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare const getOptions: (options: readonly unknown[]) => NoUnusedExportsState;
|
|
26
|
+
/**
|
|
27
|
+
* Checks whether one file defines a public API export surface.
|
|
28
|
+
* @param filename Absolute filename.
|
|
29
|
+
* @param state Normalized options.
|
|
30
|
+
* @param repoRoot Absolute repository root.
|
|
31
|
+
* @returns True when the file is a public API file.
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const publicApiFile = isPublicApiFile("/repo/src/index.ts", state, "/repo");
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare const isPublicApiFile: (filename: string, state: NoUnusedExportsState, repoRoot: string) => boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Checks whether one file should be treated as a test file.
|
|
40
|
+
* @param filename Absolute filename.
|
|
41
|
+
* @param state Normalized options.
|
|
42
|
+
* @param repoRoot Absolute repository root.
|
|
43
|
+
* @returns True when the file path matches a test pattern.
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* const testFile = isTestFile("/repo/tests/e2e/demo.ts", state, "/repo");
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare const isTestFile: (filename: string, state: NoUnusedExportsState, repoRoot: string) => boolean;
|
|
50
|
+
//# sourceMappingURL=no-unused-exports-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-unused-exports-options.d.ts","sourceRoot":"","sources":["../../../../src/domain/architecture/no-unused-exports/no-unused-exports-options.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAA0B,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE5E,iFAAiF;AACjF,eAAO,MAAM,wBAAwB,sDAG3B,CAAC;AAEX,yDAAyD;AACzD,eAAO,MAAM,0BAA0B,8DAG7B,CAAC;AAiBX;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,GAAI,UAAU,MAAM,KAAG,OAUrD,CAAC;AA4BF;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,GACrB,SAAS,SAAS,OAAO,EAAE,KAC1B,oBAaF,CAAC;AAwDF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,GAC1B,UAAU,MAAM,EAChB,OAAO,oBAAoB,EAC3B,UAAU,MAAM,KACf,OAAsE,CAAC;AAE1E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,GACrB,UAAU,MAAM,EAChB,OAAO,oBAAoB,EAC3B,UAAU,MAAM,KACf,OAAwE,CAAC"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { minimatch } from "minimatch";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
/** Default public API files where exported symbols are intentionally exposed. */
|
|
4
|
+
export const DEFAULT_PUBLIC_API_FILES = [
|
|
5
|
+
"**/src/index.ts",
|
|
6
|
+
"**/__tests__/**/*.ts",
|
|
7
|
+
];
|
|
8
|
+
/** Default glob patterns used to classify test files. */
|
|
9
|
+
export const DEFAULT_TEST_FILE_PATTERNS = [
|
|
10
|
+
"**/*.{test,spec,e2e}.ts",
|
|
11
|
+
"**/__tests__/**/*.ts",
|
|
12
|
+
];
|
|
13
|
+
/** Default file pattern used to scope analysis to source files. */
|
|
14
|
+
const DEFAULT_LINTABLE_FILE_PATTERN = "**/src/**/*.ts";
|
|
15
|
+
/**
|
|
16
|
+
* Checks whether one path is absolute and non-empty.
|
|
17
|
+
* @param filename Input filename.
|
|
18
|
+
* @returns True when the path is absolute and non-empty.
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const ok = isAbsolutePath("/repo/src/feature.ts");
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
const isAbsolutePath = (filename) => filename.length > 0 && path.isAbsolute(filename);
|
|
25
|
+
/**
|
|
26
|
+
* Checks whether one file path is lintable.
|
|
27
|
+
* @param filename Input filename.
|
|
28
|
+
* @returns True when the path is absolute and matches source-file scope.
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* const ok = isLintableFilename("/repo/src/feature.ts");
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export const isLintableFilename = (filename) => {
|
|
35
|
+
if (!isAbsolutePath(filename)) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
const normalizedPath = filename.split(path.sep).join("/");
|
|
39
|
+
return minimatch(normalizedPath, DEFAULT_LINTABLE_FILE_PATTERN, {
|
|
40
|
+
dot: true,
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Normalizes one rule option value into a string list.
|
|
45
|
+
* @param value Raw option value.
|
|
46
|
+
* @param defaults Default values.
|
|
47
|
+
* @returns Normalized list.
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* const list = normalizeStringList(["src/**"], ["src/**"]);
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
const normalizeStringList = (value, defaults) => {
|
|
54
|
+
if (Array.isArray(value)) {
|
|
55
|
+
const normalized = value
|
|
56
|
+
.filter((entry) => typeof entry === "string")
|
|
57
|
+
.map((entry) => entry.trim())
|
|
58
|
+
.filter((entry) => entry.length > 0);
|
|
59
|
+
return normalized.length > 0 ? normalized : [...defaults];
|
|
60
|
+
}
|
|
61
|
+
return [...defaults];
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Builds normalized options from raw rule options.
|
|
65
|
+
* @param options Raw rule options.
|
|
66
|
+
* @returns Normalized options state.
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const state = getOptions([{}]);
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export const getOptions = (options) => {
|
|
73
|
+
const raw = options[0];
|
|
74
|
+
return {
|
|
75
|
+
publicApiFiles: normalizeStringList(raw?.publicApiFiles, DEFAULT_PUBLIC_API_FILES),
|
|
76
|
+
testFilePatterns: normalizeStringList(raw?.testFilePatterns, DEFAULT_TEST_FILE_PATTERNS),
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Converts an absolute filename into a repo-root-relative POSIX path.
|
|
81
|
+
* @param filename Absolute filename.
|
|
82
|
+
* @param repoRoot Absolute repository root.
|
|
83
|
+
* @returns Repo-relative POSIX path or undefined when outside repo root.
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* const relativePath = toRepoRelativePosixPath("/repo/src/feature.ts", "/repo");
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
const toRepoRelativePosixPath = (filename, repoRoot) => {
|
|
90
|
+
if (!isAbsolutePath(filename) || !isAbsolutePath(repoRoot)) {
|
|
91
|
+
return void 0;
|
|
92
|
+
}
|
|
93
|
+
const relativePath = path.relative(repoRoot, filename);
|
|
94
|
+
if (relativePath.startsWith("..") || path.isAbsolute(relativePath)) {
|
|
95
|
+
return void 0;
|
|
96
|
+
}
|
|
97
|
+
return relativePath.split(path.sep).join("/");
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Checks whether one filename matches any glob pattern.
|
|
101
|
+
* @param filename Absolute filename.
|
|
102
|
+
* @param patterns Glob patterns.
|
|
103
|
+
* @param repoRoot Absolute repository root.
|
|
104
|
+
* @returns True when any pattern matches.
|
|
105
|
+
* @example
|
|
106
|
+
* ```typescript
|
|
107
|
+
* const match = matchesAnyPattern("/repo/src/index.ts", ["src-pattern"], "/repo");
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
const matchesAnyPattern = (filename, patterns, repoRoot) => {
|
|
111
|
+
const relativePath = toRepoRelativePosixPath(filename, repoRoot);
|
|
112
|
+
if (relativePath === void 0 || patterns.length === 0) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
return patterns.some((pattern) => minimatch(relativePath, pattern, { dot: true }));
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Checks whether one file defines a public API export surface.
|
|
119
|
+
* @param filename Absolute filename.
|
|
120
|
+
* @param state Normalized options.
|
|
121
|
+
* @param repoRoot Absolute repository root.
|
|
122
|
+
* @returns True when the file is a public API file.
|
|
123
|
+
* @example
|
|
124
|
+
* ```typescript
|
|
125
|
+
* const publicApiFile = isPublicApiFile("/repo/src/index.ts", state, "/repo");
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
export const isPublicApiFile = (filename, state, repoRoot) => matchesAnyPattern(filename, state.publicApiFiles, repoRoot);
|
|
129
|
+
/**
|
|
130
|
+
* Checks whether one file should be treated as a test file.
|
|
131
|
+
* @param filename Absolute filename.
|
|
132
|
+
* @param state Normalized options.
|
|
133
|
+
* @param repoRoot Absolute repository root.
|
|
134
|
+
* @returns True when the file path matches a test pattern.
|
|
135
|
+
* @example
|
|
136
|
+
* ```typescript
|
|
137
|
+
* const testFile = isTestFile("/repo/tests/e2e/demo.ts", state, "/repo");
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
export const isTestFile = (filename, state, repoRoot) => matchesAnyPattern(filename, state.testFilePatterns, repoRoot);
|
|
141
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm8tdW51c2VkLWV4cG9ydHMtb3B0aW9ucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9kb21haW4vYXJjaGl0ZWN0dXJlL25vLXVudXNlZC1leHBvcnRzL25vLXVudXNlZC1leHBvcnRzLW9wdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLFdBQVcsQ0FBQztBQUN0QyxPQUFPLElBQUksTUFBTSxXQUFXLENBQUM7QUFJN0IsaUZBQWlGO0FBQ2pGLE1BQU0sQ0FBQyxNQUFNLHdCQUF3QixHQUFHO0lBQ3RDLGlCQUFpQjtJQUNqQixzQkFBc0I7Q0FDZCxDQUFDO0FBRVgseURBQXlEO0FBQ3pELE1BQU0sQ0FBQyxNQUFNLDBCQUEwQixHQUFHO0lBQ3hDLHlCQUF5QjtJQUN6QixzQkFBc0I7Q0FDZCxDQUFDO0FBRVgsbUVBQW1FO0FBQ25FLE1BQU0sNkJBQTZCLEdBQUcsZ0JBQWdCLENBQUM7QUFFdkQ7Ozs7Ozs7O0dBUUc7QUFDSCxNQUFNLGNBQWMsR0FBRyxDQUFDLFFBQWdCLEVBQVcsRUFBRSxDQUNuRCxRQUFRLENBQUMsTUFBTSxHQUFHLENBQUMsSUFBSSxJQUFJLENBQUMsVUFBVSxDQUFDLFFBQVEsQ0FBQyxDQUFDO0FBRW5EOzs7Ozs7OztHQVFHO0FBQ0gsTUFBTSxDQ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sXG4gIHJlcG9Sb290OiBzdHJpbmcsXG4pOiBib29sZWFuID0+IG1hdGNoZXNBbnlQYXR0ZXJuKGZpbGVuYW1lLCBzdGF0ZS5wdWJsaWNBcGlGaWxlcywgcmVwb1Jvb3QpO1xuXG4vKipcbiAqIENoZWNrcyB3aGV0aGVyIG9uZSBmaWxlIHNob3VsZCBiZSB0cmVhdGVkIGFzIGEgdGVzdCBmaWxlLlxuICogQHBhcmFtIGZpbGVuYW1lIEFic29sdXRlIGZpbGVuYW1lLlxuICogQHBhcmFtIHN0YXRlIE5vcm1hbGl6ZWQgb3B0aW9ucy5cbiAqIEBwYXJhbSByZXBvUm9vdCBBYnNvbHV0ZSByZXBvc2l0b3J5IHJvb3QuXG4gKiBAcmV0dXJucyBUcnVlIHdoZW4gdGhlIGZpbGUgcGF0aCBtYXRjaGVzIGEgdGVzdCBwYXR0ZXJuLlxuICogQGV4YW1wbGVcbiAqIGBgYHR5cGVzY3JpcHRcbiAqIGNvbnN0IHRlc3RGaWxlID0gaXNUZXN0RmlsZShcIi9yZXBvL3Rlc3RzL2UyZS9kZW1vLnRzXCIsIHN0YXRlLCBcIi9yZXBvXCIpO1xuICogYGBgXG4gKi9cbmV4cG9ydCBjb25zdCBpc1Rlc3RGaWxlID0gKFxuICBmaWxlbmFtZTogc3RyaW5nLFxuICBzdGF0ZTogTm9VbnVzZWRFeHBvcnRzU3RhdGUsXG4gIHJlcG9Sb290OiBzdHJpbmcsXG4pOiBib29sZWFuID0+IG1hdGNoZXNBbnlQYXR0ZXJuKGZpbGVuYW1lLCBzdGF0ZS50ZXN0RmlsZVBhdHRlcm5zLCByZXBvUm9vdCk7XG4iXX0=
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { AST, Rule } from "eslint";
|
|
2
|
+
import * as ts from "typescript";
|
|
3
|
+
import type { ExportedElement, ExportUsage, NoUnusedExportsState } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Resolves TypeScript parser services program when available.
|
|
6
|
+
* @param context Rule context.
|
|
7
|
+
* @returns TypeScript program when available.
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const program = getTypeScriptProgram(context);
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
declare const getTypeScriptProgram: (context: Rule.RuleContext) => ts.Program | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Collects exported elements from one program body.
|
|
16
|
+
* @param body Program body statements.
|
|
17
|
+
* @returns Exported elements in declaration order.
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const exported = collectExportedElements(program.body);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
declare const collectExportedElements: (body: AST.Program["body"]) => ExportedElement[];
|
|
24
|
+
/**
|
|
25
|
+
* Collects concrete usages of one exported element across the program.
|
|
26
|
+
* @param program TypeScript program.
|
|
27
|
+
* @param sourceFilename Source filename where export is defined.
|
|
28
|
+
* @param state Normalized rule options.
|
|
29
|
+
* @param repoRoot Absolute repository root used for test-file classification.
|
|
30
|
+
* @param exportedElement Exported element to classify.
|
|
31
|
+
* @returns Concrete usages for the exported element.
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const usages = collectCrossFileUsages(program, "/repo/src/feature.ts", state, "/repo", exportedElement);
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
declare const collectCrossFileUsages: (program: ts.Program, sourceFilename: string, state: NoUnusedExportsState, repoRoot: string, exportedElement: ExportedElement) => ExportUsage[];
|
|
38
|
+
/**
|
|
39
|
+
* Classifies one exported name based on cross-file usages.
|
|
40
|
+
* @param usages Collected usages.
|
|
41
|
+
* @returns Classification label.
|
|
42
|
+
* @example
|
|
43
|
+
* ```typescript
|
|
44
|
+
* const classification = classifyExportUsage("feature", usages);
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
declare const classifyExportUsage: (usages: ExportUsage[]) => "production" | "test-only" | "unused";
|
|
48
|
+
export { classifyExportUsage, collectCrossFileUsages, collectExportedElements, getTypeScriptProgram, };
|
|
49
|
+
//# sourceMappingURL=no-unused-exports-utilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-unused-exports-utilities.d.ts","sourceRoot":"","sources":["../../../../src/domain/architecture/no-unused-exports/no-unused-exports-utilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAIxC,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,KAAK,EACV,eAAe,EAEf,WAAW,EACX,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAgFjB;;;;;;;;GAQG;AACH,QAAA,MAAM,oBAAoB,GACxB,SAAS,IAAI,CAAC,WAAW,KACxB,EAAE,CAAC,OAAO,GAAG,SAOf,CAAC;AA0LF;;;;;;;;GAQG;AACH,QAAA,MAAM,uBAAuB,GAC3B,MAAM,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,KACxB,eAAe,EAsFjB,CAAC;AA+VF;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,sBAAsB,GAC1B,SAAS,EAAE,CAAC,OAAO,EACnB,gBAAgB,MAAM,EACtB,OAAO,oBAAoB,EAC3B,UAAU,MAAM,EAChB,iBAAiB,eAAe,KAC/B,WAAW,EAoDb,CAAC;AAEF;;;;;;;;GAQG;AACH,QAAA,MAAM,mBAAmB,GACvB,QAAQ,WAAW,EAAE,KACpB,YAAY,GAAG,WAAW,GAAG,QAY/B,CAAC;AAEF,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,GACrB,CAAC"}
|