@nielspeter/eess-ts 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +364 -0
- package/dist/builders/call-rule-builder.d.ts +199 -0
- package/dist/builders/call-rule-builder.d.ts.map +1 -0
- package/dist/builders/call-rule-builder.js +254 -0
- package/dist/builders/call-rule-builder.js.map +1 -0
- package/dist/builders/class-rule-builder.d.ts +136 -0
- package/dist/builders/class-rule-builder.d.ts.map +1 -0
- package/dist/builders/class-rule-builder.js +253 -0
- package/dist/builders/class-rule-builder.js.map +1 -0
- package/dist/builders/cross-layer-builder.d.ts +96 -0
- package/dist/builders/cross-layer-builder.d.ts.map +1 -0
- package/dist/builders/cross-layer-builder.js +172 -0
- package/dist/builders/cross-layer-builder.js.map +1 -0
- package/dist/builders/function-rule-builder.d.ts +198 -0
- package/dist/builders/function-rule-builder.d.ts.map +1 -0
- package/dist/builders/function-rule-builder.js +287 -0
- package/dist/builders/function-rule-builder.js.map +1 -0
- package/dist/builders/jsx-rule-builder.d.ts +113 -0
- package/dist/builders/jsx-rule-builder.d.ts.map +1 -0
- package/dist/builders/jsx-rule-builder.js +150 -0
- package/dist/builders/jsx-rule-builder.js.map +1 -0
- package/dist/builders/module-rule-builder.d.ts +159 -0
- package/dist/builders/module-rule-builder.d.ts.map +1 -0
- package/dist/builders/module-rule-builder.js +237 -0
- package/dist/builders/module-rule-builder.js.map +1 -0
- package/dist/builders/scoped-function-rule-builder.d.ts +21 -0
- package/dist/builders/scoped-function-rule-builder.d.ts.map +1 -0
- package/dist/builders/scoped-function-rule-builder.js +26 -0
- package/dist/builders/scoped-function-rule-builder.js.map +1 -0
- package/dist/builders/slice-rule-builder.d.ts +85 -0
- package/dist/builders/slice-rule-builder.d.ts.map +1 -0
- package/dist/builders/slice-rule-builder.js +134 -0
- package/dist/builders/slice-rule-builder.js.map +1 -0
- package/dist/builders/type-rule-builder.d.ts +103 -0
- package/dist/builders/type-rule-builder.d.ts.map +1 -0
- package/dist/builders/type-rule-builder.js +170 -0
- package/dist/builders/type-rule-builder.js.map +1 -0
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +4 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/commands/baseline.d.ts +11 -0
- package/dist/cli/commands/baseline.d.ts.map +1 -0
- package/dist/cli/commands/baseline.js +16 -0
- package/dist/cli/commands/baseline.js.map +1 -0
- package/dist/cli/commands/check.d.ts +21 -0
- package/dist/cli/commands/check.d.ts.map +1 -0
- package/dist/cli/commands/check.js +94 -0
- package/dist/cli/commands/check.js.map +1 -0
- package/dist/cli/commands/explain.d.ts +9 -0
- package/dist/cli/commands/explain.d.ts.map +1 -0
- package/dist/cli/commands/explain.js +49 -0
- package/dist/cli/commands/explain.js.map +1 -0
- package/dist/cli/config.d.ts +31 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +20 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/index.d.ts +21 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +168 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/load-rules.d.ts +20 -0
- package/dist/cli/load-rules.d.ts.map +1 -0
- package/dist/cli/load-rules.js +97 -0
- package/dist/cli/load-rules.js.map +1 -0
- package/dist/cli/resolve-config.d.ts +11 -0
- package/dist/cli/resolve-config.d.ts.map +1 -0
- package/dist/cli/resolve-config.js +61 -0
- package/dist/cli/resolve-config.js.map +1 -0
- package/dist/cli/watch.d.ts +49 -0
- package/dist/cli/watch.d.ts.map +1 -0
- package/dist/cli/watch.js +138 -0
- package/dist/cli/watch.js.map +1 -0
- package/dist/conditions/body-analysis-function.d.ts +23 -0
- package/dist/conditions/body-analysis-function.d.ts.map +1 -0
- package/dist/conditions/body-analysis-function.js +103 -0
- package/dist/conditions/body-analysis-function.js.map +1 -0
- package/dist/conditions/body-analysis-module.d.ts +27 -0
- package/dist/conditions/body-analysis-module.d.ts.map +1 -0
- package/dist/conditions/body-analysis-module.js +99 -0
- package/dist/conditions/body-analysis-module.js.map +1 -0
- package/dist/conditions/body-analysis.d.ts +34 -0
- package/dist/conditions/body-analysis.d.ts.map +1 -0
- package/dist/conditions/body-analysis.js +95 -0
- package/dist/conditions/body-analysis.js.map +1 -0
- package/dist/conditions/call.d.ts +62 -0
- package/dist/conditions/call.d.ts.map +1 -0
- package/dist/conditions/call.js +267 -0
- package/dist/conditions/call.js.map +1 -0
- package/dist/conditions/catch-analysis.d.ts +31 -0
- package/dist/conditions/catch-analysis.d.ts.map +1 -0
- package/dist/conditions/catch-analysis.js +78 -0
- package/dist/conditions/catch-analysis.js.map +1 -0
- package/dist/conditions/class.d.ts +33 -0
- package/dist/conditions/class.d.ts.map +1 -0
- package/dist/conditions/class.js +110 -0
- package/dist/conditions/class.js.map +1 -0
- package/dist/conditions/cross-layer.d.ts +28 -0
- package/dist/conditions/cross-layer.d.ts.map +1 -0
- package/dist/conditions/cross-layer.js +105 -0
- package/dist/conditions/cross-layer.js.map +1 -0
- package/dist/conditions/dependency.d.ts +73 -0
- package/dist/conditions/dependency.d.ts.map +1 -0
- package/dist/conditions/dependency.js +177 -0
- package/dist/conditions/dependency.js.map +1 -0
- package/dist/conditions/exports.d.ts +33 -0
- package/dist/conditions/exports.d.ts.map +1 -0
- package/dist/conditions/exports.js +101 -0
- package/dist/conditions/exports.js.map +1 -0
- package/dist/conditions/function.d.ts +79 -0
- package/dist/conditions/function.d.ts.map +1 -0
- package/dist/conditions/function.js +167 -0
- package/dist/conditions/function.js.map +1 -0
- package/dist/conditions/helpers.d.ts +14 -0
- package/dist/conditions/helpers.d.ts.map +1 -0
- package/dist/conditions/helpers.js +26 -0
- package/dist/conditions/helpers.js.map +1 -0
- package/dist/conditions/jsx.d.ts +40 -0
- package/dist/conditions/jsx.d.ts.map +1 -0
- package/dist/conditions/jsx.js +133 -0
- package/dist/conditions/jsx.js.map +1 -0
- package/dist/conditions/members.d.ts +74 -0
- package/dist/conditions/members.d.ts.map +1 -0
- package/dist/conditions/members.js +224 -0
- package/dist/conditions/members.js.map +1 -0
- package/dist/conditions/pattern.d.ts +20 -0
- package/dist/conditions/pattern.d.ts.map +1 -0
- package/dist/conditions/pattern.js +108 -0
- package/dist/conditions/pattern.js.map +1 -0
- package/dist/conditions/reverse-dependency.d.ts +28 -0
- package/dist/conditions/reverse-dependency.d.ts.map +1 -0
- package/dist/conditions/reverse-dependency.js +275 -0
- package/dist/conditions/reverse-dependency.js.map +1 -0
- package/dist/conditions/slice.d.ts +49 -0
- package/dist/conditions/slice.d.ts.map +1 -0
- package/dist/conditions/slice.js +153 -0
- package/dist/conditions/slice.js.map +1 -0
- package/dist/conditions/structural.d.ts +58 -0
- package/dist/conditions/structural.d.ts.map +1 -0
- package/dist/conditions/structural.js +102 -0
- package/dist/conditions/structural.js.map +1 -0
- package/dist/conditions/type-level.d.ts +29 -0
- package/dist/conditions/type-level.d.ts.map +1 -0
- package/dist/conditions/type-level.js +48 -0
- package/dist/conditions/type-level.js.map +1 -0
- package/dist/core/import-options.d.ts +32 -0
- package/dist/core/import-options.d.ts.map +1 -0
- package/dist/core/import-options.js +29 -0
- package/dist/core/import-options.js.map +1 -0
- package/dist/core/module-dependencies.d.ts +28 -0
- package/dist/core/module-dependencies.d.ts.map +1 -0
- package/dist/core/module-dependencies.js +35 -0
- package/dist/core/module-dependencies.js.map +1 -0
- package/dist/core/pair-condition.d.ts +10 -0
- package/dist/core/pair-condition.d.ts.map +1 -0
- package/dist/core/pair-condition.js +2 -0
- package/dist/core/pair-condition.js.map +1 -0
- package/dist/core/project.d.ts +68 -0
- package/dist/core/project.d.ts.map +1 -0
- package/dist/core/project.js +127 -0
- package/dist/core/project.js.map +1 -0
- package/dist/core/type-matcher.d.ts +10 -0
- package/dist/core/type-matcher.d.ts.map +1 -0
- package/dist/core/type-matcher.js +2 -0
- package/dist/core/type-matcher.js.map +1 -0
- package/dist/core/violation.d.ts +38 -0
- package/dist/core/violation.d.ts.map +1 -0
- package/dist/core/violation.js +130 -0
- package/dist/core/violation.js.map +1 -0
- package/dist/graphql/index.d.ts +76 -0
- package/dist/graphql/index.d.ts.map +1 -0
- package/dist/graphql/index.js +108 -0
- package/dist/graphql/index.js.map +1 -0
- package/dist/graphql/resolver-rule-builder.d.ts +75 -0
- package/dist/graphql/resolver-rule-builder.d.ts.map +1 -0
- package/dist/graphql/resolver-rule-builder.js +146 -0
- package/dist/graphql/resolver-rule-builder.js.map +1 -0
- package/dist/graphql/schema-conditions.d.ts +31 -0
- package/dist/graphql/schema-conditions.d.ts.map +1 -0
- package/dist/graphql/schema-conditions.js +119 -0
- package/dist/graphql/schema-conditions.js.map +1 -0
- package/dist/graphql/schema-loader.d.ts +75 -0
- package/dist/graphql/schema-loader.d.ts.map +1 -0
- package/dist/graphql/schema-loader.js +113 -0
- package/dist/graphql/schema-loader.js.map +1 -0
- package/dist/graphql/schema-predicates.d.ts +42 -0
- package/dist/graphql/schema-predicates.d.ts.map +1 -0
- package/dist/graphql/schema-predicates.js +74 -0
- package/dist/graphql/schema-predicates.js.map +1 -0
- package/dist/graphql/schema-rule-builder.d.ts +74 -0
- package/dist/graphql/schema-rule-builder.d.ts.map +1 -0
- package/dist/graphql/schema-rule-builder.js +188 -0
- package/dist/graphql/schema-rule-builder.js.map +1 -0
- package/dist/helpers/body-traversal.d.ts +58 -0
- package/dist/helpers/body-traversal.d.ts.map +1 -0
- package/dist/helpers/body-traversal.js +180 -0
- package/dist/helpers/body-traversal.js.map +1 -0
- package/dist/helpers/callback-extractor.d.ts +28 -0
- package/dist/helpers/callback-extractor.d.ts.map +1 -0
- package/dist/helpers/callback-extractor.js +159 -0
- package/dist/helpers/callback-extractor.js.map +1 -0
- package/dist/helpers/complexity.d.ts +26 -0
- package/dist/helpers/complexity.d.ts.map +1 -0
- package/dist/helpers/complexity.js +64 -0
- package/dist/helpers/complexity.js.map +1 -0
- package/dist/helpers/matchers.d.ts +206 -0
- package/dist/helpers/matchers.d.ts.map +1 -0
- package/dist/helpers/matchers.js +470 -0
- package/dist/helpers/matchers.js.map +1 -0
- package/dist/helpers/pattern.d.ts +37 -0
- package/dist/helpers/pattern.d.ts.map +1 -0
- package/dist/helpers/pattern.js +22 -0
- package/dist/helpers/pattern.js.map +1 -0
- package/dist/helpers/slice-graph.d.ts +32 -0
- package/dist/helpers/slice-graph.d.ts.map +1 -0
- package/dist/helpers/slice-graph.js +89 -0
- package/dist/helpers/slice-graph.js.map +1 -0
- package/dist/helpers/tarjan.d.ts +21 -0
- package/dist/helpers/tarjan.d.ts.map +1 -0
- package/dist/helpers/tarjan.js +71 -0
- package/dist/helpers/tarjan.js.map +1 -0
- package/dist/helpers/type-matchers.d.ts +67 -0
- package/dist/helpers/type-matchers.d.ts.map +1 -0
- package/dist/helpers/type-matchers.js +108 -0
- package/dist/helpers/type-matchers.js.map +1 -0
- package/dist/helpers/within.d.ts +41 -0
- package/dist/helpers/within.d.ts.map +1 -0
- package/dist/helpers/within.js +32 -0
- package/dist/helpers/within.js.map +1 -0
- package/dist/index.d.ts +101 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +116 -0
- package/dist/index.js.map +1 -0
- package/dist/models/arch-call.d.ts +83 -0
- package/dist/models/arch-call.d.ts.map +1 -0
- package/dist/models/arch-call.js +90 -0
- package/dist/models/arch-call.js.map +1 -0
- package/dist/models/arch-function.d.ts +76 -0
- package/dist/models/arch-function.d.ts.map +1 -0
- package/dist/models/arch-function.js +122 -0
- package/dist/models/arch-function.js.map +1 -0
- package/dist/models/arch-jsx-element.d.ts +75 -0
- package/dist/models/arch-jsx-element.d.ts.map +1 -0
- package/dist/models/arch-jsx-element.js +231 -0
- package/dist/models/arch-jsx-element.js.map +1 -0
- package/dist/models/cross-layer.d.ts +15 -0
- package/dist/models/cross-layer.d.ts.map +1 -0
- package/dist/models/cross-layer.js +2 -0
- package/dist/models/cross-layer.js.map +1 -0
- package/dist/models/slice.d.ts +60 -0
- package/dist/models/slice.d.ts.map +1 -0
- package/dist/models/slice.js +89 -0
- package/dist/models/slice.js.map +1 -0
- package/dist/predicates/call.d.ts +49 -0
- package/dist/predicates/call.d.ts.map +1 -0
- package/dist/predicates/call.js +115 -0
- package/dist/predicates/call.js.map +1 -0
- package/dist/predicates/class.d.ts +42 -0
- package/dist/predicates/class.d.ts.map +1 -0
- package/dist/predicates/class.js +83 -0
- package/dist/predicates/class.js.map +1 -0
- package/dist/predicates/function.d.ts +81 -0
- package/dist/predicates/function.d.ts.map +1 -0
- package/dist/predicates/function.js +157 -0
- package/dist/predicates/function.js.map +1 -0
- package/dist/predicates/identity.d.ts +55 -0
- package/dist/predicates/identity.d.ts.map +1 -0
- package/dist/predicates/identity.js +96 -0
- package/dist/predicates/identity.js.map +1 -0
- package/dist/predicates/index.d.ts +4 -0
- package/dist/predicates/index.d.ts.map +1 -0
- package/dist/predicates/index.js +3 -0
- package/dist/predicates/index.js.map +1 -0
- package/dist/predicates/jsx.d.ts +41 -0
- package/dist/predicates/jsx.d.ts.map +1 -0
- package/dist/predicates/jsx.js +84 -0
- package/dist/predicates/jsx.js.map +1 -0
- package/dist/predicates/metrics.d.ts +30 -0
- package/dist/predicates/metrics.d.ts.map +1 -0
- package/dist/predicates/metrics.js +65 -0
- package/dist/predicates/metrics.js.map +1 -0
- package/dist/predicates/module.d.ts +44 -0
- package/dist/predicates/module.d.ts.map +1 -0
- package/dist/predicates/module.js +70 -0
- package/dist/predicates/module.js.map +1 -0
- package/dist/predicates/type.d.ts +48 -0
- package/dist/predicates/type.d.ts.map +1 -0
- package/dist/predicates/type.js +107 -0
- package/dist/predicates/type.js.map +1 -0
- package/dist/presets/boundaries.d.ts +19 -0
- package/dist/presets/boundaries.d.ts.map +1 -0
- package/dist/presets/boundaries.js +93 -0
- package/dist/presets/boundaries.js.map +1 -0
- package/dist/presets/data-layer.d.ts +20 -0
- package/dist/presets/data-layer.d.ts.map +1 -0
- package/dist/presets/data-layer.js +30 -0
- package/dist/presets/data-layer.js.map +1 -0
- package/dist/presets/index.d.ts +9 -0
- package/dist/presets/index.d.ts.map +1 -0
- package/dist/presets/index.js +5 -0
- package/dist/presets/index.js.map +1 -0
- package/dist/presets/layered.d.ts +21 -0
- package/dist/presets/layered.d.ts.map +1 -0
- package/dist/presets/layered.js +103 -0
- package/dist/presets/layered.js.map +1 -0
- package/dist/presets/shared.d.ts +3 -0
- package/dist/presets/shared.d.ts.map +1 -0
- package/dist/presets/shared.js +5 -0
- package/dist/presets/shared.js.map +1 -0
- package/dist/rules/architecture.d.ts +10 -0
- package/dist/rules/architecture.d.ts.map +1 -0
- package/dist/rules/architecture.js +14 -0
- package/dist/rules/architecture.js.map +1 -0
- package/dist/rules/code-quality.d.ts +55 -0
- package/dist/rules/code-quality.d.ts.map +1 -0
- package/dist/rules/code-quality.js +116 -0
- package/dist/rules/code-quality.js.map +1 -0
- package/dist/rules/dependencies.d.ts +32 -0
- package/dist/rules/dependencies.d.ts.map +1 -0
- package/dist/rules/dependencies.js +37 -0
- package/dist/rules/dependencies.js.map +1 -0
- package/dist/rules/errors.d.ts +31 -0
- package/dist/rules/errors.d.ts.map +1 -0
- package/dist/rules/errors.js +97 -0
- package/dist/rules/errors.js.map +1 -0
- package/dist/rules/hygiene.d.ts +54 -0
- package/dist/rules/hygiene.d.ts.map +1 -0
- package/dist/rules/hygiene.js +62 -0
- package/dist/rules/hygiene.js.map +1 -0
- package/dist/rules/metrics-function.d.ts +45 -0
- package/dist/rules/metrics-function.d.ts.map +1 -0
- package/dist/rules/metrics-function.js +87 -0
- package/dist/rules/metrics-function.js.map +1 -0
- package/dist/rules/metrics.d.ts +64 -0
- package/dist/rules/metrics.d.ts.map +1 -0
- package/dist/rules/metrics.js +157 -0
- package/dist/rules/metrics.js.map +1 -0
- package/dist/rules/naming.d.ts +24 -0
- package/dist/rules/naming.d.ts.map +1 -0
- package/dist/rules/naming.js +51 -0
- package/dist/rules/naming.js.map +1 -0
- package/dist/rules/security.d.ts +59 -0
- package/dist/rules/security.d.ts.map +1 -0
- package/dist/rules/security.js +92 -0
- package/dist/rules/security.js.map +1 -0
- package/dist/rules/typescript.d.ts +73 -0
- package/dist/rules/typescript.d.ts.map +1 -0
- package/dist/rules/typescript.js +105 -0
- package/dist/rules/typescript.js.map +1 -0
- package/dist/smells/duplicate-bodies.d.ts +24 -0
- package/dist/smells/duplicate-bodies.d.ts.map +1 -0
- package/dist/smells/duplicate-bodies.js +131 -0
- package/dist/smells/duplicate-bodies.js.map +1 -0
- package/dist/smells/fingerprint.d.ts +27 -0
- package/dist/smells/fingerprint.d.ts.map +1 -0
- package/dist/smells/fingerprint.js +50 -0
- package/dist/smells/fingerprint.js.map +1 -0
- package/dist/smells/inconsistent-siblings.d.ts +21 -0
- package/dist/smells/inconsistent-siblings.d.ts.map +1 -0
- package/dist/smells/inconsistent-siblings.js +135 -0
- package/dist/smells/inconsistent-siblings.js.map +1 -0
- package/dist/smells/index.d.ts +12 -0
- package/dist/smells/index.d.ts.map +1 -0
- package/dist/smells/index.js +15 -0
- package/dist/smells/index.js.map +1 -0
- package/dist/smells/smell-builder.d.ts +37 -0
- package/dist/smells/smell-builder.d.ts.map +1 -0
- package/dist/smells/smell-builder.js +51 -0
- package/dist/smells/smell-builder.js.map +1 -0
- package/package.json +121 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { RuleBuilder } from '@nielspeter/eess';
|
|
2
|
+
import { functionContain, functionNotContain, functionUseInsteadOf, functionNotHaveEmptyBody, } from '../conditions/body-analysis-function.js';
|
|
3
|
+
import { collectFunctions } from '../models/arch-function.js';
|
|
4
|
+
import { followPattern as followPatternCondition } from '../conditions/pattern.js';
|
|
5
|
+
import { notExist as fnNotExist, beExported as fnBeExported, beAsync as fnBeAsync, haveNameMatching as fnConditionHaveNameMatching, acceptParameterOfType as fnAcceptParameterOfType, notAcceptParameterOfType as fnNotAcceptParameterOfType, haveReturnTypeMatching as fnHaveReturnTypeMatching, resideInFile as fnConditionResideInFile, resideInFolder as fnConditionResideInFolder, } from '../conditions/function.js';
|
|
6
|
+
import { haveNameMatching as identityHaveNameMatching, haveNameStartingWith as identityHaveNameStartingWith, haveNameEndingWith as identityHaveNameEndingWith, resideInFile as identityResideInFile, resideInFolder as identityResideInFolder, areExported as identityAreExported, areNotExported as identityAreNotExported, } from '../predicates/identity.js';
|
|
7
|
+
import { arePublic as fnArePublic, areProtected as fnAreProtected, arePrivate as fnArePrivate, areAsync as fnAreAsync, areNotAsync as fnAreNotAsync, haveParameterCount as fnHaveParameterCount, haveParameterCountGreaterThan as fnHaveParameterCountGreaterThan, haveParameterCountLessThan as fnHaveParameterCountLessThan, haveParameterNamed as fnHaveParameterNamed, haveReturnType as fnHaveReturnType, haveRestParameter as fnHaveRestParameter, haveOptionalParameter as fnHaveOptionalParameter, haveParameterOfType as fnHaveParameterOfType, haveParameterNameMatching as fnHaveParameterNameMatching, } from '../predicates/function.js';
|
|
8
|
+
/**
|
|
9
|
+
* Rule builder for function-level architecture rules.
|
|
10
|
+
*
|
|
11
|
+
* Operates on both FunctionDeclarations and const arrow functions,
|
|
12
|
+
* unified through the ArchFunction model.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // All parseXxxOrder functions should not exist
|
|
17
|
+
* functions(project)
|
|
18
|
+
* .that().haveNameMatching(/^parse\w+Order$/)
|
|
19
|
+
* .should(notExist())
|
|
20
|
+
* .because('use shared parseOrder() utility instead')
|
|
21
|
+
* .check()
|
|
22
|
+
*
|
|
23
|
+
* // No function should have more than 5 parameters
|
|
24
|
+
* functions(project)
|
|
25
|
+
* .that().haveParameterCountGreaterThan(5)
|
|
26
|
+
* .should(notExist())
|
|
27
|
+
* .because('functions with many parameters are hard to use')
|
|
28
|
+
* .check()
|
|
29
|
+
*
|
|
30
|
+
* // All exported async functions should have names starting with a verb
|
|
31
|
+
* functions(project)
|
|
32
|
+
* .that().areExported().and().areAsync()
|
|
33
|
+
* .should().haveNameMatching(/^(get|find|create|update|delete|fetch|load|save)/)
|
|
34
|
+
* .because('async functions should use verb prefixes')
|
|
35
|
+
* .check()
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export class FunctionRuleBuilder extends RuleBuilder {
|
|
39
|
+
getElements() {
|
|
40
|
+
return this.project.getSourceFiles().flatMap((sf) => collectFunctions(sf));
|
|
41
|
+
}
|
|
42
|
+
// --- Identity predicates (delegated to plan 0003 generics) ---
|
|
43
|
+
/**
|
|
44
|
+
* After `.that()`: filter functions whose name matches the pattern.
|
|
45
|
+
* After `.should()`: assert matched functions have names matching the pattern.
|
|
46
|
+
*/
|
|
47
|
+
haveNameMatching(pattern) {
|
|
48
|
+
if (this._phase === 'condition') {
|
|
49
|
+
const regex = typeof pattern === 'string' ? new RegExp(pattern) : pattern;
|
|
50
|
+
return this.addCondition(fnConditionHaveNameMatching(regex));
|
|
51
|
+
}
|
|
52
|
+
return this.addPredicate(identityHaveNameMatching(pattern));
|
|
53
|
+
}
|
|
54
|
+
/** Filter to functions whose name starts with the given prefix. */
|
|
55
|
+
haveNameStartingWith(prefix) {
|
|
56
|
+
return this.addPredicate(identityHaveNameStartingWith(prefix));
|
|
57
|
+
}
|
|
58
|
+
/** Filter to functions whose name ends with the given suffix. */
|
|
59
|
+
haveNameEndingWith(suffix) {
|
|
60
|
+
return this.addPredicate(identityHaveNameEndingWith(suffix));
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* After `.that()`: filter functions in a file matching the glob.
|
|
64
|
+
* After `.should()`: assert functions reside in a file matching the glob.
|
|
65
|
+
*/
|
|
66
|
+
resideInFile(glob) {
|
|
67
|
+
if (this._phase === 'condition') {
|
|
68
|
+
return this.addCondition(fnConditionResideInFile(glob));
|
|
69
|
+
}
|
|
70
|
+
return this.addPredicate(identityResideInFile(glob));
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* After `.that()`: filter functions in a folder matching the glob.
|
|
74
|
+
* After `.should()`: assert functions reside in a folder matching the glob.
|
|
75
|
+
*/
|
|
76
|
+
resideInFolder(glob) {
|
|
77
|
+
if (this._phase === 'condition') {
|
|
78
|
+
return this.addCondition(fnConditionResideInFolder(glob));
|
|
79
|
+
}
|
|
80
|
+
return this.addPredicate(identityResideInFolder(glob));
|
|
81
|
+
}
|
|
82
|
+
/** Filter to functions that are exported from their module. */
|
|
83
|
+
areExported() {
|
|
84
|
+
return this.addPredicate(identityAreExported());
|
|
85
|
+
}
|
|
86
|
+
/** Filter to functions that are NOT exported from their module. */
|
|
87
|
+
areNotExported() {
|
|
88
|
+
return this.addPredicate(identityAreNotExported());
|
|
89
|
+
}
|
|
90
|
+
// --- Visibility predicates (plan 0032) ---
|
|
91
|
+
/**
|
|
92
|
+
* Filter to public functions. Class methods match when `public` or
|
|
93
|
+
* unmarked; standalone and arrow functions are always public.
|
|
94
|
+
*/
|
|
95
|
+
arePublic() {
|
|
96
|
+
return this.addPredicate(fnArePublic());
|
|
97
|
+
}
|
|
98
|
+
/** Filter to `protected` class methods (standalone functions never match). */
|
|
99
|
+
areProtected() {
|
|
100
|
+
return this.addPredicate(fnAreProtected());
|
|
101
|
+
}
|
|
102
|
+
/** Filter to `private` class methods (standalone functions never match). */
|
|
103
|
+
arePrivate() {
|
|
104
|
+
return this.addPredicate(fnArePrivate());
|
|
105
|
+
}
|
|
106
|
+
// --- Function-specific predicates ---
|
|
107
|
+
/** Filter to functions declared with the `async` keyword. */
|
|
108
|
+
areAsync() {
|
|
109
|
+
return this.addPredicate(fnAreAsync());
|
|
110
|
+
}
|
|
111
|
+
/** Filter to functions NOT declared `async`. */
|
|
112
|
+
areNotAsync() {
|
|
113
|
+
return this.addPredicate(fnAreNotAsync());
|
|
114
|
+
}
|
|
115
|
+
/** Filter to functions that declare exactly `n` parameters. */
|
|
116
|
+
haveParameterCount(n) {
|
|
117
|
+
return this.addPredicate(fnHaveParameterCount(n));
|
|
118
|
+
}
|
|
119
|
+
/** Filter to functions that declare more than `n` parameters. */
|
|
120
|
+
haveParameterCountGreaterThan(n) {
|
|
121
|
+
return this.addPredicate(fnHaveParameterCountGreaterThan(n));
|
|
122
|
+
}
|
|
123
|
+
/** Filter to functions that declare fewer than `n` parameters. */
|
|
124
|
+
haveParameterCountLessThan(n) {
|
|
125
|
+
return this.addPredicate(fnHaveParameterCountLessThan(n));
|
|
126
|
+
}
|
|
127
|
+
/** Filter to functions that declare a parameter with the given exact name. */
|
|
128
|
+
haveParameterNamed(name) {
|
|
129
|
+
return this.addPredicate(fnHaveParameterNamed(name));
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Filter to functions whose return type text matches the pattern
|
|
133
|
+
* (e.g. `/Promise</`, `'void'`). A string is compiled to a RegExp.
|
|
134
|
+
*/
|
|
135
|
+
haveReturnType(pattern) {
|
|
136
|
+
return this.addPredicate(fnHaveReturnType(pattern));
|
|
137
|
+
}
|
|
138
|
+
/** Filter to functions that declare a rest parameter (`...args`). */
|
|
139
|
+
haveRestParameter() {
|
|
140
|
+
return this.addPredicate(fnHaveRestParameter());
|
|
141
|
+
}
|
|
142
|
+
/** Filter to functions with at least one optional (`x?`) or default-valued parameter. */
|
|
143
|
+
haveOptionalParameter() {
|
|
144
|
+
return this.addPredicate(fnHaveOptionalParameter());
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Filter to functions whose parameter at `index` has a type satisfying
|
|
148
|
+
* the matcher. Out-of-bounds indices never match; for a rest parameter
|
|
149
|
+
* the type is the array type (e.g. `string[]`).
|
|
150
|
+
*/
|
|
151
|
+
haveParameterOfType(index, matcher) {
|
|
152
|
+
return this.addPredicate(fnHaveParameterOfType(index, matcher));
|
|
153
|
+
}
|
|
154
|
+
/** Filter to functions with at least one parameter whose name matches the regex. */
|
|
155
|
+
haveParameterNameMatching(pattern) {
|
|
156
|
+
return this.addPredicate(fnHaveParameterNameMatching(pattern));
|
|
157
|
+
}
|
|
158
|
+
// --- Condition methods ---
|
|
159
|
+
/**
|
|
160
|
+
* Register a condition. Public API for passing standalone conditions
|
|
161
|
+
* (like notExist(), beExported()) into the builder chain.
|
|
162
|
+
*/
|
|
163
|
+
withCondition(condition) {
|
|
164
|
+
return this.addCondition(condition);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* The filtered function set must be empty.
|
|
168
|
+
*/
|
|
169
|
+
notExist() {
|
|
170
|
+
return this.addCondition(fnNotExist());
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Functions must be exported from their module.
|
|
174
|
+
*/
|
|
175
|
+
beExported() {
|
|
176
|
+
return this.addCondition(fnBeExported());
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Functions must be async.
|
|
180
|
+
*/
|
|
181
|
+
beAsync() {
|
|
182
|
+
return this.addCondition(fnBeAsync());
|
|
183
|
+
}
|
|
184
|
+
/** @deprecated Use `haveNameMatching()` after `.should()` instead. */
|
|
185
|
+
conditionHaveNameMatching(pattern) {
|
|
186
|
+
return this.addCondition(fnConditionHaveNameMatching(pattern));
|
|
187
|
+
}
|
|
188
|
+
// --- Parameter type condition methods (plan 0031) ---
|
|
189
|
+
/**
|
|
190
|
+
* Assert that at least one parameter has a type matching the given matcher.
|
|
191
|
+
*
|
|
192
|
+
* **Scope note:** Scans only the function's own parameter list.
|
|
193
|
+
* Unlike the class-level counterpart, does NOT scan set accessors
|
|
194
|
+
* because `collectFunctions()` excludes them.
|
|
195
|
+
*/
|
|
196
|
+
acceptParameterOfType(matcher) {
|
|
197
|
+
return this.addCondition(fnAcceptParameterOfType(matcher));
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Assert that NO parameter has a type matching the given matcher.
|
|
201
|
+
* Reports one violation per matching parameter.
|
|
202
|
+
*
|
|
203
|
+
* **Scope note:** Scans only the function's own parameter list.
|
|
204
|
+
* Unlike the class-level counterpart, does NOT scan set accessors
|
|
205
|
+
* because `collectFunctions()` excludes them.
|
|
206
|
+
*/
|
|
207
|
+
notAcceptParameterOfType(matcher) {
|
|
208
|
+
return this.addCondition(fnNotAcceptParameterOfType(matcher));
|
|
209
|
+
}
|
|
210
|
+
// --- Return type condition (plan 0033) ---
|
|
211
|
+
/**
|
|
212
|
+
* Assert that the function's return type satisfies the given TypeMatcher.
|
|
213
|
+
*
|
|
214
|
+
* Uses TypeMatcher for composability with `isString()`, `matching()`,
|
|
215
|
+
* `not()`, `exactly()`, etc.
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* functions(project)
|
|
219
|
+
* .that().haveNameMatching(/^list/)
|
|
220
|
+
* .should().haveReturnTypeMatching(matching(/Collection/))
|
|
221
|
+
* .check()
|
|
222
|
+
*/
|
|
223
|
+
haveReturnTypeMatching(matcher) {
|
|
224
|
+
return this.addCondition(fnHaveReturnTypeMatching(matcher));
|
|
225
|
+
}
|
|
226
|
+
// --- Body analysis condition methods (plan 0011) ---
|
|
227
|
+
/**
|
|
228
|
+
* Assert that the function body contains at least one match.
|
|
229
|
+
*/
|
|
230
|
+
contain(matcher) {
|
|
231
|
+
return this.addCondition(functionContain(matcher));
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Assert that the function body does NOT contain any match.
|
|
235
|
+
* Produces one violation per matching node found.
|
|
236
|
+
*/
|
|
237
|
+
notContain(matcher) {
|
|
238
|
+
return this.addCondition(functionNotContain(matcher));
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Assert: must NOT contain 'bad' AND must contain 'good'.
|
|
242
|
+
* Better violation messages than combining notContain + contain separately.
|
|
243
|
+
*/
|
|
244
|
+
useInsteadOf(bad, good) {
|
|
245
|
+
return this.addCondition(functionUseInsteadOf(bad, good));
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Assert that matched functions do not have empty bodies.
|
|
249
|
+
* Expression-bodied arrows always pass (no block body).
|
|
250
|
+
*/
|
|
251
|
+
notHaveEmptyBody() {
|
|
252
|
+
return this.addCondition(functionNotHaveEmptyBody());
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Assert that matched functions follow an architectural pattern.
|
|
256
|
+
*
|
|
257
|
+
* Checks that return types contain all properties defined in
|
|
258
|
+
* the pattern's returnShape with matching types.
|
|
259
|
+
*/
|
|
260
|
+
followPattern(pattern) {
|
|
261
|
+
return this.addCondition(followPatternCondition(pattern));
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Entry point for function-level architecture rules.
|
|
266
|
+
*
|
|
267
|
+
* Scans all source files in the project for both FunctionDeclarations
|
|
268
|
+
* and const arrow functions (VariableDeclaration with ArrowFunction initializer).
|
|
269
|
+
*
|
|
270
|
+
* @example
|
|
271
|
+
* ```typescript
|
|
272
|
+
* import { project, functions } from '@nielspeter/eess-ts'
|
|
273
|
+
*
|
|
274
|
+
* const p = project('tsconfig.json')
|
|
275
|
+
*
|
|
276
|
+
* // All parseXxxOrder functions should not exist
|
|
277
|
+
* functions(p)
|
|
278
|
+
* .that().haveNameMatching(/^parse\w+Order$/)
|
|
279
|
+
* .should(notExist())
|
|
280
|
+
* .because('use shared parseOrder() utility instead')
|
|
281
|
+
* .check()
|
|
282
|
+
* ```
|
|
283
|
+
*/
|
|
284
|
+
export function functions(p) {
|
|
285
|
+
return new FunctionRuleBuilder(p);
|
|
286
|
+
}
|
|
287
|
+
//# sourceMappingURL=function-rule-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function-rule-builder.js","sourceRoot":"","sources":["../../src/builders/function-rule-builder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,yCAAyC,CAAA;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAE,aAAa,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CA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wB,CAAC,OAAoB;QAC3C,OAAO,IAAI,CAAC,YAAY,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC,CAAA;IAC/D,CAAC;IAED,4CAA4C;IAE5C;;;;;;;;;;;OAWG;IACH,sBAAsB,CAAC,OAAoB;QACzC,OAAO,IAAI,CAAC,YAAY,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,CAAA;IAC7D,CAAC;IAED,sDAAsD;IAEtD;;OAEG;IACH,OAAO,CAAC,OAA0B;QAChC,OAAO,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAA;IACpD,CAAC;IAED;;;OAGG;IACH,UAAU,CAAC,OAA0B;QACnC,OAAO,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAA;IACvD,CAAC;IAED;;;OAGG;IACH,YAAY,CAAC,GAAsB,EAAE,IAAuB;QAC1D,OAAO,IAAI,CAAC,YAAY,CAAC,oBAAoB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAA;IAC3D,CAAC;IAED;;;OAGG;IACH,gBAAgB;QACd,OAAO,IAAI,CAAC,YAAY,CAAC,wBAAwB,EAAE,CAAC,CAAA;IACtD,CAAC;IAED;;;;;OAKG;IACH,aAAa,CAAC,OAAoB;QAChC,OAAO,IAAI,CAAC,YAAY,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,CAAA;IAC3D,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,SAAS,CAAC,CAAc;IACtC,OAAO,IAAI,mBAAmB,CAAC,CAAC,CAAC,CAAA;AACnC,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import type { ArchProject } from '../core/project.js';
|
|
2
|
+
import { RuleBuilder } from '@nielspeter/eess';
|
|
3
|
+
import type { ArchJsxElement } from '../models/arch-jsx-element.js';
|
|
4
|
+
/**
|
|
5
|
+
* Rule builder for JSX element architecture rules.
|
|
6
|
+
*
|
|
7
|
+
* Operates on JsxElement and JsxSelfClosingElement nodes across all .tsx/.jsx
|
|
8
|
+
* source files, wrapped in the ArchJsxElement model for uniform predicate access.
|
|
9
|
+
*
|
|
10
|
+
* Uses **distinct names** for predicates vs conditions on attributes:
|
|
11
|
+
* - Predicates (`.that()` phase): `withAttribute`, `withAttributeMatching`
|
|
12
|
+
* - Conditions (`.should()` phase): `haveAttribute`, `notHaveAttribute`,
|
|
13
|
+
* `haveAttributeMatching`, `notHaveAttributeMatching`
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* // No raw <button> — use design system components
|
|
18
|
+
* jsxElements(project)
|
|
19
|
+
* .that().areHtmlElements('button', 'input', 'select')
|
|
20
|
+
* .should().notExist()
|
|
21
|
+
* .because('use design system components instead of raw HTML')
|
|
22
|
+
* .check()
|
|
23
|
+
*
|
|
24
|
+
* // Every <img> must have alt
|
|
25
|
+
* jsxElements(project)
|
|
26
|
+
* .that().areHtmlElements('img')
|
|
27
|
+
* .should().haveAttribute('alt')
|
|
28
|
+
* .because('images must have alt text for accessibility')
|
|
29
|
+
* .check()
|
|
30
|
+
*
|
|
31
|
+
* // Elements with onClick must have aria-label
|
|
32
|
+
* jsxElements(project)
|
|
33
|
+
* .that().withAttribute('onClick')
|
|
34
|
+
* .should().haveAttribute('aria-label')
|
|
35
|
+
* .check()
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare class JsxRuleBuilder extends RuleBuilder<ArchJsxElement, ArchProject> {
|
|
39
|
+
protected getElements(): ArchJsxElement[];
|
|
40
|
+
/** Filter to JSX elements whose tag/component name matches the pattern. */
|
|
41
|
+
haveNameMatching(pattern: RegExp | string): this;
|
|
42
|
+
/** Filter to JSX elements whose tag/component name starts with the prefix. */
|
|
43
|
+
haveNameStartingWith(prefix: string): this;
|
|
44
|
+
/** Filter to JSX elements whose tag/component name ends with the suffix. */
|
|
45
|
+
haveNameEndingWith(suffix: string): this;
|
|
46
|
+
/** Filter to JSX elements in a file whose absolute path matches the glob. */
|
|
47
|
+
resideInFile(glob: string): this;
|
|
48
|
+
/** Filter to JSX elements in a folder whose path matches the glob. */
|
|
49
|
+
resideInFolder(glob: string): this;
|
|
50
|
+
/**
|
|
51
|
+
* Filter to intrinsic HTML elements with any of the given lowercase tags
|
|
52
|
+
* (e.g. `areHtmlElements('button', 'input')`). Requires at least one tag.
|
|
53
|
+
*/
|
|
54
|
+
areHtmlElements(...tags: string[]): this;
|
|
55
|
+
/**
|
|
56
|
+
* Filter to component elements (uppercase or dotted names). With no
|
|
57
|
+
* arguments matches all components; with names, only those (use the full
|
|
58
|
+
* dotted name for namespaced components, e.g. `'Icons.Check'`).
|
|
59
|
+
*/
|
|
60
|
+
areComponents(...names: string[]): this;
|
|
61
|
+
/** Filter to elements that have the named attribute, regardless of value. */
|
|
62
|
+
withAttribute(name: string): this;
|
|
63
|
+
/** Filter to elements whose named attribute value equals the string or matches the regex. */
|
|
64
|
+
withAttributeMatching(name: string, value: string | RegExp): this;
|
|
65
|
+
/**
|
|
66
|
+
* The filtered JSX element set must be empty.
|
|
67
|
+
*/
|
|
68
|
+
notExist(): this;
|
|
69
|
+
/**
|
|
70
|
+
* Every matched element must have the named attribute.
|
|
71
|
+
*/
|
|
72
|
+
haveAttribute(name: string): this;
|
|
73
|
+
/**
|
|
74
|
+
* No matched element may have the named attribute.
|
|
75
|
+
*/
|
|
76
|
+
notHaveAttribute(name: string): this;
|
|
77
|
+
/**
|
|
78
|
+
* Every matched element must have the named attribute matching the value.
|
|
79
|
+
*/
|
|
80
|
+
haveAttributeMatching(name: string, value: string | RegExp): this;
|
|
81
|
+
/**
|
|
82
|
+
* No matched element may have the named attribute matching the value.
|
|
83
|
+
*/
|
|
84
|
+
notHaveAttributeMatching(name: string, value: string | RegExp): this;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Entry point for JSX element architecture rules.
|
|
88
|
+
*
|
|
89
|
+
* Scans all .tsx/.jsx source files in the project for JsxElement and
|
|
90
|
+
* JsxSelfClosingElement nodes and wraps them in ArchJsxElement for
|
|
91
|
+
* predicate/condition evaluation.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```typescript
|
|
95
|
+
* import { project, jsxElements, STANDARD_HTML_TAGS } from '@nielspeter/eess-ts'
|
|
96
|
+
*
|
|
97
|
+
* const p = project('tsconfig.json')
|
|
98
|
+
*
|
|
99
|
+
* // Ban raw HTML form elements
|
|
100
|
+
* jsxElements(p)
|
|
101
|
+
* .that().areHtmlElements('button', 'input', 'select')
|
|
102
|
+
* .should().notExist()
|
|
103
|
+
* .check()
|
|
104
|
+
*
|
|
105
|
+
* // Every <img> must have alt
|
|
106
|
+
* jsxElements(p)
|
|
107
|
+
* .that().areHtmlElements('img')
|
|
108
|
+
* .should().haveAttribute('alt')
|
|
109
|
+
* .check()
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
export declare function jsxElements(p: ArchProject): JsxRuleBuilder;
|
|
113
|
+
//# sourceMappingURL=jsx-rule-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-rule-builder.d.ts","sourceRoot":"","sources":["../../src/builders/jsx-rule-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAuBnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBAAa,cAAe,SAAQ,WAAW,CAAC,cAAc,EAAE,WAAW,CAAC;IAC1E,SAAS,CAAC,WAAW,IAAI,cAAc,EAAE;IAMzC,2EAA2E;IAC3E,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAIhD,8EAA8E;IAC9E,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI1C,4EAA4E;IAC5E,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAIxC,6EAA6E;IAC7E,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIhC,sEAAsE;IACtE,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAMlC;;;OAGG;IACH,eAAe,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI;IAIxC;;;;OAIG;IACH,aAAa,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IAIvC,6EAA6E;IAC7E,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIjC,6FAA6F;IAC7F,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAMjE;;OAEG;IACH,QAAQ,IAAI,IAAI;IAIhB;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIjC;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIpC;;OAEG;IACH,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAIjE;;OAEG;IACH,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAGrE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,WAAW,GAAG,cAAc,CAE1D"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { RuleBuilder } from '@nielspeter/eess';
|
|
2
|
+
import { collectJsxElements } from '../models/arch-jsx-element.js';
|
|
3
|
+
import { haveNameMatching as identityHaveNameMatching, haveNameStartingWith as identityHaveNameStartingWith, haveNameEndingWith as identityHaveNameEndingWith, resideInFile as identityResideInFile, resideInFolder as identityResideInFolder, } from '../predicates/identity.js';
|
|
4
|
+
import { areHtmlElements as jsxAreHtmlElements, areComponents as jsxAreComponents, withAttribute as jsxWithAttribute, withAttributeMatching as jsxWithAttributeMatching, } from '../predicates/jsx.js';
|
|
5
|
+
import { notExist as jsxNotExist, haveAttribute as conditionHaveAttribute, notHaveAttribute as conditionNotHaveAttribute, haveAttributeMatching as conditionHaveAttributeMatching, notHaveAttributeMatching as conditionNotHaveAttributeMatching, } from '../conditions/jsx.js';
|
|
6
|
+
/**
|
|
7
|
+
* Rule builder for JSX element architecture rules.
|
|
8
|
+
*
|
|
9
|
+
* Operates on JsxElement and JsxSelfClosingElement nodes across all .tsx/.jsx
|
|
10
|
+
* source files, wrapped in the ArchJsxElement model for uniform predicate access.
|
|
11
|
+
*
|
|
12
|
+
* Uses **distinct names** for predicates vs conditions on attributes:
|
|
13
|
+
* - Predicates (`.that()` phase): `withAttribute`, `withAttributeMatching`
|
|
14
|
+
* - Conditions (`.should()` phase): `haveAttribute`, `notHaveAttribute`,
|
|
15
|
+
* `haveAttributeMatching`, `notHaveAttributeMatching`
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* // No raw <button> — use design system components
|
|
20
|
+
* jsxElements(project)
|
|
21
|
+
* .that().areHtmlElements('button', 'input', 'select')
|
|
22
|
+
* .should().notExist()
|
|
23
|
+
* .because('use design system components instead of raw HTML')
|
|
24
|
+
* .check()
|
|
25
|
+
*
|
|
26
|
+
* // Every <img> must have alt
|
|
27
|
+
* jsxElements(project)
|
|
28
|
+
* .that().areHtmlElements('img')
|
|
29
|
+
* .should().haveAttribute('alt')
|
|
30
|
+
* .because('images must have alt text for accessibility')
|
|
31
|
+
* .check()
|
|
32
|
+
*
|
|
33
|
+
* // Elements with onClick must have aria-label
|
|
34
|
+
* jsxElements(project)
|
|
35
|
+
* .that().withAttribute('onClick')
|
|
36
|
+
* .should().haveAttribute('aria-label')
|
|
37
|
+
* .check()
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export class JsxRuleBuilder extends RuleBuilder {
|
|
41
|
+
getElements() {
|
|
42
|
+
return this.project.getSourceFiles().flatMap(collectJsxElements);
|
|
43
|
+
}
|
|
44
|
+
// --- Identity predicates (predicate-only, following CallRuleBuilder pattern) ---
|
|
45
|
+
/** Filter to JSX elements whose tag/component name matches the pattern. */
|
|
46
|
+
haveNameMatching(pattern) {
|
|
47
|
+
return this.addPredicate(identityHaveNameMatching(pattern));
|
|
48
|
+
}
|
|
49
|
+
/** Filter to JSX elements whose tag/component name starts with the prefix. */
|
|
50
|
+
haveNameStartingWith(prefix) {
|
|
51
|
+
return this.addPredicate(identityHaveNameStartingWith(prefix));
|
|
52
|
+
}
|
|
53
|
+
/** Filter to JSX elements whose tag/component name ends with the suffix. */
|
|
54
|
+
haveNameEndingWith(suffix) {
|
|
55
|
+
return this.addPredicate(identityHaveNameEndingWith(suffix));
|
|
56
|
+
}
|
|
57
|
+
/** Filter to JSX elements in a file whose absolute path matches the glob. */
|
|
58
|
+
resideInFile(glob) {
|
|
59
|
+
return this.addPredicate(identityResideInFile(glob));
|
|
60
|
+
}
|
|
61
|
+
/** Filter to JSX elements in a folder whose path matches the glob. */
|
|
62
|
+
resideInFolder(glob) {
|
|
63
|
+
return this.addPredicate(identityResideInFolder(glob));
|
|
64
|
+
}
|
|
65
|
+
// --- JSX-specific predicates ---
|
|
66
|
+
/**
|
|
67
|
+
* Filter to intrinsic HTML elements with any of the given lowercase tags
|
|
68
|
+
* (e.g. `areHtmlElements('button', 'input')`). Requires at least one tag.
|
|
69
|
+
*/
|
|
70
|
+
areHtmlElements(...tags) {
|
|
71
|
+
return this.addPredicate(jsxAreHtmlElements(...tags));
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Filter to component elements (uppercase or dotted names). With no
|
|
75
|
+
* arguments matches all components; with names, only those (use the full
|
|
76
|
+
* dotted name for namespaced components, e.g. `'Icons.Check'`).
|
|
77
|
+
*/
|
|
78
|
+
areComponents(...names) {
|
|
79
|
+
return this.addPredicate(jsxAreComponents(...names));
|
|
80
|
+
}
|
|
81
|
+
/** Filter to elements that have the named attribute, regardless of value. */
|
|
82
|
+
withAttribute(name) {
|
|
83
|
+
return this.addPredicate(jsxWithAttribute(name));
|
|
84
|
+
}
|
|
85
|
+
/** Filter to elements whose named attribute value equals the string or matches the regex. */
|
|
86
|
+
withAttributeMatching(name, value) {
|
|
87
|
+
return this.addPredicate(jsxWithAttributeMatching(name, value));
|
|
88
|
+
}
|
|
89
|
+
// --- Condition methods ---
|
|
90
|
+
/**
|
|
91
|
+
* The filtered JSX element set must be empty.
|
|
92
|
+
*/
|
|
93
|
+
notExist() {
|
|
94
|
+
return this.addCondition(jsxNotExist());
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Every matched element must have the named attribute.
|
|
98
|
+
*/
|
|
99
|
+
haveAttribute(name) {
|
|
100
|
+
return this.addCondition(conditionHaveAttribute(name));
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* No matched element may have the named attribute.
|
|
104
|
+
*/
|
|
105
|
+
notHaveAttribute(name) {
|
|
106
|
+
return this.addCondition(conditionNotHaveAttribute(name));
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Every matched element must have the named attribute matching the value.
|
|
110
|
+
*/
|
|
111
|
+
haveAttributeMatching(name, value) {
|
|
112
|
+
return this.addCondition(conditionHaveAttributeMatching(name, value));
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* No matched element may have the named attribute matching the value.
|
|
116
|
+
*/
|
|
117
|
+
notHaveAttributeMatching(name, value) {
|
|
118
|
+
return this.addCondition(conditionNotHaveAttributeMatching(name, value));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Entry point for JSX element architecture rules.
|
|
123
|
+
*
|
|
124
|
+
* Scans all .tsx/.jsx source files in the project for JsxElement and
|
|
125
|
+
* JsxSelfClosingElement nodes and wraps them in ArchJsxElement for
|
|
126
|
+
* predicate/condition evaluation.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* import { project, jsxElements, STANDARD_HTML_TAGS } from '@nielspeter/eess-ts'
|
|
131
|
+
*
|
|
132
|
+
* const p = project('tsconfig.json')
|
|
133
|
+
*
|
|
134
|
+
* // Ban raw HTML form elements
|
|
135
|
+
* jsxElements(p)
|
|
136
|
+
* .that().areHtmlElements('button', 'input', 'select')
|
|
137
|
+
* .should().notExist()
|
|
138
|
+
* .check()
|
|
139
|
+
*
|
|
140
|
+
* // Every <img> must have alt
|
|
141
|
+
* jsxElements(p)
|
|
142
|
+
* .that().areHtmlElements('img')
|
|
143
|
+
* .should().haveAttribute('alt')
|
|
144
|
+
* .check()
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
export function jsxElements(p) {
|
|
148
|
+
return new JsxRuleBuilder(p);
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=jsx-rule-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-rule-builder.js","sourceRoot":"","sources":["../../src/builders/jsx-rule-builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAClE,OAAO,EACL,gBAAgB,IAAI,wBAAwB,EAC5C,oBAAoB,IAAI,4BAA4B,EACpD,kBAAkB,IAAI,0BAA0B,EAChD,YAAY,IAAI,oBAAoB,EACpC,cAAc,IAAI,sBAAsB,GACzC,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,eAAe,IAAI,kBAAkB,EACrC,aAAa,IAAI,gBAAgB,EACjC,aAAa,IAAI,gBAAgB,EACjC,qBAAqB,IAAI,wBAAwB,GAClD,MAAM,sBAAsB,CAAA;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