@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,223 @@
|
|
|
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
|
+
/**
|
|
12
|
+
* Rule: ai-tools-availability-check
|
|
13
|
+
*
|
|
14
|
+
* Checks that `utilities.ai` is guarded with a null/undefined check before use.
|
|
15
|
+
* The `ai` property on the utilities object may be undefined if the AI tools
|
|
16
|
+
* are not configured or available. Accessing methods on it without a guard
|
|
17
|
+
* will throw a runtime error.
|
|
18
|
+
*
|
|
19
|
+
* Correct patterns:
|
|
20
|
+
* if (utilities.ai) { await utilities.ai.ExecutePrompt(...); }
|
|
21
|
+
* const result = await utilities.ai?.ExecutePrompt(...);
|
|
22
|
+
*
|
|
23
|
+
* Incorrect pattern:
|
|
24
|
+
* const result = await utilities.ai.ExecutePrompt(...);
|
|
25
|
+
*
|
|
26
|
+
* Severity: medium
|
|
27
|
+
* Applies to: all components
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Checks if a NodePath is inside a guard that checks `utilities.ai` for truthiness.
|
|
31
|
+
* Recognized guard patterns:
|
|
32
|
+
* - if (utilities.ai) { ... }
|
|
33
|
+
* - if (utilities.ai != null) { ... }
|
|
34
|
+
* - utilities.ai && ...
|
|
35
|
+
*/
|
|
36
|
+
function isInsideAiGuard(path) {
|
|
37
|
+
let current = path.parentPath;
|
|
38
|
+
while (current) {
|
|
39
|
+
// Check if statements
|
|
40
|
+
if (current.isIfStatement()) {
|
|
41
|
+
if (testChecksUtilitiesAi(current.node.test)) {
|
|
42
|
+
if (isInConsequent(path.node, current.node)) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// Check logical && guards: utilities.ai && utilities.ai.ExecutePrompt(...)
|
|
48
|
+
if (current.isLogicalExpression() && current.node.operator === '&&') {
|
|
49
|
+
if (testChecksUtilitiesAi(current.node.left)) {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// Check ternary: utilities.ai ? utilities.ai.ExecutePrompt(...) : null
|
|
54
|
+
if (current.isConditionalExpression()) {
|
|
55
|
+
if (testChecksUtilitiesAi(current.node.test)) {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Check try/catch: try { utilities.ai.ExecutePrompt(...) } catch { ... }
|
|
60
|
+
if (current.isTryStatement()) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
// Check for early-return guard in enclosing function:
|
|
64
|
+
// if (!utilities.ai) return; OR if (!utilities.ai) { return; }
|
|
65
|
+
if (current.isFunction()) {
|
|
66
|
+
const body = current.get('body');
|
|
67
|
+
if (body && !Array.isArray(body) && body.isBlockStatement()) {
|
|
68
|
+
for (const stmt of body.get('body')) {
|
|
69
|
+
if (stmt.isIfStatement()) {
|
|
70
|
+
const test = stmt.node.test;
|
|
71
|
+
// Check for: if (!utilities.ai) return;
|
|
72
|
+
if (t.isUnaryExpression(test) && test.operator === '!' && isUtilitiesAiAccess(test.argument)) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
// Check for: if (utilities.ai == null) return;
|
|
76
|
+
if (t.isBinaryExpression(test) && (test.operator === '==' || test.operator === '===')) {
|
|
77
|
+
if (isUtilitiesAiAccess(test.left) &&
|
|
78
|
+
(t.isNullLiteral(test.right) || (t.isIdentifier(test.right) && test.right.name === 'undefined'))) {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// Stop walking up past the function boundary
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
current = current.parentPath;
|
|
89
|
+
}
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Checks if a test expression is checking `utilities.ai` for truthiness.
|
|
94
|
+
*/
|
|
95
|
+
function testChecksUtilitiesAi(test) {
|
|
96
|
+
// Direct: utilities.ai
|
|
97
|
+
if (isUtilitiesAiAccess(test)) {
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
// Negated null check: utilities.ai != null or utilities.ai !== null
|
|
101
|
+
// Also: utilities.ai !== undefined
|
|
102
|
+
if (t.isBinaryExpression(test) && (test.operator === '!=' || test.operator === '!==')) {
|
|
103
|
+
if (isUtilitiesAiAccess(test.left) &&
|
|
104
|
+
(t.isNullLiteral(test.right) || (t.isIdentifier(test.right) && test.right.name === 'undefined'))) {
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// Logical AND chain
|
|
109
|
+
if (t.isLogicalExpression(test) && test.operator === '&&') {
|
|
110
|
+
return testChecksUtilitiesAi(test.left) || testChecksUtilitiesAi(test.right);
|
|
111
|
+
}
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Checks if a node is `utilities.ai` member expression.
|
|
116
|
+
*/
|
|
117
|
+
function isUtilitiesAiAccess(node) {
|
|
118
|
+
return (t.isMemberExpression(node) &&
|
|
119
|
+
t.isIdentifier(node.object) &&
|
|
120
|
+
node.object.name === 'utilities' &&
|
|
121
|
+
t.isIdentifier(node.property) &&
|
|
122
|
+
node.property.name === 'ai');
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Checks if targetNode is within the consequent (true branch) of an if statement.
|
|
126
|
+
*/
|
|
127
|
+
function isInConsequent(targetNode, ifStatement) {
|
|
128
|
+
let found = false;
|
|
129
|
+
traverse(ifStatement.consequent, {
|
|
130
|
+
enter(innerPath) {
|
|
131
|
+
if (innerPath.node === targetNode) {
|
|
132
|
+
found = true;
|
|
133
|
+
innerPath.stop();
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
noScope: true,
|
|
137
|
+
});
|
|
138
|
+
return found;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Checks if a MemberExpression accesses a property/method on utilities.ai
|
|
142
|
+
* (i.e., utilities.ai.SomeMethod or utilities.ai.someProperty).
|
|
143
|
+
*/
|
|
144
|
+
function isUtilitiesAiMethodAccess(node) {
|
|
145
|
+
// The object should be utilities.ai
|
|
146
|
+
return isUtilitiesAiAccess(node.object);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Checks if the access uses optional chaining at the ai level.
|
|
150
|
+
* Pattern: utilities.ai?.ExecutePrompt(...)
|
|
151
|
+
* In the AST this appears as an OptionalMemberExpression chain.
|
|
152
|
+
*/
|
|
153
|
+
function isOptionalAiAccess(path) {
|
|
154
|
+
// Check if parent is an optional call expression chained from utilities.ai
|
|
155
|
+
// Pattern: utilities.ai?.method() results in OptionalCallExpression
|
|
156
|
+
const parent = path.parent;
|
|
157
|
+
if (t.isOptionalCallExpression(parent) || t.isOptionalMemberExpression(parent)) {
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
// Check if the utilities.ai part itself is optional: utilities?.ai?.method()
|
|
161
|
+
if (t.isOptionalMemberExpression(path.node.object)) {
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
let AiToolsAvailabilityCheckRule = class AiToolsAvailabilityCheckRule extends BaseLintRule {
|
|
167
|
+
get Name() { return 'ai-tools-availability-check'; }
|
|
168
|
+
get AppliesTo() { return 'all'; }
|
|
169
|
+
Test(ast) {
|
|
170
|
+
const violations = [];
|
|
171
|
+
// First pass: count total utilities.ai accesses (guarded and unguarded)
|
|
172
|
+
// If the component uses utilities.ai extensively, it's designed for AI environments
|
|
173
|
+
let totalAiAccesses = 0;
|
|
174
|
+
traverse(ast, {
|
|
175
|
+
MemberExpression(path) {
|
|
176
|
+
if (isUtilitiesAiMethodAccess(path.node))
|
|
177
|
+
totalAiAccesses++;
|
|
178
|
+
},
|
|
179
|
+
OptionalMemberExpression(path) {
|
|
180
|
+
const node = path.node;
|
|
181
|
+
if (node.object && isUtilitiesAiAccess(node.object))
|
|
182
|
+
totalAiAccesses++;
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
// If >=3 total accesses, the component is designed for AI environments — skip
|
|
186
|
+
if (totalAiAccesses >= 3)
|
|
187
|
+
return violations;
|
|
188
|
+
traverse(ast, {
|
|
189
|
+
MemberExpression(path) {
|
|
190
|
+
// We want to find utilities.ai.SomeMethod or utilities.ai.someProp
|
|
191
|
+
if (!isUtilitiesAiMethodAccess(path.node))
|
|
192
|
+
return;
|
|
193
|
+
// Skip if using optional chaining
|
|
194
|
+
if (isOptionalAiAccess(path))
|
|
195
|
+
return;
|
|
196
|
+
// Skip if inside a guard
|
|
197
|
+
if (isInsideAiGuard(path))
|
|
198
|
+
return;
|
|
199
|
+
const propertyName = t.isIdentifier(path.node.property)
|
|
200
|
+
? path.node.property.name
|
|
201
|
+
: '(computed)';
|
|
202
|
+
violations.push({
|
|
203
|
+
rule: 'ai-tools-availability-check',
|
|
204
|
+
severity: 'medium',
|
|
205
|
+
line: path.node.loc?.start.line ?? 0,
|
|
206
|
+
column: path.node.loc?.start.column ?? 0,
|
|
207
|
+
message: `Accessing "utilities.ai.${propertyName}" without checking if utilities.ai is available. The ai tools may be undefined if not configured.`,
|
|
208
|
+
code: `utilities.ai.${propertyName}`,
|
|
209
|
+
suggestion: {
|
|
210
|
+
text: `Add a null check before accessing utilities.ai`,
|
|
211
|
+
example: `if (utilities.ai) {\n const result = await utilities.ai.${propertyName}(...);\n}`,
|
|
212
|
+
},
|
|
213
|
+
});
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
return violations;
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
AiToolsAvailabilityCheckRule = __decorate([
|
|
220
|
+
RegisterClass(BaseLintRule, 'ai-tools-availability-check')
|
|
221
|
+
], AiToolsAvailabilityCheckRule);
|
|
222
|
+
export { AiToolsAvailabilityCheckRule };
|
|
223
|
+
//# sourceMappingURL=ai-tools-availability-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-tools-availability-check.js","sourceRoot":"","sources":["../../src/runtime-rules/ai-tools-availability-check.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;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;;;GAMG;AACH,SAAS,eAAe,CAAC,IAAc;IACrC,IAAI,OAAO,GAAoB,IAAI,CAAC,UAAU,CAAC;IAE/C,OAAO,OAAO,EAAE,CAAC;QACf,sBAAsB;QACtB,IAAI,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC;YAC5B,IAAI,qBAAqB,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC7C,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC5C,OAAO,IAAI,CAAC;gBACd,CAAC;YACH,CAAC;QACH,CAAC;QAED,2EAA2E;QAC3E,IAAI,OAAO,CAAC,mBAAmB,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;YACpE,IAAI,qBAAqB,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC7C,OA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EjB,UAAU,CAAC,IAAI,CAAC;oBACd,IAAI,EAAE,6BAA6B;oBACnC,QAAQ,EAAE,QAAQ;oBAClB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC;oBACpC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC;oBACxC,OAAO,EAAE,2BAA2B,YAAY,mGAAmG;oBACnJ,IAAI,EAAE,gBAAgB,YAAY,EAAE;oBACpC,UAAU,EAAE;wBACV,IAAI,EAAE,gDAAgD;wBACtD,OAAO,EAAE,4DAA4D,YAAY,WAAW;qBAC7F;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC,CAAC;QAEH,OAAO,UAAU,CAAC;IACpB,CAAC;CACF,CAAA;AAvDY,4BAA4B;IADxC,aAAa,CAAC,YAAY,EAAE,6BAA6B,CAAC;GAC9C,4BAA4B,CAuDxC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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: callback-event-validation
|
|
7
|
+
*
|
|
8
|
+
* Consolidated rule that replaces four separate rules:
|
|
9
|
+
* - callback-parameter-validation: validates callback method parameter counts and types
|
|
10
|
+
* - callbacks-passthrough-only: ensures callbacks are passed through unchanged to children
|
|
11
|
+
* - callbacks-usage-validation: validates callbacks are only accessed via allowed methods
|
|
12
|
+
* - event-invocation-pattern: ensures event props are null-checked before invocation
|
|
13
|
+
*
|
|
14
|
+
* Severity: critical / high / medium / low (varies by check)
|
|
15
|
+
* Applies to: all components
|
|
16
|
+
*/
|
|
17
|
+
export declare class CallbackEventValidationRule extends BaseLintRule {
|
|
18
|
+
get Name(): string;
|
|
19
|
+
get AppliesTo(): 'all' | 'child' | 'root';
|
|
20
|
+
Test(ast: t.File, _componentName: string, componentSpec?: ComponentSpec): Violation[];
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=callback-event-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callback-event-validation.d.ts","sourceRoot":"","sources":["../../src/runtime-rules/callback-event-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;AAc5E;;;;;;;;;;;GAWG;AACH,qBACa,2BAA4B,SAAQ,YAAY;IAC3D,IAAI,IAAI,WAAwB;IAChC,IAAI,SAAS,IAAI,KAAK,GAAG,OAAO,GAAG,MAAM,CAAkB;IAE3D,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,aAAa,GAAG,SAAS,EAAE;CAgCtF"}
|