@memberjunction/react-linter 0.0.1 → 5.38.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/dist/component-linter.d.ts +77 -0
- package/dist/component-linter.d.ts.map +1 -0
- package/dist/component-linter.js +1206 -0
- package/dist/component-linter.js.map +1 -0
- package/dist/control-flow-analyzer.d.ts +184 -0
- package/dist/control-flow-analyzer.d.ts.map +1 -0
- package/dist/control-flow-analyzer.js +798 -0
- package/dist/control-flow-analyzer.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/library-lint-cache.d.ts +50 -0
- package/dist/library-lint-cache.d.ts.map +1 -0
- package/dist/library-lint-cache.js +173 -0
- package/dist/library-lint-cache.js.map +1 -0
- package/dist/lint-rule.d.ts +70 -0
- package/dist/lint-rule.d.ts.map +1 -0
- package/dist/lint-rule.js +30 -0
- package/dist/lint-rule.js.map +1 -0
- package/dist/lint-utils.d.ts +131 -0
- package/dist/lint-utils.d.ts.map +1 -0
- package/dist/lint-utils.js +358 -0
- package/dist/lint-utils.js.map +1 -0
- package/dist/linter-options.d.ts +51 -0
- package/dist/linter-options.d.ts.map +1 -0
- package/dist/linter-options.js +2 -0
- package/dist/linter-options.js.map +1 -0
- package/dist/prop-value-extractor.d.ts +147 -0
- package/dist/prop-value-extractor.d.ts.map +1 -0
- package/dist/prop-value-extractor.js +472 -0
- package/dist/prop-value-extractor.js.map +1 -0
- package/dist/runtime-rules/ai-tools-availability-check.d.ts +9 -0
- package/dist/runtime-rules/ai-tools-availability-check.d.ts.map +1 -0
- package/dist/runtime-rules/ai-tools-availability-check.js +223 -0
- package/dist/runtime-rules/ai-tools-availability-check.js.map +1 -0
- package/dist/runtime-rules/callback-event-validation.d.ts +22 -0
- package/dist/runtime-rules/callback-event-validation.d.ts.map +1 -0
- package/dist/runtime-rules/callback-event-validation.js +561 -0
- package/dist/runtime-rules/callback-event-validation.js.map +1 -0
- package/dist/runtime-rules/chart-field-validation.d.ts +10 -0
- package/dist/runtime-rules/chart-field-validation.d.ts.map +1 -0
- package/dist/runtime-rules/chart-field-validation.js +270 -0
- package/dist/runtime-rules/chart-field-validation.js.map +1 -0
- package/dist/runtime-rules/child-component-prop-validation.d.ts +11 -0
- package/dist/runtime-rules/child-component-prop-validation.d.ts.map +1 -0
- package/dist/runtime-rules/child-component-prop-validation.js +443 -0
- package/dist/runtime-rules/child-component-prop-validation.js.map +1 -0
- package/dist/runtime-rules/component-name-mismatch.d.ts +19 -0
- package/dist/runtime-rules/component-name-mismatch.d.ts.map +1 -0
- package/dist/runtime-rules/component-name-mismatch.js +82 -0
- package/dist/runtime-rules/component-name-mismatch.js.map +1 -0
- package/dist/runtime-rules/component-not-in-dependencies.d.ts +20 -0
- package/dist/runtime-rules/component-not-in-dependencies.d.ts.map +1 -0
- package/dist/runtime-rules/component-not-in-dependencies.js +92 -0
- package/dist/runtime-rules/component-not-in-dependencies.js.map +1 -0
- package/dist/runtime-rules/component-props-validation.d.ts +25 -0
- package/dist/runtime-rules/component-props-validation.d.ts.map +1 -0
- package/dist/runtime-rules/component-props-validation.js +228 -0
- package/dist/runtime-rules/component-props-validation.js.map +1 -0
- package/dist/runtime-rules/component-usage-without-destructuring.d.ts +20 -0
- package/dist/runtime-rules/component-usage-without-destructuring.d.ts.map +1 -0
- package/dist/runtime-rules/component-usage-without-destructuring.js +124 -0
- package/dist/runtime-rules/component-usage-without-destructuring.js.map +1 -0
- package/dist/runtime-rules/data-result-validation.d.ts +9 -0
- package/dist/runtime-rules/data-result-validation.d.ts.map +1 -0
- package/dist/runtime-rules/data-result-validation.js +763 -0
- package/dist/runtime-rules/data-result-validation.js.map +1 -0
- package/dist/runtime-rules/datagrid-field-validation.d.ts +10 -0
- package/dist/runtime-rules/datagrid-field-validation.d.ts.map +1 -0
- package/dist/runtime-rules/datagrid-field-validation.js +249 -0
- package/dist/runtime-rules/datagrid-field-validation.js.map +1 -0
- package/dist/runtime-rules/dependency-shadowing.d.ts +20 -0
- package/dist/runtime-rules/dependency-shadowing.d.ts.map +1 -0
- package/dist/runtime-rules/dependency-shadowing.js +147 -0
- package/dist/runtime-rules/dependency-shadowing.js.map +1 -0
- package/dist/runtime-rules/entity-field-access-validation.d.ts +12 -0
- package/dist/runtime-rules/entity-field-access-validation.d.ts.map +1 -0
- package/dist/runtime-rules/entity-field-access-validation.js +304 -0
- package/dist/runtime-rules/entity-field-access-validation.js.map +1 -0
- package/dist/runtime-rules/event-parameter-validation.d.ts +22 -0
- package/dist/runtime-rules/event-parameter-validation.d.ts.map +1 -0
- package/dist/runtime-rules/event-parameter-validation.js +406 -0
- package/dist/runtime-rules/event-parameter-validation.js.map +1 -0
- package/dist/runtime-rules/index.d.ts +61 -0
- package/dist/runtime-rules/index.d.ts.map +1 -0
- package/dist/runtime-rules/index.js +62 -0
- package/dist/runtime-rules/index.js.map +1 -0
- package/dist/runtime-rules/library-variable-names.d.ts +24 -0
- package/dist/runtime-rules/library-variable-names.d.ts.map +1 -0
- package/dist/runtime-rules/library-variable-names.js +88 -0
- package/dist/runtime-rules/library-variable-names.js.map +1 -0
- package/dist/runtime-rules/no-child-implementation.d.ts +18 -0
- package/dist/runtime-rules/no-child-implementation.d.ts.map +1 -0
- package/dist/runtime-rules/no-child-implementation.js +57 -0
- package/dist/runtime-rules/no-child-implementation.js.map +1 -0
- package/dist/runtime-rules/no-data-prop.d.ts +22 -0
- package/dist/runtime-rules/no-data-prop.d.ts.map +1 -0
- package/dist/runtime-rules/no-data-prop.js +111 -0
- package/dist/runtime-rules/no-data-prop.js.map +1 -0
- package/dist/runtime-rules/no-export-statements.d.ts +18 -0
- package/dist/runtime-rules/no-export-statements.d.ts.map +1 -0
- package/dist/runtime-rules/no-export-statements.js +143 -0
- package/dist/runtime-rules/no-export-statements.js.map +1 -0
- package/dist/runtime-rules/no-iife-wrapper.d.ts +18 -0
- package/dist/runtime-rules/no-iife-wrapper.d.ts.map +1 -0
- package/dist/runtime-rules/no-iife-wrapper.js +217 -0
- package/dist/runtime-rules/no-iife-wrapper.js.map +1 -0
- package/dist/runtime-rules/no-import-statements.d.ts +18 -0
- package/dist/runtime-rules/no-import-statements.d.ts.map +1 -0
- package/dist/runtime-rules/no-import-statements.js +65 -0
- package/dist/runtime-rules/no-import-statements.js.map +1 -0
- package/dist/runtime-rules/no-react-destructuring.d.ts +18 -0
- package/dist/runtime-rules/no-react-destructuring.d.ts.map +1 -0
- package/dist/runtime-rules/no-react-destructuring.js +60 -0
- package/dist/runtime-rules/no-react-destructuring.js.map +1 -0
- package/dist/runtime-rules/no-require-statements.d.ts +18 -0
- package/dist/runtime-rules/no-require-statements.d.ts.map +1 -0
- package/dist/runtime-rules/no-require-statements.js +109 -0
- package/dist/runtime-rules/no-require-statements.js.map +1 -0
- package/dist/runtime-rules/no-return-component.d.ts +18 -0
- package/dist/runtime-rules/no-return-component.d.ts.map +1 -0
- package/dist/runtime-rules/no-return-component.js +106 -0
- package/dist/runtime-rules/no-return-component.js.map +1 -0
- package/dist/runtime-rules/no-unwrap-utility-libs.d.ts +20 -0
- package/dist/runtime-rules/no-unwrap-utility-libs.d.ts.map +1 -0
- package/dist/runtime-rules/no-unwrap-utility-libs.js +75 -0
- package/dist/runtime-rules/no-unwrap-utility-libs.js.map +1 -0
- package/dist/runtime-rules/no-use-reducer.d.ts +19 -0
- package/dist/runtime-rules/no-use-reducer.d.ts.map +1 -0
- package/dist/runtime-rules/no-use-reducer.js +78 -0
- package/dist/runtime-rules/no-use-reducer.js.map +1 -0
- package/dist/runtime-rules/no-window-access.d.ts +23 -0
- package/dist/runtime-rules/no-window-access.d.ts.map +1 -0
- package/dist/runtime-rules/no-window-access.js +136 -0
- package/dist/runtime-rules/no-window-access.js.map +1 -0
- package/dist/runtime-rules/noisy-settings-updates.d.ts +18 -0
- package/dist/runtime-rules/noisy-settings-updates.d.ts.map +1 -0
- package/dist/runtime-rules/noisy-settings-updates.js +110 -0
- package/dist/runtime-rules/noisy-settings-updates.js.map +1 -0
- package/dist/runtime-rules/overflow-hidden-on-layout-container.d.ts +30 -0
- package/dist/runtime-rules/overflow-hidden-on-layout-container.d.ts.map +1 -0
- package/dist/runtime-rules/overflow-hidden-on-layout-container.js +220 -0
- package/dist/runtime-rules/overflow-hidden-on-layout-container.js.map +1 -0
- package/dist/runtime-rules/pass-standard-props.d.ts +19 -0
- package/dist/runtime-rules/pass-standard-props.d.ts.map +1 -0
- package/dist/runtime-rules/pass-standard-props.js +82 -0
- package/dist/runtime-rules/pass-standard-props.js.map +1 -0
- package/dist/runtime-rules/prefer-async-await.d.ts +17 -0
- package/dist/runtime-rules/prefer-async-await.d.ts.map +1 -0
- package/dist/runtime-rules/prefer-async-await.js +52 -0
- package/dist/runtime-rules/prefer-async-await.js.map +1 -0
- package/dist/runtime-rules/prefer-jsx-syntax.d.ts +17 -0
- package/dist/runtime-rules/prefer-jsx-syntax.d.ts.map +1 -0
- package/dist/runtime-rules/prefer-jsx-syntax.js +51 -0
- package/dist/runtime-rules/prefer-jsx-syntax.js.map +1 -0
- package/dist/runtime-rules/prop-state-sync.d.ts +19 -0
- package/dist/runtime-rules/prop-state-sync.d.ts.map +1 -0
- package/dist/runtime-rules/prop-state-sync.js +76 -0
- package/dist/runtime-rules/prop-state-sync.js.map +1 -0
- package/dist/runtime-rules/property-name-consistency.d.ts +20 -0
- package/dist/runtime-rules/property-name-consistency.d.ts.map +1 -0
- package/dist/runtime-rules/property-name-consistency.js +172 -0
- package/dist/runtime-rules/property-name-consistency.js.map +1 -0
- package/dist/runtime-rules/query-result-field-access-validation.d.ts +10 -0
- package/dist/runtime-rules/query-result-field-access-validation.d.ts.map +1 -0
- package/dist/runtime-rules/query-result-field-access-validation.js +304 -0
- package/dist/runtime-rules/query-result-field-access-validation.js.map +1 -0
- package/dist/runtime-rules/react-component-naming.d.ts +19 -0
- package/dist/runtime-rules/react-component-naming.d.ts.map +1 -0
- package/dist/runtime-rules/react-component-naming.js +72 -0
- package/dist/runtime-rules/react-component-naming.js.map +1 -0
- package/dist/runtime-rules/react-hooks-rules.d.ts +27 -0
- package/dist/runtime-rules/react-hooks-rules.d.ts.map +1 -0
- package/dist/runtime-rules/react-hooks-rules.js +223 -0
- package/dist/runtime-rules/react-hooks-rules.js.map +1 -0
- package/dist/runtime-rules/required-queries-not-called.d.ts +19 -0
- package/dist/runtime-rules/required-queries-not-called.d.ts.map +1 -0
- package/dist/runtime-rules/required-queries-not-called.js +146 -0
- package/dist/runtime-rules/required-queries-not-called.js.map +1 -0
- package/dist/runtime-rules/runquery-call-validation.d.ts +11 -0
- package/dist/runtime-rules/runquery-call-validation.d.ts.map +1 -0
- package/dist/runtime-rules/runquery-call-validation.js +886 -0
- package/dist/runtime-rules/runquery-call-validation.js.map +1 -0
- package/dist/runtime-rules/runview-call-validation.d.ts +10 -0
- package/dist/runtime-rules/runview-call-validation.d.ts.map +1 -0
- package/dist/runtime-rules/runview-call-validation.js +336 -0
- package/dist/runtime-rules/runview-call-validation.js.map +1 -0
- package/dist/runtime-rules/saved-user-settings-pattern.d.ts +19 -0
- package/dist/runtime-rules/saved-user-settings-pattern.d.ts.map +1 -0
- package/dist/runtime-rules/saved-user-settings-pattern.js +90 -0
- package/dist/runtime-rules/saved-user-settings-pattern.js.map +1 -0
- package/dist/runtime-rules/search-availability-check.d.ts +9 -0
- package/dist/runtime-rules/search-availability-check.d.ts.map +1 -0
- package/dist/runtime-rules/search-availability-check.js +220 -0
- package/dist/runtime-rules/search-availability-check.js.map +1 -0
- package/dist/runtime-rules/search-call-validation.d.ts +9 -0
- package/dist/runtime-rules/search-call-validation.d.ts.map +1 -0
- package/dist/runtime-rules/search-call-validation.js +336 -0
- package/dist/runtime-rules/search-call-validation.js.map +1 -0
- package/dist/runtime-rules/server-reload-on-client-operation.d.ts +18 -0
- package/dist/runtime-rules/server-reload-on-client-operation.d.ts.map +1 -0
- package/dist/runtime-rules/server-reload-on-client-operation.js +107 -0
- package/dist/runtime-rules/server-reload-on-client-operation.js.map +1 -0
- package/dist/runtime-rules/single-function-only.d.ts +18 -0
- package/dist/runtime-rules/single-function-only.d.ts.map +1 -0
- package/dist/runtime-rules/single-function-only.js +103 -0
- package/dist/runtime-rules/single-function-only.js.map +1 -0
- package/dist/runtime-rules/string-replace-all-occurrences.d.ts +19 -0
- package/dist/runtime-rules/string-replace-all-occurrences.d.ts.map +1 -0
- package/dist/runtime-rules/string-replace-all-occurrences.js +109 -0
- package/dist/runtime-rules/string-replace-all-occurrences.js.map +1 -0
- package/dist/runtime-rules/string-template-validation.d.ts +22 -0
- package/dist/runtime-rules/string-template-validation.d.ts.map +1 -0
- package/dist/runtime-rules/string-template-validation.js +163 -0
- package/dist/runtime-rules/string-template-validation.js.map +1 -0
- package/dist/runtime-rules/styles-validation.d.ts +10 -0
- package/dist/runtime-rules/styles-validation.d.ts.map +1 -0
- package/dist/runtime-rules/styles-validation.js +153 -0
- package/dist/runtime-rules/styles-validation.js.map +1 -0
- package/dist/runtime-rules/type-inference-errors.d.ts +23 -0
- package/dist/runtime-rules/type-inference-errors.d.ts.map +1 -0
- package/dist/runtime-rules/type-inference-errors.js +53 -0
- package/dist/runtime-rules/type-inference-errors.js.map +1 -0
- package/dist/runtime-rules/type-mismatch-operation.d.ts +23 -0
- package/dist/runtime-rules/type-mismatch-operation.d.ts.map +1 -0
- package/dist/runtime-rules/type-mismatch-operation.js +145 -0
- package/dist/runtime-rules/type-mismatch-operation.js.map +1 -0
- package/dist/runtime-rules/undefined-component-usage.d.ts +20 -0
- package/dist/runtime-rules/undefined-component-usage.d.ts.map +1 -0
- package/dist/runtime-rules/undefined-component-usage.js +138 -0
- package/dist/runtime-rules/undefined-component-usage.js.map +1 -0
- package/dist/runtime-rules/undefined-jsx-component.d.ts +25 -0
- package/dist/runtime-rules/undefined-jsx-component.d.ts.map +1 -0
- package/dist/runtime-rules/undefined-jsx-component.js +269 -0
- package/dist/runtime-rules/undefined-jsx-component.js.map +1 -0
- package/dist/runtime-rules/unsafe-array-operations.d.ts +25 -0
- package/dist/runtime-rules/unsafe-array-operations.d.ts.map +1 -0
- package/dist/runtime-rules/unsafe-array-operations.js +347 -0
- package/dist/runtime-rules/unsafe-array-operations.js.map +1 -0
- package/dist/runtime-rules/unsafe-formatting-methods.d.ts +24 -0
- package/dist/runtime-rules/unsafe-formatting-methods.d.ts.map +1 -0
- package/dist/runtime-rules/unsafe-formatting-methods.js +277 -0
- package/dist/runtime-rules/unsafe-formatting-methods.js.map +1 -0
- package/dist/runtime-rules/unused-component-dependencies.d.ts +19 -0
- package/dist/runtime-rules/unused-component-dependencies.d.ts.map +1 -0
- package/dist/runtime-rules/unused-component-dependencies.js +90 -0
- package/dist/runtime-rules/unused-component-dependencies.js.map +1 -0
- package/dist/runtime-rules/unused-libraries.d.ts +19 -0
- package/dist/runtime-rules/unused-libraries.d.ts.map +1 -0
- package/dist/runtime-rules/unused-libraries.js +127 -0
- package/dist/runtime-rules/unused-libraries.js.map +1 -0
- package/dist/runtime-rules/use-function-declaration.d.ts +18 -0
- package/dist/runtime-rules/use-function-declaration.d.ts.map +1 -0
- package/dist/runtime-rules/use-function-declaration.js +127 -0
- package/dist/runtime-rules/use-function-declaration.js.map +1 -0
- package/dist/runtime-rules/use-unwrap-components.d.ts +19 -0
- package/dist/runtime-rules/use-unwrap-components.d.ts.map +1 -0
- package/dist/runtime-rules/use-unwrap-components.js +84 -0
- package/dist/runtime-rules/use-unwrap-components.js.map +1 -0
- package/dist/runtime-rules/useeffect-unstable-dependencies.d.ts +23 -0
- package/dist/runtime-rules/useeffect-unstable-dependencies.d.ts.map +1 -0
- package/dist/runtime-rules/useeffect-unstable-dependencies.js +215 -0
- package/dist/runtime-rules/useeffect-unstable-dependencies.js.map +1 -0
- package/dist/runtime-rules/utilities-api-validation.d.ts +24 -0
- package/dist/runtime-rules/utilities-api-validation.d.ts.map +1 -0
- package/dist/runtime-rules/utilities-api-validation.js +121 -0
- package/dist/runtime-rules/utilities-api-validation.js.map +1 -0
- package/dist/runtime-rules/utilities-no-direct-instantiation.d.ts +20 -0
- package/dist/runtime-rules/utilities-no-direct-instantiation.d.ts.map +1 -0
- package/dist/runtime-rules/utilities-no-direct-instantiation.js +58 -0
- package/dist/runtime-rules/utilities-no-direct-instantiation.js.map +1 -0
- package/dist/runtime-rules/validate-component-references.d.ts +19 -0
- package/dist/runtime-rules/validate-component-references.d.ts.map +1 -0
- package/dist/runtime-rules/validate-component-references.js +255 -0
- package/dist/runtime-rules/validate-component-references.js.map +1 -0
- package/dist/schema-validation/component-prop-rule.d.ts +131 -0
- package/dist/schema-validation/component-prop-rule.d.ts.map +1 -0
- package/dist/schema-validation/component-prop-rule.js +625 -0
- package/dist/schema-validation/component-prop-rule.js.map +1 -0
- package/dist/schema-validation/index.d.ts +26 -0
- package/dist/schema-validation/index.d.ts.map +1 -0
- package/dist/schema-validation/index.js +26 -0
- package/dist/schema-validation/index.js.map +1 -0
- package/dist/schema-validation/semantic-validators/index.d.ts +23 -0
- package/dist/schema-validation/semantic-validators/index.d.ts.map +1 -0
- package/dist/schema-validation/semantic-validators/index.js +23 -0
- package/dist/schema-validation/semantic-validators/index.js.map +1 -0
- package/dist/schema-validation/semantic-validators/required-when-validator.d.ts +43 -0
- package/dist/schema-validation/semantic-validators/required-when-validator.d.ts.map +1 -0
- package/dist/schema-validation/semantic-validators/required-when-validator.js +94 -0
- package/dist/schema-validation/semantic-validators/required-when-validator.js.map +1 -0
- package/dist/schema-validation/semantic-validators/semantic-validator-registry.d.ts +122 -0
- package/dist/schema-validation/semantic-validators/semantic-validator-registry.d.ts.map +1 -0
- package/dist/schema-validation/semantic-validators/semantic-validator-registry.js +166 -0
- package/dist/schema-validation/semantic-validators/semantic-validator-registry.js.map +1 -0
- package/dist/schema-validation/semantic-validators/semantic-validator.d.ts +260 -0
- package/dist/schema-validation/semantic-validators/semantic-validator.d.ts.map +1 -0
- package/dist/schema-validation/semantic-validators/semantic-validator.js +301 -0
- package/dist/schema-validation/semantic-validators/semantic-validator.js.map +1 -0
- package/dist/schema-validation/semantic-validators/sql-where-clause-validator.d.ts +115 -0
- package/dist/schema-validation/semantic-validators/sql-where-clause-validator.d.ts.map +1 -0
- package/dist/schema-validation/semantic-validators/sql-where-clause-validator.js +381 -0
- package/dist/schema-validation/semantic-validators/sql-where-clause-validator.js.map +1 -0
- package/dist/schema-validation/semantic-validators/subset-of-entity-fields-validator.d.ts +60 -0
- package/dist/schema-validation/semantic-validators/subset-of-entity-fields-validator.d.ts.map +1 -0
- package/dist/schema-validation/semantic-validators/subset-of-entity-fields-validator.js +195 -0
- package/dist/schema-validation/semantic-validators/subset-of-entity-fields-validator.js.map +1 -0
- package/dist/schema-validation/semantic-validators/validation-context.d.ts +335 -0
- package/dist/schema-validation/semantic-validators/validation-context.d.ts.map +1 -0
- package/dist/schema-validation/semantic-validators/validation-context.js +13 -0
- package/dist/schema-validation/semantic-validators/validation-context.js.map +1 -0
- package/dist/styles-type-analyzer.d.ts +64 -0
- package/dist/styles-type-analyzer.d.ts.map +1 -0
- package/dist/styles-type-analyzer.js +242 -0
- package/dist/styles-type-analyzer.js.map +1 -0
- package/dist/type-context.d.ts +184 -0
- package/dist/type-context.d.ts.map +1 -0
- package/dist/type-context.js +415 -0
- package/dist/type-context.js.map +1 -0
- package/dist/type-inference-engine.d.ts +181 -0
- package/dist/type-inference-engine.d.ts.map +1 -0
- package/dist/type-inference-engine.js +1151 -0
- package/dist/type-inference-engine.js.map +1 -0
- package/dist/type-rules/type-compatibility-rule.d.ts +85 -0
- package/dist/type-rules/type-compatibility-rule.d.ts.map +1 -0
- package/dist/type-rules/type-compatibility-rule.js +211 -0
- package/dist/type-rules/type-compatibility-rule.js.map +1 -0
- package/package.json +35 -7
- package/README.md +0 -45
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { traverse, levenshteinDistance } from '../lint-utils.js';
|
|
8
|
+
import * as t from '@babel/types';
|
|
9
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
10
|
+
import { BaseLintRule } from '../lint-rule.js';
|
|
11
|
+
/**
|
|
12
|
+
* Rule: child-component-prop-validation
|
|
13
|
+
*
|
|
14
|
+
* Validates props passed to child/embedded components in JSX against the
|
|
15
|
+
* dependency component specs. Detects:
|
|
16
|
+
* - Nonexistent prop names (no matching property in child spec)
|
|
17
|
+
* - Prop name typos (Levenshtein distance <= 2)
|
|
18
|
+
* - Prop name case mismatches (case-insensitive match exists)
|
|
19
|
+
* - Type mismatches (string passed where number expected, etc.)
|
|
20
|
+
*
|
|
21
|
+
* Child component specs are sourced from componentSpec.dependencies.
|
|
22
|
+
*
|
|
23
|
+
* Severity: high (nonexistent props, type mismatches), medium (case mismatches)
|
|
24
|
+
* Applies to: all components
|
|
25
|
+
*/
|
|
26
|
+
/** Props that are always valid on any child component and should be skipped */
|
|
27
|
+
const STANDARD_CHILD_PROPS = new Set([
|
|
28
|
+
'utilities',
|
|
29
|
+
'styles',
|
|
30
|
+
'components',
|
|
31
|
+
'callbacks',
|
|
32
|
+
'savedUserSettings',
|
|
33
|
+
'onSaveUserSettings',
|
|
34
|
+
'key',
|
|
35
|
+
'ref',
|
|
36
|
+
'children',
|
|
37
|
+
]);
|
|
38
|
+
/**
|
|
39
|
+
* Build a set of event-derived prop names from a component's events array.
|
|
40
|
+
* Events like { name: 'rowClick' } produce 'onRowClick'.
|
|
41
|
+
*/
|
|
42
|
+
function buildEventPropNames(events) {
|
|
43
|
+
const result = new Set();
|
|
44
|
+
if (!events)
|
|
45
|
+
return result;
|
|
46
|
+
for (const event of events) {
|
|
47
|
+
if (event.name) {
|
|
48
|
+
result.add(event.name);
|
|
49
|
+
const onPrefixed = 'on' + event.name.charAt(0).toUpperCase() + event.name.slice(1);
|
|
50
|
+
result.add(onPrefixed);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Attempt to infer the runtime type of a JSX attribute value expression.
|
|
57
|
+
* Returns a simple type string: 'string', 'number', 'boolean', 'array',
|
|
58
|
+
* 'object', 'function', or null if unknown.
|
|
59
|
+
*
|
|
60
|
+
* For identifiers, traces back through the AST looking for useState
|
|
61
|
+
* initializers to determine the type.
|
|
62
|
+
*/
|
|
63
|
+
function inferExpressionType(expr, variableTypes) {
|
|
64
|
+
if (t.isStringLiteral(expr) || t.isTemplateLiteral(expr))
|
|
65
|
+
return 'string';
|
|
66
|
+
if (t.isNumericLiteral(expr))
|
|
67
|
+
return 'number';
|
|
68
|
+
if (t.isBooleanLiteral(expr))
|
|
69
|
+
return 'boolean';
|
|
70
|
+
if (t.isArrayExpression(expr))
|
|
71
|
+
return 'array';
|
|
72
|
+
if (t.isObjectExpression(expr))
|
|
73
|
+
return 'object';
|
|
74
|
+
if (t.isArrowFunctionExpression(expr) || t.isFunctionExpression(expr))
|
|
75
|
+
return 'function';
|
|
76
|
+
if (t.isNullLiteral(expr))
|
|
77
|
+
return null;
|
|
78
|
+
if (t.isIdentifier(expr)) {
|
|
79
|
+
return variableTypes.get(expr.name) ?? null;
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Infer type from a value AST node (used for useState initial values).
|
|
85
|
+
*/
|
|
86
|
+
function inferValueType(node) {
|
|
87
|
+
if (t.isStringLiteral(node) || t.isTemplateLiteral(node))
|
|
88
|
+
return 'string';
|
|
89
|
+
if (t.isNumericLiteral(node))
|
|
90
|
+
return 'number';
|
|
91
|
+
if (t.isBooleanLiteral(node))
|
|
92
|
+
return 'boolean';
|
|
93
|
+
if (t.isArrayExpression(node))
|
|
94
|
+
return 'array';
|
|
95
|
+
if (t.isObjectExpression(node))
|
|
96
|
+
return 'object';
|
|
97
|
+
if (t.isArrowFunctionExpression(node) || t.isFunctionExpression(node))
|
|
98
|
+
return 'function';
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Normalize a spec property type string to one of the simple types
|
|
103
|
+
* we use for comparison.
|
|
104
|
+
*/
|
|
105
|
+
function normalizeSpecType(specType) {
|
|
106
|
+
const lower = specType.toLowerCase().trim();
|
|
107
|
+
if (lower === 'string')
|
|
108
|
+
return 'string';
|
|
109
|
+
if (lower === 'number' || lower === 'integer' || lower === 'float')
|
|
110
|
+
return 'number';
|
|
111
|
+
if (lower === 'boolean' || lower === 'bool')
|
|
112
|
+
return 'boolean';
|
|
113
|
+
if (lower === 'array' || lower.startsWith('array<') || lower.endsWith('[]'))
|
|
114
|
+
return 'array';
|
|
115
|
+
if (lower === 'object')
|
|
116
|
+
return 'object';
|
|
117
|
+
if (lower === 'function')
|
|
118
|
+
return 'function';
|
|
119
|
+
if (lower === 'any')
|
|
120
|
+
return null; // 'any' matches everything
|
|
121
|
+
return null; // complex or unknown types - skip checking
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Check if two types are compatible. Returns true if they match or if
|
|
125
|
+
* either side is unknown/any.
|
|
126
|
+
*/
|
|
127
|
+
function typesAreCompatible(actualType, expectedType) {
|
|
128
|
+
if (actualType === expectedType)
|
|
129
|
+
return true;
|
|
130
|
+
// Arrays are objects in JavaScript — allow object where array is expected and vice versa
|
|
131
|
+
if ((actualType === 'object' && expectedType === 'array') ||
|
|
132
|
+
(actualType === 'array' && expectedType === 'object'))
|
|
133
|
+
return true;
|
|
134
|
+
// JSX string attributes are common for numeric props (e.g., height="300")
|
|
135
|
+
if (actualType === 'string' && expectedType === 'number')
|
|
136
|
+
return true;
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Find the closest matching property name from a list using Levenshtein distance.
|
|
141
|
+
*/
|
|
142
|
+
function findClosestPropName(attrName, validNames) {
|
|
143
|
+
let bestMatch = null;
|
|
144
|
+
for (const name of validNames) {
|
|
145
|
+
const dist = levenshteinDistance(attrName, name);
|
|
146
|
+
if (dist <= 2 && (!bestMatch || dist < bestMatch.distance)) {
|
|
147
|
+
bestMatch = { name, distance: dist };
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return bestMatch;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Try to load component properties and events from the ComponentMetadataEngine registry.
|
|
154
|
+
* Returns the resolved properties and events, or undefined if the registry is not
|
|
155
|
+
* available or the component was not found.
|
|
156
|
+
*/
|
|
157
|
+
function tryRegistryLookup(dep, resolver) {
|
|
158
|
+
if (!resolver)
|
|
159
|
+
return undefined;
|
|
160
|
+
try {
|
|
161
|
+
const registrySpec = resolver(dep.name, dep.namespace, dep.registry);
|
|
162
|
+
if (registrySpec?.properties?.length) {
|
|
163
|
+
return {
|
|
164
|
+
properties: registrySpec.properties,
|
|
165
|
+
events: registrySpec.events,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
// Resolver threw — degrade gracefully
|
|
171
|
+
}
|
|
172
|
+
return undefined;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Build a lookup map from dependency component name to its prop info.
|
|
176
|
+
* Uses a 3-tier fallback:
|
|
177
|
+
* 1. Primary: dep.properties/events from the spec's dependencies array
|
|
178
|
+
* 2. Fallback 1: Registry lookup via the caller-supplied componentResolver
|
|
179
|
+
* 3. Fallback 2: Skip with a low-severity warning
|
|
180
|
+
*/
|
|
181
|
+
function buildDependencyMap(dependencies, warnings, componentResolver) {
|
|
182
|
+
const result = new Map();
|
|
183
|
+
if (!dependencies)
|
|
184
|
+
return result;
|
|
185
|
+
for (const dep of dependencies) {
|
|
186
|
+
if (!dep.name)
|
|
187
|
+
continue;
|
|
188
|
+
let properties = dep.properties ?? [];
|
|
189
|
+
let events = dep.events;
|
|
190
|
+
// Fallback 1: If no properties from spec, ask the resolver
|
|
191
|
+
if (properties.length === 0) {
|
|
192
|
+
const registryResult = tryRegistryLookup(dep, componentResolver);
|
|
193
|
+
if (registryResult) {
|
|
194
|
+
properties = registryResult.properties;
|
|
195
|
+
events = registryResult.events;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
// Fallback 2: Still no properties — emit a warning and skip this dependency
|
|
199
|
+
if (properties.length === 0) {
|
|
200
|
+
warnings.push({
|
|
201
|
+
rule: 'child-component-prop-validation',
|
|
202
|
+
severity: 'low',
|
|
203
|
+
line: 0,
|
|
204
|
+
column: 0,
|
|
205
|
+
message: `Unable to validate props for <${dep.name}> — no property metadata available ` +
|
|
206
|
+
`from spec or registry. Ensure the component spec includes property definitions ` +
|
|
207
|
+
`for accurate validation.`,
|
|
208
|
+
});
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
const propertyNames = new Set();
|
|
212
|
+
const propertyByNameLower = new Map();
|
|
213
|
+
for (const prop of properties) {
|
|
214
|
+
propertyNames.add(prop.name);
|
|
215
|
+
propertyByNameLower.set(prop.name.toLowerCase(), prop);
|
|
216
|
+
}
|
|
217
|
+
result.set(dep.name, {
|
|
218
|
+
properties,
|
|
219
|
+
events,
|
|
220
|
+
propertyNames,
|
|
221
|
+
eventPropNames: buildEventPropNames(events),
|
|
222
|
+
propertyByNameLower,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
return result;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Collect variable type information from useState calls throughout the AST.
|
|
229
|
+
* Maps variable name -> inferred type string.
|
|
230
|
+
*/
|
|
231
|
+
function collectVariableTypes(ast) {
|
|
232
|
+
const variableTypes = new Map();
|
|
233
|
+
traverse(ast, {
|
|
234
|
+
VariableDeclarator(path) {
|
|
235
|
+
// Detect: const [foo, setFoo] = useState(initialValue)
|
|
236
|
+
if (t.isArrayPattern(path.node.id) &&
|
|
237
|
+
t.isCallExpression(path.node.init) &&
|
|
238
|
+
t.isIdentifier(path.node.init.callee) &&
|
|
239
|
+
path.node.init.callee.name === 'useState') {
|
|
240
|
+
const elements = path.node.id.elements;
|
|
241
|
+
if (elements.length >= 1 && t.isIdentifier(elements[0]) && path.node.init.arguments.length >= 1) {
|
|
242
|
+
const varName = elements[0].name;
|
|
243
|
+
const initArg = path.node.init.arguments[0];
|
|
244
|
+
if (t.isExpression(initArg)) {
|
|
245
|
+
const inferredType = inferValueType(initArg);
|
|
246
|
+
if (inferredType) {
|
|
247
|
+
variableTypes.set(varName, inferredType);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
return variableTypes;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Validate the type of a prop value against the expected type from the child spec.
|
|
258
|
+
*/
|
|
259
|
+
function validatePropType(violations, tagName, attrName, attr, childInfo, variableTypes, line, column) {
|
|
260
|
+
// Find the property spec
|
|
261
|
+
const propSpec = childInfo.properties.find((p) => p.name === attrName);
|
|
262
|
+
if (!propSpec)
|
|
263
|
+
return;
|
|
264
|
+
const expectedType = normalizeSpecType(propSpec.type);
|
|
265
|
+
if (!expectedType)
|
|
266
|
+
return; // Can't determine expected type or it's 'any'
|
|
267
|
+
// Get the attribute value expression
|
|
268
|
+
const valueExpr = extractAttributeValueExpression(attr);
|
|
269
|
+
if (!valueExpr)
|
|
270
|
+
return;
|
|
271
|
+
const actualType = inferExpressionType(valueExpr, variableTypes);
|
|
272
|
+
if (!actualType)
|
|
273
|
+
return; // Can't determine actual type
|
|
274
|
+
if (!typesAreCompatible(actualType, expectedType)) {
|
|
275
|
+
violations.push({
|
|
276
|
+
rule: 'child-component-prop-validation',
|
|
277
|
+
severity: 'high',
|
|
278
|
+
line,
|
|
279
|
+
column,
|
|
280
|
+
message: `Type mismatch on prop "${attrName}" of <${tagName}>: ` +
|
|
281
|
+
`expected "${expectedType}" but got "${actualType}".`,
|
|
282
|
+
suggestion: {
|
|
283
|
+
text: `Ensure the value passed to "${attrName}" is of type "${expectedType}".`,
|
|
284
|
+
example: buildTypeFixExample(tagName, attrName, expectedType, actualType),
|
|
285
|
+
},
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Extract the expression from a JSX attribute value.
|
|
291
|
+
*/
|
|
292
|
+
function extractAttributeValueExpression(attr) {
|
|
293
|
+
const value = attr.value;
|
|
294
|
+
if (!value)
|
|
295
|
+
return null; // Boolean shorthand like <Comp disabled />
|
|
296
|
+
if (t.isJSXExpressionContainer(value)) {
|
|
297
|
+
return value.expression;
|
|
298
|
+
}
|
|
299
|
+
if (t.isStringLiteral(value)) {
|
|
300
|
+
return value;
|
|
301
|
+
}
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Build a helpful example showing how to fix a type mismatch.
|
|
306
|
+
*/
|
|
307
|
+
function buildTypeFixExample(tagName, propName, expectedType, actualType) {
|
|
308
|
+
const conversions = {
|
|
309
|
+
number: {
|
|
310
|
+
string: `// Convert string to number:\nconst parsed = Number(value);\n<${tagName} ${propName}={parsed} />`,
|
|
311
|
+
},
|
|
312
|
+
string: {
|
|
313
|
+
number: `// Convert number to string:\n<${tagName} ${propName}={String(value)} />`,
|
|
314
|
+
array: `// If you need a string, join the array:\n<${tagName} ${propName}={values.join(',')} />`,
|
|
315
|
+
},
|
|
316
|
+
boolean: {
|
|
317
|
+
number: `// Convert to boolean:\n<${tagName} ${propName}={value > 0} />`,
|
|
318
|
+
string: `// Convert to boolean:\n<${tagName} ${propName}={value === 'true'} />`,
|
|
319
|
+
},
|
|
320
|
+
array: {
|
|
321
|
+
string: `// Convert string to array:\n<${tagName} ${propName}={value.split(',')} />`,
|
|
322
|
+
},
|
|
323
|
+
};
|
|
324
|
+
return conversions[expectedType]?.[actualType]
|
|
325
|
+
?? `<${tagName} ${propName}={/* provide a ${expectedType} value */} />`;
|
|
326
|
+
}
|
|
327
|
+
let ChildComponentPropValidationRule = class ChildComponentPropValidationRule extends BaseLintRule {
|
|
328
|
+
get Name() { return 'child-component-prop-validation'; }
|
|
329
|
+
get AppliesTo() { return 'all'; }
|
|
330
|
+
Test(ast, _componentName, componentSpec, options) {
|
|
331
|
+
const violations = [];
|
|
332
|
+
// If no dependencies, nothing to validate
|
|
333
|
+
if (!componentSpec?.dependencies || componentSpec.dependencies.length === 0) {
|
|
334
|
+
return violations;
|
|
335
|
+
}
|
|
336
|
+
const depMap = buildDependencyMap(componentSpec.dependencies, violations, options?.componentResolver);
|
|
337
|
+
if (depMap.size === 0)
|
|
338
|
+
return violations;
|
|
339
|
+
// Collect variable types from useState calls for type-checking
|
|
340
|
+
const variableTypes = collectVariableTypes(ast);
|
|
341
|
+
traverse(ast, {
|
|
342
|
+
JSXOpeningElement(path) {
|
|
343
|
+
// Only handle simple <ComponentName ... /> elements
|
|
344
|
+
if (!t.isJSXIdentifier(path.node.name))
|
|
345
|
+
return;
|
|
346
|
+
const tagName = path.node.name.name;
|
|
347
|
+
const childInfo = depMap.get(tagName);
|
|
348
|
+
if (!childInfo)
|
|
349
|
+
return; // Not a known dependency component
|
|
350
|
+
// Full list used for typo detection (accepts both raw event names and on-prefixed)
|
|
351
|
+
const allValidPropNames = [
|
|
352
|
+
...Array.from(childInfo.propertyNames),
|
|
353
|
+
...Array.from(childInfo.eventPropNames),
|
|
354
|
+
];
|
|
355
|
+
// Display list for error messages: only show on-prefixed callback form of events
|
|
356
|
+
const displayPropNames = [
|
|
357
|
+
...Array.from(childInfo.propertyNames),
|
|
358
|
+
...Array.from(childInfo.eventPropNames).filter((n) => n.startsWith('on')),
|
|
359
|
+
];
|
|
360
|
+
for (const attr of path.node.attributes) {
|
|
361
|
+
// Skip spread attributes like {...props}
|
|
362
|
+
if (t.isJSXSpreadAttribute(attr))
|
|
363
|
+
continue;
|
|
364
|
+
const attrName = attr.name && t.isJSXIdentifier(attr.name) ? attr.name.name : null;
|
|
365
|
+
if (!attrName)
|
|
366
|
+
continue;
|
|
367
|
+
// Skip standard props that are always valid
|
|
368
|
+
if (STANDARD_CHILD_PROPS.has(attrName))
|
|
369
|
+
continue;
|
|
370
|
+
// Skip event prop names
|
|
371
|
+
if (childInfo.eventPropNames.has(attrName))
|
|
372
|
+
continue;
|
|
373
|
+
const line = attr.loc?.start.line ?? 0;
|
|
374
|
+
const column = attr.loc?.start.column ?? 0;
|
|
375
|
+
// Check if the prop exists exactly
|
|
376
|
+
if (childInfo.propertyNames.has(attrName)) {
|
|
377
|
+
// Prop exists -- check type compatibility
|
|
378
|
+
validatePropType(violations, tagName, attrName, attr, childInfo, variableTypes, line, column);
|
|
379
|
+
continue;
|
|
380
|
+
}
|
|
381
|
+
// Prop name not found -- check for case mismatch
|
|
382
|
+
const lowerAttrName = attrName.toLowerCase();
|
|
383
|
+
const caseMatch = childInfo.propertyByNameLower.get(lowerAttrName);
|
|
384
|
+
if (caseMatch) {
|
|
385
|
+
violations.push({
|
|
386
|
+
rule: 'child-component-prop-validation',
|
|
387
|
+
severity: 'medium',
|
|
388
|
+
line,
|
|
389
|
+
column,
|
|
390
|
+
message: `Prop "${attrName}" on <${tagName}> has incorrect casing. ` +
|
|
391
|
+
`The correct prop name is "${caseMatch.name}".`,
|
|
392
|
+
suggestion: {
|
|
393
|
+
text: `Change "${attrName}" to "${caseMatch.name}"`,
|
|
394
|
+
example: `<${tagName} ${caseMatch.name}={...} />`,
|
|
395
|
+
},
|
|
396
|
+
});
|
|
397
|
+
continue;
|
|
398
|
+
}
|
|
399
|
+
// Check for typo via Levenshtein distance
|
|
400
|
+
const typoMatch = findClosestPropName(attrName, allValidPropNames);
|
|
401
|
+
if (typoMatch) {
|
|
402
|
+
violations.push({
|
|
403
|
+
rule: 'child-component-prop-validation',
|
|
404
|
+
severity: 'high',
|
|
405
|
+
line,
|
|
406
|
+
column,
|
|
407
|
+
message: `Prop "${attrName}" does not exist on <${tagName}>. ` +
|
|
408
|
+
`Did you mean "${typoMatch.name}"?`,
|
|
409
|
+
suggestion: {
|
|
410
|
+
text: `Change "${attrName}" to "${typoMatch.name}"`,
|
|
411
|
+
example: `<${tagName} ${typoMatch.name}={...} />`,
|
|
412
|
+
},
|
|
413
|
+
});
|
|
414
|
+
continue;
|
|
415
|
+
}
|
|
416
|
+
// No match at all -- nonexistent prop
|
|
417
|
+
const availableProps = displayPropNames.length > 0
|
|
418
|
+
? ` Available props: ${displayPropNames.join(', ')}.`
|
|
419
|
+
: '';
|
|
420
|
+
violations.push({
|
|
421
|
+
rule: 'child-component-prop-validation',
|
|
422
|
+
severity: 'high',
|
|
423
|
+
line,
|
|
424
|
+
column,
|
|
425
|
+
message: `Prop "${attrName}" does not exist on <${tagName}>.${availableProps}`,
|
|
426
|
+
suggestion: {
|
|
427
|
+
text: `Remove "${attrName}" or use one of the available props defined in the ${tagName} component spec.`,
|
|
428
|
+
example: displayPropNames.length > 0
|
|
429
|
+
? `<${tagName} ${displayPropNames[0]}={...} />`
|
|
430
|
+
: `<${tagName} />`,
|
|
431
|
+
},
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
});
|
|
436
|
+
return violations;
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
ChildComponentPropValidationRule = __decorate([
|
|
440
|
+
RegisterClass(BaseLintRule, 'child-component-prop-validation')
|
|
441
|
+
], ChildComponentPropValidationRule);
|
|
442
|
+
export { ChildComponentPropValidationRule };
|
|
443
|
+
//# sourceMappingURL=child-component-prop-validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"child-component-prop-validation.js","sourceRoot":"","s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AC,MAAM,GAAG,CAAC;gCAClC,CAAC,CAAC,IAAI,OAAO,IAAI,gBAAgB,CAAC,CAAC,CAAC,WAAW;gCAC/C,CAAC,CAAC,IAAI,OAAO,KAAK;yBACrB;qBACF,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;SACF,CAAC,CAAC;QAEH,OAAO,UAAU,CAAC;IACpB,CAAC;CACF,CAAA;AA5IY,gCAAgC;IAD5C,aAAa,CAAC,YAAY,EAAE,iCAAiC,CAAC;GAClD,gCAAgC,CA4I5C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as t from '@babel/types';
|
|
2
|
+
import { BaseLintRule } from '../lint-rule.js';
|
|
3
|
+
import { Violation } from '../component-linter.js';
|
|
4
|
+
import { ComponentSpec } from '@memberjunction/interactive-component-types';
|
|
5
|
+
/**
|
|
6
|
+
* Rule: component-name-mismatch
|
|
7
|
+
*
|
|
8
|
+
* Ensures that the component function name matches the name specified in the ComponentSpec.
|
|
9
|
+
* The function name must match exactly, including capitalization.
|
|
10
|
+
*
|
|
11
|
+
* Severity: critical
|
|
12
|
+
* Applies to: all components
|
|
13
|
+
*/
|
|
14
|
+
export declare class ComponentNameMismatchRule extends BaseLintRule {
|
|
15
|
+
get Name(): string;
|
|
16
|
+
get AppliesTo(): 'all' | 'child' | 'root';
|
|
17
|
+
Test(ast: t.File, componentName: string, componentSpec?: ComponentSpec): Violation[];
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=component-name-mismatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-name-mismatch.d.ts","sourceRoot":"","sources":["../../src/runtime-rules/component-name-mismatch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAE5E;;;;;;;;GAQG;AACH,qBACa,yBAA0B,SAAQ,YAAY;IACzD,IAAI,IAAI,WAAwC;IAChD,IAAI,SAAS,IAAI,KAAK,GAAG,OAAO,GAAG,MAAM,CAAkB;IAE3D,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,aAAa,GAAG,SAAS,EAAE;CA+DrF"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { traverse } from '../lint-utils.js';
|
|
8
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
9
|
+
import { BaseLintRule } from '../lint-rule.js';
|
|
10
|
+
/**
|
|
11
|
+
* Rule: component-name-mismatch
|
|
12
|
+
*
|
|
13
|
+
* Ensures that the component function name matches the name specified in the ComponentSpec.
|
|
14
|
+
* The function name must match exactly, including capitalization.
|
|
15
|
+
*
|
|
16
|
+
* Severity: critical
|
|
17
|
+
* Applies to: all components
|
|
18
|
+
*/
|
|
19
|
+
let ComponentNameMismatchRule = class ComponentNameMismatchRule extends BaseLintRule {
|
|
20
|
+
get Name() { return 'component-name-mismatch'; }
|
|
21
|
+
get AppliesTo() { return 'all'; }
|
|
22
|
+
Test(ast, componentName, componentSpec) {
|
|
23
|
+
const violations = [];
|
|
24
|
+
// The expected component name from the spec
|
|
25
|
+
const expectedName = componentSpec?.name || componentName;
|
|
26
|
+
// Find the main function declaration
|
|
27
|
+
let foundMainFunction = false;
|
|
28
|
+
traverse(ast, {
|
|
29
|
+
FunctionDeclaration(path) {
|
|
30
|
+
// Only check top-level function declarations
|
|
31
|
+
if (path.parent === ast.program && path.node.id) {
|
|
32
|
+
const funcName = path.node.id.name;
|
|
33
|
+
// Check if this looks like the main component function
|
|
34
|
+
// (starts with capital letter and has the typical props parameter)
|
|
35
|
+
if (/^[A-Z]/.test(funcName)) {
|
|
36
|
+
foundMainFunction = true;
|
|
37
|
+
// Check if the function name matches the spec name
|
|
38
|
+
if (funcName !== expectedName) {
|
|
39
|
+
violations.push({
|
|
40
|
+
rule: 'component-name-mismatch',
|
|
41
|
+
severity: 'critical',
|
|
42
|
+
line: path.node.loc?.start.line || 0,
|
|
43
|
+
column: path.node.loc?.start.column || 0,
|
|
44
|
+
message: `Component function name "${funcName}" does not match the spec name "${expectedName}". The function must be named exactly as specified in the component spec. Rename the function to: function ${expectedName}(...)`,
|
|
45
|
+
code: `function ${funcName}(...)`,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
// Also check that the first letter case matches
|
|
49
|
+
const expectedFirstChar = expectedName.charAt(0);
|
|
50
|
+
const actualFirstChar = funcName.charAt(0);
|
|
51
|
+
if (expectedFirstChar !== actualFirstChar && expectedName.toLowerCase() === funcName.toLowerCase()) {
|
|
52
|
+
violations.push({
|
|
53
|
+
rule: 'component-name-mismatch',
|
|
54
|
+
severity: 'critical',
|
|
55
|
+
line: path.node.loc?.start.line || 0,
|
|
56
|
+
column: path.node.loc?.start.column || 0,
|
|
57
|
+
message: `Component function name "${funcName}" has incorrect capitalization. Expected "${expectedName}" (note the case of the first letter). The function name must match exactly, including capitalization: function ${expectedName}(...)`,
|
|
58
|
+
code: `function ${funcName}(...)`,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
// If we didn't find a main function with the expected name
|
|
66
|
+
if (!foundMainFunction && componentSpec?.name) {
|
|
67
|
+
violations.push({
|
|
68
|
+
rule: 'component-name-mismatch',
|
|
69
|
+
severity: 'critical',
|
|
70
|
+
line: 1,
|
|
71
|
+
column: 0,
|
|
72
|
+
message: `No function declaration found with the expected name "${expectedName}". The main component function must be named exactly as specified in the spec. Add a function declaration: function ${expectedName}({ utilities, styles, components, callbacks, savedUserSettings, onSaveUserSettings }) { ... }`,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return violations;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
ComponentNameMismatchRule = __decorate([
|
|
79
|
+
RegisterClass(BaseLintRule, 'component-name-mismatch')
|
|
80
|
+
], ComponentNameMismatchRule);
|
|
81
|
+
export { ComponentNameMismatchRule };
|
|
82
|
+
//# sourceMappingURL=component-name-mismatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-name-mismatch.js","sourceRoot":"","sources":["../../src/runtime-rules/component-name-mismatch.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAY,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAI5C;;;;;;;;GAQG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,YAAY;IACzD,IAAI,IAAI,KAAK,OAAO,yBAAyB,CAAC,CAAC,CAAC;IAChD,IAAI,SAAS,KAA+B,OAAO,KAAK,CAAC,CAAC,CAAC;IAE3D,IAAI,CAAC,GAAW,EAAE,aAAqB,EAAE,aAA6B;QACpE,MAAM,UAAU,GAAgB,EAAE,CAAC;QAEnC,4CAA4C;QAC5C,MAAM,YAAY,GAAG,aAAa,EAAE,IAAI,IAAI,aAAa,CAAC;QAE1D,qCAAqC;QACrC,IAAI,iBAAiB,GAAG,KAAK,CAAC;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AC,GAAG,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC;gCACpC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC;gCACxC,OAAO,EAAE,4BAA4B,QAAQ,6CAA6C,YAAY,mHAAmH,YAAY,OAAO;gCAC5O,IAAI,EAAE,YAAY,QAAQ,OAAO;6BAClC,CAAC,CAAC;wBACL,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAC,CAAC;QAEH,2DAA2D;QAC3D,IAAI,CAAC,iBAAiB,IAAI,aAAa,EAAE,IAAI,EAAE,CAAC;YAC9C,UAAU,CAAC,IAAI,CAAC;gBACd,IAAI,EAAE,yBAAyB;gBAC/B,QAAQ,EAAE,UAAU;gBACpB,IAAI,EAAE,CAAC;gBACP,MAAM,EAAE,CAAC;gBACT,OAAO,EAAE,yDAAyD,YAAY,uHAAuH,YAAY,+FAA+F;aACjT,CAAC,CAAC;QACL,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF,CAAA;AAnEY,yBAAyB;IADrC,aAAa,CAAC,YAAY,EAAE,yBAAyB,CAAC;GAC1C,yBAAyB,CAmErC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as t from '@babel/types';
|
|
2
|
+
import { BaseLintRule } from '../lint-rule.js';
|
|
3
|
+
import { Violation } from '../component-linter.js';
|
|
4
|
+
import { ComponentSpec } from '@memberjunction/interactive-component-types';
|
|
5
|
+
/**
|
|
6
|
+
* Rule: component-not-in-dependencies
|
|
7
|
+
*
|
|
8
|
+
* Ensures that all components accessed via components.X are defined in the
|
|
9
|
+
* component spec's dependencies array. Using undefined components will cause
|
|
10
|
+
* runtime errors.
|
|
11
|
+
*
|
|
12
|
+
* Severity: critical (causes runtime errors)
|
|
13
|
+
* Applies to: all components
|
|
14
|
+
*/
|
|
15
|
+
export declare class ComponentNotInDependenciesRule extends BaseLintRule {
|
|
16
|
+
get Name(): string;
|
|
17
|
+
get AppliesTo(): 'all' | 'child' | 'root';
|
|
18
|
+
Test(ast: t.File, componentName: string, componentSpec?: ComponentSpec): Violation[];
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=component-not-in-dependencies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-not-in-dependencies.d.ts","sourceRoot":"","sources":["../../src/runtime-rules/component-not-in-dependencies.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAE5E;;;;;;;;;GASG;AACH,qBACa,8BAA+B,SAAQ,YAAY;IAC9D,IAAI,IAAI,WAA8C;IACtD,IAAI,SAAS,IAAI,KAAK,GAAG,OAAO,GAAG,MAAM,CAAkB;IAE3D,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,aAAa,GAAG,SAAS,EAAE;CAyErF"}
|