@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,270 @@
|
|
|
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 * as t from '@babel/types';
|
|
9
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
10
|
+
import { BaseLintRule } from '../lint-rule.js';
|
|
11
|
+
import { TypeContext, mapSQLTypeToJSType } from '../type-context.js';
|
|
12
|
+
/**
|
|
13
|
+
* Rule: chart-field-validation
|
|
14
|
+
*
|
|
15
|
+
* Validates that chart component props reference fields that exist in the data source.
|
|
16
|
+
* Checks valueField, groupByField/groupBy, and seriesField against available fields
|
|
17
|
+
* from entity metadata or query fieldMetadata in the spec. Also validates that
|
|
18
|
+
* aggregate functions (average, sum) are only applied to numeric fields.
|
|
19
|
+
*
|
|
20
|
+
* Severity: high
|
|
21
|
+
* Applies to: all components
|
|
22
|
+
*/
|
|
23
|
+
/** Chart-related prop names that reference data fields */
|
|
24
|
+
const CHART_FIELD_PROPS = new Set(['valueField', 'groupByField', 'groupBy', 'seriesField']);
|
|
25
|
+
/** Props that specify aggregate functions */
|
|
26
|
+
const AGGREGATE_PROP = 'aggregateFunction';
|
|
27
|
+
/** Aggregate functions that require numeric fields */
|
|
28
|
+
const NUMERIC_AGGREGATES = new Set(['sum', 'average', 'avg', 'min', 'max', 'median', 'standardDeviation']);
|
|
29
|
+
/** SQL types that map to numeric JavaScript types */
|
|
30
|
+
const NUMERIC_SQL_TYPES = new Set([
|
|
31
|
+
'int', 'bigint', 'smallint', 'tinyint', 'decimal', 'numeric',
|
|
32
|
+
'float', 'real', 'money', 'smallmoney',
|
|
33
|
+
]);
|
|
34
|
+
/** Chart component name patterns */
|
|
35
|
+
const CHART_COMPONENT_NAMES = new Set(['SimpleChart', 'MultiSeriesChart']);
|
|
36
|
+
/**
|
|
37
|
+
* Checks if a JSX element name matches a chart component.
|
|
38
|
+
* Matches known chart names and dependency components with chart-related props.
|
|
39
|
+
*/
|
|
40
|
+
function isChartComponent(elementName, hasChartProps) {
|
|
41
|
+
if (CHART_COMPONENT_NAMES.has(elementName))
|
|
42
|
+
return true;
|
|
43
|
+
// If the element has chart field props, treat it as a chart component
|
|
44
|
+
return hasChartProps;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Collects available field names and their SQL types from the component spec's data requirements.
|
|
48
|
+
* Merges entity fieldMetadata and query fields into a unified map.
|
|
49
|
+
*/
|
|
50
|
+
function collectAvailableFields(typeContext, componentSpec) {
|
|
51
|
+
const fieldMap = new Map(); // fieldName -> sqlType
|
|
52
|
+
// Collect from entities
|
|
53
|
+
if (componentSpec.dataRequirements?.entities) {
|
|
54
|
+
for (const entity of componentSpec.dataRequirements.entities) {
|
|
55
|
+
const entityFields = typeContext.getEntityFieldTypesSync(entity.name);
|
|
56
|
+
for (const [fieldName, fieldInfo] of entityFields) {
|
|
57
|
+
fieldMap.set(fieldName, fieldInfo.sqlType ?? 'nvarchar');
|
|
58
|
+
}
|
|
59
|
+
// Also use fieldMetadata directly from the spec (lightweight info)
|
|
60
|
+
if (entity.fieldMetadata) {
|
|
61
|
+
for (const fm of entity.fieldMetadata) {
|
|
62
|
+
if (!fieldMap.has(fm.name)) {
|
|
63
|
+
fieldMap.set(fm.name, fm.type);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
// Collect from queries
|
|
70
|
+
if (componentSpec.dataRequirements?.queries) {
|
|
71
|
+
for (const query of componentSpec.dataRequirements.queries) {
|
|
72
|
+
const queryFields = typeContext.getQueryFieldTypes(query.name, query.categoryPath);
|
|
73
|
+
if (queryFields) {
|
|
74
|
+
for (const [fieldName, fieldInfo] of queryFields) {
|
|
75
|
+
if (!fieldMap.has(fieldName)) {
|
|
76
|
+
fieldMap.set(fieldName, fieldInfo.sqlType ?? 'nvarchar');
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
// Also use fields directly from the query spec
|
|
81
|
+
if (query.fields) {
|
|
82
|
+
for (const f of query.fields) {
|
|
83
|
+
if (!fieldMap.has(f.name)) {
|
|
84
|
+
fieldMap.set(f.name, f.type);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return fieldMap;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Checks whether a SQL type is numeric.
|
|
94
|
+
*/
|
|
95
|
+
function isNumericSqlType(sqlType) {
|
|
96
|
+
const normalized = sqlType.toLowerCase().replace(/\(.*\)/, '').trim();
|
|
97
|
+
if (NUMERIC_SQL_TYPES.has(normalized))
|
|
98
|
+
return true;
|
|
99
|
+
return mapSQLTypeToJSType(normalized) === 'number';
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Extracts JSX attribute props from a JSXOpeningElement and returns them as a map.
|
|
103
|
+
*/
|
|
104
|
+
function extractJsxProps(openingElement) {
|
|
105
|
+
const props = new Map();
|
|
106
|
+
for (const attr of openingElement.attributes) {
|
|
107
|
+
if (t.isJSXAttribute(attr) && t.isJSXIdentifier(attr.name)) {
|
|
108
|
+
props.set(attr.name.name, attr);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return props;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Extracts a string literal value from a JSX attribute value node.
|
|
115
|
+
* Returns null if the value is not a string literal.
|
|
116
|
+
*/
|
|
117
|
+
function getStringLiteralFromAttr(attr) {
|
|
118
|
+
if (t.isStringLiteral(attr.value)) {
|
|
119
|
+
return attr.value.value;
|
|
120
|
+
}
|
|
121
|
+
// Handle JSXExpressionContainer wrapping a string literal
|
|
122
|
+
if (t.isJSXExpressionContainer(attr.value) &&
|
|
123
|
+
t.isStringLiteral(attr.value.expression)) {
|
|
124
|
+
return attr.value.expression.value;
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Validates that chart field props (valueField, groupBy, seriesField) reference
|
|
130
|
+
* fields that exist in the available data source fields.
|
|
131
|
+
*/
|
|
132
|
+
function validateChartFieldProps(props, availableFields, violations) {
|
|
133
|
+
for (const propName of CHART_FIELD_PROPS) {
|
|
134
|
+
const attr = props.get(propName);
|
|
135
|
+
if (!attr)
|
|
136
|
+
continue;
|
|
137
|
+
const fieldValue = getStringLiteralFromAttr(attr);
|
|
138
|
+
if (!fieldValue)
|
|
139
|
+
continue;
|
|
140
|
+
if (!availableFields.has(fieldValue)) {
|
|
141
|
+
const available = Array.from(availableFields.keys()).slice(0, 10);
|
|
142
|
+
const moreText = availableFields.size > 10
|
|
143
|
+
? ` and ${availableFields.size - 10} more`
|
|
144
|
+
: '';
|
|
145
|
+
violations.push({
|
|
146
|
+
rule: 'chart-field-validation',
|
|
147
|
+
severity: 'high',
|
|
148
|
+
line: attr.loc?.start.line ?? 0,
|
|
149
|
+
column: attr.loc?.start.column ?? 0,
|
|
150
|
+
message: `Chart prop "${propName}" references field "${fieldValue}" which does not exist in the data source. Available fields: ${available.join(', ')}${moreText}`,
|
|
151
|
+
code: `${propName}="${fieldValue}"`,
|
|
152
|
+
suggestion: {
|
|
153
|
+
text: `Use one of the available fields: ${available.join(', ')}${moreText}`,
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Validates that aggregate functions (sum, average, etc.) are only applied
|
|
161
|
+
* to numeric valueField references.
|
|
162
|
+
*/
|
|
163
|
+
function validateAggregateFunction(props, availableFields, violations) {
|
|
164
|
+
const aggregateAttr = props.get(AGGREGATE_PROP);
|
|
165
|
+
if (!aggregateAttr)
|
|
166
|
+
return;
|
|
167
|
+
const aggregateValue = getStringLiteralFromAttr(aggregateAttr);
|
|
168
|
+
if (!aggregateValue)
|
|
169
|
+
return;
|
|
170
|
+
if (!NUMERIC_AGGREGATES.has(aggregateValue.toLowerCase()))
|
|
171
|
+
return;
|
|
172
|
+
// Check if valueField references a non-numeric field
|
|
173
|
+
const valueFieldAttr = props.get('valueField');
|
|
174
|
+
if (!valueFieldAttr)
|
|
175
|
+
return;
|
|
176
|
+
const valueFieldName = getStringLiteralFromAttr(valueFieldAttr);
|
|
177
|
+
if (!valueFieldName)
|
|
178
|
+
return;
|
|
179
|
+
const sqlType = availableFields.get(valueFieldName);
|
|
180
|
+
if (!sqlType)
|
|
181
|
+
return; // Field doesn't exist - already caught by field validation
|
|
182
|
+
if (!isNumericSqlType(sqlType)) {
|
|
183
|
+
violations.push({
|
|
184
|
+
rule: 'chart-field-validation',
|
|
185
|
+
severity: 'high',
|
|
186
|
+
line: aggregateAttr.loc?.start.line ?? 0,
|
|
187
|
+
column: aggregateAttr.loc?.start.column ?? 0,
|
|
188
|
+
message: `Aggregate function "${aggregateValue}" requires a numeric field, but valueField "${valueFieldName}" has type "${sqlType}" which is not numeric`,
|
|
189
|
+
code: `aggregateFunction="${aggregateValue}" valueField="${valueFieldName}"`,
|
|
190
|
+
suggestion: {
|
|
191
|
+
text: `Use a numeric field for "${aggregateValue}" aggregation, or use "count" which works on all field types`,
|
|
192
|
+
},
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
let ChartFieldValidationRule = class ChartFieldValidationRule extends BaseLintRule {
|
|
197
|
+
get Name() { return 'chart-field-validation'; }
|
|
198
|
+
get AppliesTo() { return 'all'; }
|
|
199
|
+
Test(ast, _componentName, componentSpec) {
|
|
200
|
+
const violations = [];
|
|
201
|
+
if (!componentSpec?.dataRequirements) {
|
|
202
|
+
return violations;
|
|
203
|
+
}
|
|
204
|
+
const typeContext = new TypeContext(componentSpec);
|
|
205
|
+
const availableFields = collectAvailableFields(typeContext, componentSpec);
|
|
206
|
+
// If no fields found in the spec, skip validation
|
|
207
|
+
if (availableFields.size === 0) {
|
|
208
|
+
return violations;
|
|
209
|
+
}
|
|
210
|
+
// Check if the component contains data transformations (.map, .reduce, .flatMap)
|
|
211
|
+
// that could create computed fields not in the original metadata.
|
|
212
|
+
// If so, skip chart field validation since we can't statically determine field names.
|
|
213
|
+
let hasDataTransformations = false;
|
|
214
|
+
traverse(ast, {
|
|
215
|
+
CallExpression(p) {
|
|
216
|
+
if (t.isMemberExpression(p.node.callee) && t.isIdentifier(p.node.callee.property)) {
|
|
217
|
+
const method = p.node.callee.property.name;
|
|
218
|
+
if (['map', 'flatMap', 'reduce'].includes(method)) {
|
|
219
|
+
hasDataTransformations = true;
|
|
220
|
+
p.stop();
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
noScope: true,
|
|
225
|
+
});
|
|
226
|
+
if (hasDataTransformations) {
|
|
227
|
+
return violations;
|
|
228
|
+
}
|
|
229
|
+
traverse(ast, {
|
|
230
|
+
JSXOpeningElement(path) {
|
|
231
|
+
const nameNode = path.node.name;
|
|
232
|
+
if (!t.isJSXIdentifier(nameNode))
|
|
233
|
+
return;
|
|
234
|
+
const props = extractJsxProps(path.node);
|
|
235
|
+
const hasChartProps = Array.from(props.keys()).some((p) => CHART_FIELD_PROPS.has(p) || p === AGGREGATE_PROP);
|
|
236
|
+
if (!isChartComponent(nameNode.name, hasChartProps))
|
|
237
|
+
return;
|
|
238
|
+
// Check if the data prop comes from a transformation (.map, .reduce, etc.)
|
|
239
|
+
// If so, the fields may differ from raw metadata — skip validation
|
|
240
|
+
const dataAttr = props.get('data');
|
|
241
|
+
if (dataAttr) {
|
|
242
|
+
const dataValue = t.isJSXExpressionContainer(dataAttr.value) ? dataAttr.value.expression : null;
|
|
243
|
+
if (dataValue && t.isIdentifier(dataValue)) {
|
|
244
|
+
const binding = path.scope.getBinding(dataValue.name);
|
|
245
|
+
if (binding && t.isVariableDeclarator(binding.path.node)) {
|
|
246
|
+
const init = binding.path.node.init;
|
|
247
|
+
// Check if initialized from a .map(), .filter(), .reduce(), etc.
|
|
248
|
+
if (init && t.isCallExpression(init) && t.isMemberExpression(init.callee) && t.isIdentifier(init.callee.property)) {
|
|
249
|
+
const method = init.callee.property.name;
|
|
250
|
+
if (['map', 'flatMap', 'reduce'].includes(method)) {
|
|
251
|
+
return; // Data is transformed — can't validate fields statically
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
// Validate each chart field prop
|
|
258
|
+
validateChartFieldProps(props, availableFields, violations);
|
|
259
|
+
// Validate aggregate function on numeric fields
|
|
260
|
+
validateAggregateFunction(props, availableFields, violations);
|
|
261
|
+
},
|
|
262
|
+
});
|
|
263
|
+
return violations;
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
ChartFieldValidationRule = __decorate([
|
|
267
|
+
RegisterClass(BaseLintRule, 'chart-field-validation')
|
|
268
|
+
], ChartFieldValidationRule);
|
|
269
|
+
export { ChartFieldValidationRule };
|
|
270
|
+
//# sourceMappingURL=chart-field-validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart-field-validation.js","sourceRoot":"","sources":["../../src/runtime-rules/chart-field-validation.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAY,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAElE;;;;;;;;;;GAUG;AAEH,0DAA0D;AAC1D,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CA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C,iEAAiE;4BACjE,IAAI,IAAI,IAAI,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;gCAClH,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;gCACzC,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;oCAClD,OAAO,CAAC,yDAAyD;gCACnE,CAAC;4BACH,CAAC;wBACH,CAAC;oBACH,CAAC;gBACH,CAAC;gBAED,iCAAiC;gBACjC,uBAAuB,CAAC,KAAK,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;gBAE5D,gDAAgD;gBAChD,yBAAyB,CAAC,KAAK,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;YAChE,CAAC;SACF,CAAC,CAAC;QAEH,OAAO,UAAU,CAAC;IACpB,CAAC;CACF,CAAA;AAjFY,wBAAwB;IADpC,aAAa,CAAC,YAAY,EAAE,wBAAwB,CAAC;GACzC,wBAAwB,CAiFpC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
import type { LinterOptions } from '../linter-options.js';
|
|
6
|
+
export declare class ChildComponentPropValidationRule extends BaseLintRule {
|
|
7
|
+
get Name(): string;
|
|
8
|
+
get AppliesTo(): 'all' | 'child' | 'root';
|
|
9
|
+
Test(ast: t.File, _componentName: string, componentSpec?: ComponentSpec, options?: LinterOptions): Violation[];
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=child-component-prop-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"child-component-prop-validation.d.ts","sourceRoot":"","sources":["../../src/runtime-rules/child-component-prop-validation.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,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAwWvD,qBACa,gCAAiC,SAAQ,YAAY;IAChE,IAAI,IAAI,WAAgD;IACxD,IAAI,SAAS,IAAI,KAAK,GAAG,OAAO,GAAG,MAAM,CAAkB;IAE3D,IAAI,CACF,GAAG,EAAE,CAAC,CAAC,IAAI,EACX,cAAc,EAAE,MAAM,EACtB,aAAa,CAAC,EAAE,aAAa,EAC7B,OAAO,CAAC,EAAE,aAAa,GACtB,SAAS,EAAE;CAmIf"}
|