@nordcraft/search 1.0.85 → 1.0.87
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/rules/issues/actions/actionRules.index.js +4 -0
- package/dist/rules/issues/actions/actionRules.index.js.map +1 -1
- package/dist/rules/issues/actions/createActionNameRule.d.ts +5 -1
- package/dist/rules/issues/actions/createActionNameRule.js +6 -2
- package/dist/rules/issues/actions/createActionNameRule.js.map +1 -1
- package/dist/rules/issues/actions/duplicateActionArgumentNameRule.js +8 -1
- package/dist/rules/issues/actions/duplicateActionArgumentNameRule.js.map +1 -1
- package/dist/rules/issues/actions/legacyActionRule.js +18 -8
- package/dist/rules/issues/actions/legacyActionRule.js.map +1 -1
- package/dist/rules/issues/actions/noReferenceProjectActionRule.js +8 -1
- package/dist/rules/issues/actions/noReferenceProjectActionRule.js.map +1 -1
- package/dist/rules/issues/actions/unknownActionArgumentRule.js +23 -6
- package/dist/rules/issues/actions/unknownActionArgumentRule.js.map +1 -1
- package/dist/rules/issues/actions/unknownActionEventRule.js +11 -3
- package/dist/rules/issues/actions/unknownActionEventRule.js.map +1 -1
- package/dist/rules/issues/actions/unknownProjectActionRule.js +8 -1
- package/dist/rules/issues/actions/unknownProjectActionRule.js.map +1 -1
- package/dist/rules/issues/apis/invalidApiParserModeRule.js +8 -1
- package/dist/rules/issues/apis/invalidApiParserModeRule.js.map +1 -1
- package/dist/rules/issues/apis/invalidApiProxyBodySettingRule.js +8 -1
- package/dist/rules/issues/apis/invalidApiProxyBodySettingRule.js.map +1 -1
- package/dist/rules/issues/apis/invalidApiProxyCookieSettingRule.js +8 -1
- package/dist/rules/issues/apis/invalidApiProxyCookieSettingRule.js.map +1 -1
- package/dist/rules/issues/apis/legacyApiRule.js +8 -1
- package/dist/rules/issues/apis/legacyApiRule.js.map +1 -1
- package/dist/rules/issues/apis/noReferenceApiInputRule.js +8 -1
- package/dist/rules/issues/apis/noReferenceApiInputRule.js.map +1 -1
- package/dist/rules/issues/apis/noReferenceApiRule.js +8 -1
- package/dist/rules/issues/apis/noReferenceApiRule.js.map +1 -1
- package/dist/rules/issues/apis/noReferenceApiServiceRule.js +9 -1
- package/dist/rules/issues/apis/noReferenceApiServiceRule.js.map +1 -1
- package/dist/rules/issues/apis/unknownApiInputRule.js +8 -1
- package/dist/rules/issues/apis/unknownApiInputRule.js.map +1 -1
- package/dist/rules/issues/apis/unknownApiRule.js +16 -2
- package/dist/rules/issues/apis/unknownApiRule.js.map +1 -1
- package/dist/rules/issues/apis/unknownApiServiceRule.js +9 -1
- package/dist/rules/issues/apis/unknownApiServiceRule.js.map +1 -1
- package/dist/rules/issues/apis/unknownFetchInputRule.js +9 -1
- package/dist/rules/issues/apis/unknownFetchInputRule.js.map +1 -1
- package/dist/rules/issues/attributes/noReferenceAttributeInInstanceRule.js +9 -2
- package/dist/rules/issues/attributes/noReferenceAttributeInInstanceRule.js.map +1 -1
- package/dist/rules/issues/attributes/noReferenceAttributeRule.js +8 -1
- package/dist/rules/issues/attributes/noReferenceAttributeRule.js.map +1 -1
- package/dist/rules/issues/attributes/unknownAttributeRule.js +8 -1
- package/dist/rules/issues/attributes/unknownAttributeRule.js.map +1 -1
- package/dist/rules/issues/attributes/unknownComponentAttributeRule.js +9 -3
- package/dist/rules/issues/attributes/unknownComponentAttributeRule.js.map +1 -1
- package/dist/rules/issues/components/invalidComponentStructureRule.js +12 -4
- package/dist/rules/issues/components/invalidComponentStructureRule.js.map +1 -1
- package/dist/rules/issues/components/noReferenceComponentRule.js +8 -1
- package/dist/rules/issues/components/noReferenceComponentRule.js.map +1 -1
- package/dist/rules/issues/components/unknownComponentRule.js +8 -1
- package/dist/rules/issues/components/unknownComponentRule.js.map +1 -1
- package/dist/rules/issues/context/noContextConsumersRule.js +7 -1
- package/dist/rules/issues/context/noContextConsumersRule.js.map +1 -1
- package/dist/rules/issues/context/unknownContextFormulaRule.js +10 -3
- package/dist/rules/issues/context/unknownContextFormulaRule.js.map +1 -1
- package/dist/rules/issues/context/unknownContextProviderFormulaRule.js +10 -3
- package/dist/rules/issues/context/unknownContextProviderFormulaRule.js.map +1 -1
- package/dist/rules/issues/context/unknownContextProviderRule.js +8 -1
- package/dist/rules/issues/context/unknownContextProviderRule.js.map +1 -1
- package/dist/rules/issues/dom/createRequiredDirectChildRule.js +11 -4
- package/dist/rules/issues/dom/createRequiredDirectChildRule.js.map +1 -1
- package/dist/rules/issues/dom/createRequiredDirectParentRule.js +11 -4
- package/dist/rules/issues/dom/createRequiredDirectParentRule.js.map +1 -1
- package/dist/rules/issues/dom/createRequiredElementAttributeRule.js +8 -1
- package/dist/rules/issues/dom/createRequiredElementAttributeRule.js.map +1 -1
- package/dist/rules/issues/dom/createRequiredMetaTagRule.js +10 -1
- package/dist/rules/issues/dom/createRequiredMetaTagRule.js.map +1 -1
- package/dist/rules/issues/dom/elementWithoutInteractiveContentRule.js +16 -3
- package/dist/rules/issues/dom/elementWithoutInteractiveContentRule.js.map +1 -1
- package/dist/rules/issues/dom/imageWithoutDimensionRule.js +7 -1
- package/dist/rules/issues/dom/imageWithoutDimensionRule.js.map +1 -1
- package/dist/rules/issues/dom/nonEmptyVoidElementRule.js +8 -1
- package/dist/rules/issues/dom/nonEmptyVoidElementRule.js.map +1 -1
- package/dist/rules/issues/events/duplicateEventTriggerRule.js +8 -1
- package/dist/rules/issues/events/duplicateEventTriggerRule.js.map +1 -1
- package/dist/rules/issues/events/noReferenceEventRule.js +9 -1
- package/dist/rules/issues/events/noReferenceEventRule.js.map +1 -1
- package/dist/rules/issues/events/unknownEventRule.js +8 -1
- package/dist/rules/issues/events/unknownEventRule.js.map +1 -1
- package/dist/rules/issues/events/unknownTriggerEventRule.js +8 -1
- package/dist/rules/issues/events/unknownTriggerEventRule.js.map +1 -1
- package/dist/rules/issues/formulas/duplicateFormulaArgumentNameRule.js +8 -1
- package/dist/rules/issues/formulas/duplicateFormulaArgumentNameRule.js.map +1 -1
- package/dist/rules/issues/formulas/legacyFormulaRule.js +12 -5
- package/dist/rules/issues/formulas/legacyFormulaRule.js.map +1 -1
- package/dist/rules/issues/formulas/noReferenceComponentFormulaRule.js +14 -4
- package/dist/rules/issues/formulas/noReferenceComponentFormulaRule.js.map +1 -1
- package/dist/rules/issues/formulas/noReferenceProjectFormulaRule.js +8 -1
- package/dist/rules/issues/formulas/noReferenceProjectFormulaRule.js.map +1 -1
- package/dist/rules/issues/formulas/unknownComponentFormulaInputRule.js +8 -1
- package/dist/rules/issues/formulas/unknownComponentFormulaInputRule.js.map +1 -1
- package/dist/rules/issues/formulas/unknownFormulaRule.js +8 -1
- package/dist/rules/issues/formulas/unknownFormulaRule.js.map +1 -1
- package/dist/rules/issues/formulas/unknownProjectFormulaInputRule.js +8 -1
- package/dist/rules/issues/formulas/unknownProjectFormulaInputRule.js.map +1 -1
- package/dist/rules/issues/formulas/unknownProjectFormulaRule.js +8 -1
- package/dist/rules/issues/formulas/unknownProjectFormulaRule.js.map +1 -1
- package/dist/rules/issues/formulas/unknownRepeatIndexFormulaRule.js +14 -2
- package/dist/rules/issues/formulas/unknownRepeatIndexFormulaRule.js.map +1 -1
- package/dist/rules/issues/formulas/unknownRepeatItemFormulaRule.js +14 -2
- package/dist/rules/issues/formulas/unknownRepeatItemFormulaRule.js.map +1 -1
- package/dist/rules/issues/logic/noStaticNodeCondition.js +15 -3
- package/dist/rules/issues/logic/noStaticNodeCondition.js.map +1 -1
- package/dist/rules/issues/logic/noUnnecessaryConditionFalsy.js +7 -1
- package/dist/rules/issues/logic/noUnnecessaryConditionFalsy.js.map +1 -1
- package/dist/rules/issues/logic/noUnnecessaryConditionTruthy.js +7 -1
- package/dist/rules/issues/logic/noUnnecessaryConditionTruthy.js.map +1 -1
- package/dist/rules/issues/miscellaneous/createStaticSizeConstraintRule.d.ts +5 -0
- package/dist/rules/issues/miscellaneous/createStaticSizeConstraintRule.js +74 -0
- package/dist/rules/issues/miscellaneous/createStaticSizeConstraintRule.js.map +1 -0
- package/dist/rules/issues/miscellaneous/miscRules.index.d.ts +3 -0
- package/dist/rules/issues/miscellaneous/miscRules.index.js +10 -1
- package/dist/rules/issues/miscellaneous/miscRules.index.js.map +1 -1
- package/dist/rules/issues/miscellaneous/noReferenceNodeRule.js +9 -1
- package/dist/rules/issues/miscellaneous/noReferenceNodeRule.js.map +1 -1
- package/dist/rules/issues/miscellaneous/requireExtensionRule.js +7 -1
- package/dist/rules/issues/miscellaneous/requireExtensionRule.js.map +1 -1
- package/dist/rules/issues/miscellaneous/unknownCookieRule.js +8 -1
- package/dist/rules/issues/miscellaneous/unknownCookieRule.js.map +1 -1
- package/dist/rules/issues/routing/duplicateRouteRule.js +16 -6
- package/dist/rules/issues/routing/duplicateRouteRule.js.map +1 -1
- package/dist/rules/issues/routing/duplicateUrlParameterRule.js +16 -2
- package/dist/rules/issues/routing/duplicateUrlParameterRule.js.map +1 -1
- package/dist/rules/issues/routing/unknownSetUrlParameterRule.js +8 -1
- package/dist/rules/issues/routing/unknownSetUrlParameterRule.js.map +1 -1
- package/dist/rules/issues/routing/unknownSetUrlParametersRule.js +8 -1
- package/dist/rules/issues/routing/unknownSetUrlParametersRule.js.map +1 -1
- package/dist/rules/issues/routing/unknownUrlParameterRule.js +8 -1
- package/dist/rules/issues/routing/unknownUrlParameterRule.js.map +1 -1
- package/dist/rules/issues/slots/unknownComponentSlotRule.js +9 -2
- package/dist/rules/issues/slots/unknownComponentSlotRule.js.map +1 -1
- package/dist/rules/issues/style/invalidStyleSyntaxRule.js +9 -1
- package/dist/rules/issues/style/invalidStyleSyntaxRule.js.map +1 -1
- package/dist/rules/issues/style/legacyStyleVariableRule.js +9 -3
- package/dist/rules/issues/style/legacyStyleVariableRule.js.map +1 -1
- package/dist/rules/issues/style/legacyThemeRule.js +7 -1
- package/dist/rules/issues/style/legacyThemeRule.js.map +1 -1
- package/dist/rules/issues/style/noReferenceGlobalCSSVariable.js +8 -1
- package/dist/rules/issues/style/noReferenceGlobalCSSVariable.js.map +1 -1
- package/dist/rules/issues/style/unknownCSSVariable.js +43 -45
- package/dist/rules/issues/style/unknownCSSVariable.js.map +1 -1
- package/dist/rules/issues/style/unknownClassnameRule.js +8 -1
- package/dist/rules/issues/style/unknownClassnameRule.js.map +1 -1
- package/dist/rules/issues/variables/noReferenceVariableRule.js +8 -1
- package/dist/rules/issues/variables/noReferenceVariableRule.js.map +1 -1
- package/dist/rules/issues/variables/unknownVariableRule.js +8 -1
- package/dist/rules/issues/variables/unknownVariableRule.js.map +1 -1
- package/dist/rules/issues/variables/unknownVariableSetterRule.js +8 -1
- package/dist/rules/issues/variables/unknownVariableSetterRule.js.map +1 -1
- package/dist/rules/issues/workflows/duplicateWorkflowParameterRule.js +8 -1
- package/dist/rules/issues/workflows/duplicateWorkflowParameterRule.js.map +1 -1
- package/dist/rules/issues/workflows/noPostNavigateAction.js +8 -1
- package/dist/rules/issues/workflows/noPostNavigateAction.js.map +1 -1
- package/dist/rules/issues/workflows/noReferenceComponentWorkflowRule.js +8 -1
- package/dist/rules/issues/workflows/noReferenceComponentWorkflowRule.js.map +1 -1
- package/dist/rules/issues/workflows/unknownContextProviderWorkflowRule.js +10 -3
- package/dist/rules/issues/workflows/unknownContextProviderWorkflowRule.js.map +1 -1
- package/dist/rules/issues/workflows/unknownContextWorkflowRule.js +10 -3
- package/dist/rules/issues/workflows/unknownContextWorkflowRule.js.map +1 -1
- package/dist/rules/issues/workflows/unknownTriggerWorkflowParameterRule.js +9 -2
- package/dist/rules/issues/workflows/unknownTriggerWorkflowParameterRule.js.map +1 -1
- package/dist/rules/issues/workflows/unknownTriggerWorkflowRule.js +7 -1
- package/dist/rules/issues/workflows/unknownTriggerWorkflowRule.js.map +1 -1
- package/dist/rules/issues/workflows/unknownWorkflowParameterRule.js +9 -2
- package/dist/rules/issues/workflows/unknownWorkflowParameterRule.js.map +1 -1
- package/dist/searchProject.js +2 -1
- package/dist/searchProject.js.map +1 -1
- package/dist/types.d.ts +13 -2
- package/package.json +3 -3
- package/src/rules/issues/actions/actionRules.index.ts +5 -0
- package/src/rules/issues/actions/createActionNameRule.ts +10 -1
- package/src/rules/issues/actions/duplicateActionArgumentNameRule.ts +8 -1
- package/src/rules/issues/actions/legacyActionRule.ts +10 -3
- package/src/rules/issues/actions/noReferenceProjectActionRule.ts +8 -1
- package/src/rules/issues/actions/unknownActionArgumentRule.ts +18 -9
- package/src/rules/issues/actions/unknownActionEventRule.ts +8 -4
- package/src/rules/issues/actions/unknownProjectActionRule.ts +8 -1
- package/src/rules/issues/apis/invalidApiParserModeRule.ts +8 -1
- package/src/rules/issues/apis/invalidApiProxyBodySettingRule.ts +8 -1
- package/src/rules/issues/apis/invalidApiProxyCookieSettingRule.ts +8 -1
- package/src/rules/issues/apis/legacyApiRule.ts +8 -1
- package/src/rules/issues/apis/noReferenceApiInputRule.ts +8 -1
- package/src/rules/issues/apis/noReferenceApiRule.ts +8 -1
- package/src/rules/issues/apis/noReferenceApiServiceRule.ts +9 -1
- package/src/rules/issues/apis/unknownApiInputRule.ts +8 -1
- package/src/rules/issues/apis/unknownApiRule.ts +16 -2
- package/src/rules/issues/apis/unknownApiServiceRule.ts +9 -5
- package/src/rules/issues/apis/unknownFetchInputRule.ts +9 -1
- package/src/rules/issues/attributes/noReferenceAttributeInInstanceRule.ts +9 -2
- package/src/rules/issues/attributes/noReferenceAttributeRule.ts +8 -1
- package/src/rules/issues/attributes/unknownAttributeRule.ts +8 -1
- package/src/rules/issues/attributes/unknownComponentAttributeRule.ts +9 -3
- package/src/rules/issues/components/invalidComponentStructureRule.ts +9 -5
- package/src/rules/issues/components/noReferenceComponentRule.ts +9 -1
- package/src/rules/issues/components/unknownComponentRule.ts +8 -1
- package/src/rules/issues/context/noContextConsumersRule.ts +8 -1
- package/src/rules/issues/context/unknownContextFormulaRule.ts +10 -3
- package/src/rules/issues/context/unknownContextProviderFormulaRule.ts +10 -3
- package/src/rules/issues/context/unknownContextProviderRule.ts +8 -1
- package/src/rules/issues/dom/createRequiredDirectChildRule.ts +11 -4
- package/src/rules/issues/dom/createRequiredDirectParentRule.ts +11 -4
- package/src/rules/issues/dom/createRequiredElementAttributeRule.ts +8 -1
- package/src/rules/issues/dom/createRequiredMetaTagRule.ts +14 -1
- package/src/rules/issues/dom/elementWithoutInteractiveContentRule.ts +26 -3
- package/src/rules/issues/dom/imageWithoutDimensionRule.ts +8 -1
- package/src/rules/issues/dom/nonEmptyVoidElementRule.ts +8 -1
- package/src/rules/issues/events/duplicateEventTriggerRule.ts +8 -1
- package/src/rules/issues/events/noReferenceEventRule.ts +9 -1
- package/src/rules/issues/events/unknownEventRule.ts +8 -1
- package/src/rules/issues/events/unknownTriggerEventRule.ts +8 -1
- package/src/rules/issues/formulas/duplicateFormulaArgumentNameRule.ts +8 -1
- package/src/rules/issues/formulas/legacyFormulaRule.ts +12 -7
- package/src/rules/issues/formulas/noReferenceComponentFormulaRule.ts +12 -5
- package/src/rules/issues/formulas/noReferenceProjectFormulaRule.ts +8 -1
- package/src/rules/issues/formulas/unknownComponentFormulaInputRule.ts +8 -1
- package/src/rules/issues/formulas/unknownFormulaRule.ts +8 -1
- package/src/rules/issues/formulas/unknownProjectFormulaInputRule.ts +8 -1
- package/src/rules/issues/formulas/unknownProjectFormulaRule.ts +8 -1
- package/src/rules/issues/formulas/unknownRepeatIndexFormulaRule.ts +14 -2
- package/src/rules/issues/formulas/unknownRepeatItemFormulaRule.ts +14 -2
- package/src/rules/issues/logic/noStaticNodeCondition.ts +15 -4
- package/src/rules/issues/logic/noUnnecessaryConditionFalsy.ts +8 -1
- package/src/rules/issues/logic/noUnnecessaryConditionTruthy.ts +8 -1
- package/src/rules/issues/miscellaneous/createStaticSizeConstraintRule.test.ts +153 -0
- package/src/rules/issues/miscellaneous/createStaticSizeConstraintRule.ts +90 -0
- package/src/rules/issues/miscellaneous/miscRules.index.ts +10 -1
- package/src/rules/issues/miscellaneous/noReferenceNodeRule.ts +9 -1
- package/src/rules/issues/miscellaneous/requireExtensionRule.ts +8 -1
- package/src/rules/issues/miscellaneous/unknownCookieRule.ts +8 -1
- package/src/rules/issues/routing/duplicateRouteRule.ts +18 -6
- package/src/rules/issues/routing/duplicateUrlParameterRule.ts +16 -2
- package/src/rules/issues/routing/unknownSetUrlParameterRule.ts +8 -1
- package/src/rules/issues/routing/unknownSetUrlParametersRule.ts +8 -1
- package/src/rules/issues/routing/unknownUrlParameterRule.ts +8 -1
- package/src/rules/issues/slots/unknownComponentSlotRule.ts +9 -2
- package/src/rules/issues/style/invalidStyleSyntaxRule.ts +9 -1
- package/src/rules/issues/style/legacyStyleVariableRule.ts +9 -3
- package/src/rules/issues/style/legacyThemeRule.ts +7 -1
- package/src/rules/issues/style/noReferenceGlobalCSSVariable.ts +8 -1
- package/src/rules/issues/style/unknownCSSVariable.test.ts +45 -37
- package/src/rules/issues/style/unknownCSSVariable.ts +49 -52
- package/src/rules/issues/style/unknownClassnameRule.ts +8 -1
- package/src/rules/issues/variables/noReferenceVariableRule.ts +8 -1
- package/src/rules/issues/variables/unknownVariableRule.ts +8 -1
- package/src/rules/issues/variables/unknownVariableSetterRule.ts +8 -1
- package/src/rules/issues/workflows/duplicateWorkflowParameterRule.ts +8 -1
- package/src/rules/issues/workflows/noPostNavigateAction.ts +8 -1
- package/src/rules/issues/workflows/noReferenceComponentWorkflowRule.ts +8 -1
- package/src/rules/issues/workflows/unknownContextProviderWorkflowRule.ts +10 -3
- package/src/rules/issues/workflows/unknownContextWorkflowRule.ts +10 -3
- package/src/rules/issues/workflows/unknownTriggerWorkflowParameterRule.ts +9 -2
- package/src/rules/issues/workflows/unknownTriggerWorkflowRule.ts +7 -1
- package/src/rules/issues/workflows/unknownWorkflowParameterRule.ts +9 -2
- package/src/searchProject.ts +2 -1
- package/src/types.ts +22 -10
|
@@ -20,6 +20,13 @@ export const invalidApiProxyBodySettingRule: Rule<{ api: string }> = {
|
|
|
20
20
|
return
|
|
21
21
|
}
|
|
22
22
|
// Report an issue if useTemplatesInBody is set to true while the API is not set to be proxied
|
|
23
|
-
report(
|
|
23
|
+
report({
|
|
24
|
+
path,
|
|
25
|
+
info: {
|
|
26
|
+
title: 'Invalid API setting for cookies in body',
|
|
27
|
+
description: `The API **${value.name}** has enabled the setting for injecting cookies in the proxied API body, but the API does not have proxying enabled.`,
|
|
28
|
+
},
|
|
29
|
+
details: { api: value.name },
|
|
30
|
+
})
|
|
24
31
|
},
|
|
25
32
|
}
|
|
@@ -32,6 +32,13 @@ export const invalidApiProxyCookieSettingRule: Rule<{ api: string }> = {
|
|
|
32
32
|
return
|
|
33
33
|
}
|
|
34
34
|
// Report an issue if the 'Get Http-Only Cookie' formula is used in a non-proxied API
|
|
35
|
-
report(
|
|
35
|
+
report({
|
|
36
|
+
path,
|
|
37
|
+
info: {
|
|
38
|
+
title: 'Proxy specific formula used in non-proxied API',
|
|
39
|
+
description: `The **"Get Http-Only Cookie"** formula is used in the **${api.name}** API, but the API is not proxied. This will often lead to issues with the API when [the template value for the cookie](https://docs.nordcraft.com/connecting-data/authentication#adding-authentication-to-api-requests) is not replaced correctly.`,
|
|
40
|
+
},
|
|
41
|
+
details: { api: api.name },
|
|
42
|
+
})
|
|
36
43
|
},
|
|
37
44
|
}
|
|
@@ -11,6 +11,13 @@ export const legacyApiRule: Rule<{
|
|
|
11
11
|
if (nodeType !== 'component-api' || !isLegacyApi(value)) {
|
|
12
12
|
return
|
|
13
13
|
}
|
|
14
|
-
report(
|
|
14
|
+
report({
|
|
15
|
+
path,
|
|
16
|
+
info: {
|
|
17
|
+
title: 'Legacy API',
|
|
18
|
+
description: `The API **${value.name}** could be upgraded to the new API format.`,
|
|
19
|
+
},
|
|
20
|
+
details: { name: value.name },
|
|
21
|
+
})
|
|
15
22
|
},
|
|
16
23
|
}
|
|
@@ -37,6 +37,13 @@ export const noReferenceApiInputRule: Rule<{ inputName: string }> = {
|
|
|
37
37
|
if (referencedApiInputs.has(inputKey)) {
|
|
38
38
|
return
|
|
39
39
|
}
|
|
40
|
-
report(
|
|
40
|
+
report({
|
|
41
|
+
path,
|
|
42
|
+
info: {
|
|
43
|
+
title: 'Unused API input',
|
|
44
|
+
description: `**${inputKey}** is never used by any formulas in the API. Consider removing it.`,
|
|
45
|
+
},
|
|
46
|
+
details: { inputName: inputKey },
|
|
47
|
+
})
|
|
41
48
|
},
|
|
42
49
|
}
|
|
@@ -67,7 +67,14 @@ export const noReferenceApiRule: Rule<void> = {
|
|
|
67
67
|
if (componentApiReferences.has(value.name)) {
|
|
68
68
|
return
|
|
69
69
|
}
|
|
70
|
-
report(
|
|
70
|
+
report({
|
|
71
|
+
path: args.path,
|
|
72
|
+
info: {
|
|
73
|
+
title: 'Unused API',
|
|
74
|
+
description: `**${value.name}** is never used in any formulas and is not called in any workflows. Consider removing it.`,
|
|
75
|
+
},
|
|
76
|
+
fixes: ['delete-api'],
|
|
77
|
+
})
|
|
71
78
|
},
|
|
72
79
|
fixes: {
|
|
73
80
|
'delete-api': removeFromPathFix,
|
|
@@ -33,7 +33,15 @@ export const noReferenceApiServiceRule: Rule<{ serviceName: string }> = {
|
|
|
33
33
|
if (apiServiceReferences.has(value.name)) {
|
|
34
34
|
return
|
|
35
35
|
}
|
|
36
|
-
report(
|
|
36
|
+
report({
|
|
37
|
+
path: args.path,
|
|
38
|
+
info: {
|
|
39
|
+
title: 'Unused API Service',
|
|
40
|
+
description: `**${serviceName}** is never used by any API. Consider removing it.`,
|
|
41
|
+
},
|
|
42
|
+
details: { serviceName },
|
|
43
|
+
fixes: ['delete-api-service'],
|
|
44
|
+
})
|
|
37
45
|
},
|
|
38
46
|
fixes: {
|
|
39
47
|
'delete-api-service': removeFromPathFix,
|
|
@@ -27,7 +27,14 @@ export const unknownApiInputRule: Rule<{
|
|
|
27
27
|
| undefined
|
|
28
28
|
)?.inputs?.[value.path[1]]
|
|
29
29
|
if (!apiInput) {
|
|
30
|
-
report(
|
|
30
|
+
report({
|
|
31
|
+
path,
|
|
32
|
+
info: {
|
|
33
|
+
title: 'Unknown API input',
|
|
34
|
+
description: `**${value.path[1]}** does not exist as an input on the API. Using an unknown input will always return *Null*. Make sure to define it before using it.`,
|
|
35
|
+
},
|
|
36
|
+
details: { name: value.path[1] },
|
|
37
|
+
})
|
|
31
38
|
}
|
|
32
39
|
},
|
|
33
40
|
}
|
|
@@ -22,11 +22,25 @@ export const unknownApiRule: Rule<{
|
|
|
22
22
|
if (isApiFormula) {
|
|
23
23
|
const [, apiKey] = value.path
|
|
24
24
|
if (!component?.apis?.[apiKey]) {
|
|
25
|
-
report(
|
|
25
|
+
report({
|
|
26
|
+
path,
|
|
27
|
+
info: {
|
|
28
|
+
title: 'Unknown API',
|
|
29
|
+
description: `**${apiKey}** does not exist. Using an unknown API will have no effect. Define the API before calling it.`,
|
|
30
|
+
},
|
|
31
|
+
details: { name: apiKey },
|
|
32
|
+
})
|
|
26
33
|
}
|
|
27
34
|
} else if (isApiAction) {
|
|
28
35
|
if (!component?.apis?.[value.api]) {
|
|
29
|
-
report(
|
|
36
|
+
report({
|
|
37
|
+
path,
|
|
38
|
+
info: {
|
|
39
|
+
title: 'Unknown API',
|
|
40
|
+
description: `**${value.api}** does not exist. Using an unknown API will have no effect. Define the API before calling it.`,
|
|
41
|
+
},
|
|
42
|
+
details: { name: value.api },
|
|
43
|
+
})
|
|
30
44
|
}
|
|
31
45
|
}
|
|
32
46
|
},
|
|
@@ -19,11 +19,15 @@ export const unknownApiServiceRule: Rule<{
|
|
|
19
19
|
) {
|
|
20
20
|
return
|
|
21
21
|
}
|
|
22
|
-
report(
|
|
23
|
-
[...args.path, 'service'],
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
report({
|
|
23
|
+
path: [...args.path, 'service'],
|
|
24
|
+
info: {
|
|
25
|
+
title: 'Unknown Service',
|
|
26
|
+
description: `**${args.value.service}** does not exist. The "${args.value.name}" API will not benefit from any information provided by the service. The service might have been deleted.`,
|
|
27
|
+
},
|
|
28
|
+
details: { apiName: args.value.name, serviceName: args.value.service },
|
|
29
|
+
fixes: ['delete-api-service-reference'],
|
|
30
|
+
})
|
|
27
31
|
},
|
|
28
32
|
fixes: {
|
|
29
33
|
'delete-api-service-reference': removeFromPathFix,
|
|
@@ -33,7 +33,15 @@ export const unknownFetchInputRule: Rule<
|
|
|
33
33
|
const validInputs = new Set(Object.keys(targetApi.inputs ?? {}))
|
|
34
34
|
for (const inputName of Object.keys(value.inputs ?? {})) {
|
|
35
35
|
if (!validInputs.has(inputName)) {
|
|
36
|
-
report(
|
|
36
|
+
report({
|
|
37
|
+
path,
|
|
38
|
+
info: {
|
|
39
|
+
title: 'Unknown API input override',
|
|
40
|
+
description: `**${inputName}** does not exist as an input on the API. Either add the input on the API, or delete the override.`,
|
|
41
|
+
},
|
|
42
|
+
details: { name: inputName },
|
|
43
|
+
fixes: ['delete-fetch-input'],
|
|
44
|
+
})
|
|
37
45
|
}
|
|
38
46
|
}
|
|
39
47
|
},
|
|
@@ -5,7 +5,7 @@ import { componentIsReferenced } from '../components/noReferenceComponentRule'
|
|
|
5
5
|
|
|
6
6
|
export const noReferenceAttributeInInstanceRule: Rule<void> = {
|
|
7
7
|
code: 'no-reference attribute in instance',
|
|
8
|
-
level: '
|
|
8
|
+
level: 'info',
|
|
9
9
|
category: 'No References',
|
|
10
10
|
visit: (report, args, state) => {
|
|
11
11
|
if (
|
|
@@ -46,7 +46,14 @@ export const noReferenceAttributeInInstanceRule: Rule<void> = {
|
|
|
46
46
|
if (attrs.has([component.name, attributeKey].join('/'))) {
|
|
47
47
|
return
|
|
48
48
|
}
|
|
49
|
-
report(
|
|
49
|
+
report({
|
|
50
|
+
path: args.path,
|
|
51
|
+
info: {
|
|
52
|
+
title: 'Attribute is never set on any instance',
|
|
53
|
+
description: `The attribute **${attributeKey}** is never set on any component instance. Consider removing the attribute as any usage will always be *null*.`,
|
|
54
|
+
},
|
|
55
|
+
fixes: ['delete-attribute'],
|
|
56
|
+
})
|
|
50
57
|
},
|
|
51
58
|
fixes: {
|
|
52
59
|
'delete-attribute': removeFromPathFix,
|
|
@@ -32,7 +32,14 @@ export const noReferenceAttributeRule: Rule<void> = {
|
|
|
32
32
|
if (attrs.has(attributeKey)) {
|
|
33
33
|
return
|
|
34
34
|
}
|
|
35
|
-
report(
|
|
35
|
+
report({
|
|
36
|
+
path: args.path,
|
|
37
|
+
info: {
|
|
38
|
+
title: 'Unused attribute',
|
|
39
|
+
description: `**${attributeKey}** is never used in any formula. Consider removing it.`,
|
|
40
|
+
},
|
|
41
|
+
fixes: ['delete-attribute'],
|
|
42
|
+
})
|
|
36
43
|
},
|
|
37
44
|
fixes: {
|
|
38
45
|
'delete-attribute': removeFromPathFix,
|
|
@@ -19,7 +19,14 @@ export const unknownAttributeRule: Rule<{
|
|
|
19
19
|
const [, attributeKey] = value.path
|
|
20
20
|
const component = files.components[componentName]
|
|
21
21
|
if (!component?.attributes?.[attributeKey]) {
|
|
22
|
-
report(
|
|
22
|
+
report({
|
|
23
|
+
path,
|
|
24
|
+
info: {
|
|
25
|
+
title: 'Unknown attribute',
|
|
26
|
+
description: `**${attributeKey}** does not exist. Using an unknown attribute will always return *Null*.`,
|
|
27
|
+
},
|
|
28
|
+
details: { name: attributeKey },
|
|
29
|
+
})
|
|
23
30
|
}
|
|
24
31
|
},
|
|
25
32
|
}
|
|
@@ -24,9 +24,15 @@ export const unknownComponentAttributeRule: Rule<{
|
|
|
24
24
|
return
|
|
25
25
|
}
|
|
26
26
|
if (!isDefined(component.attributes?.[value.key])) {
|
|
27
|
-
report(
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
report({
|
|
28
|
+
path,
|
|
29
|
+
info: {
|
|
30
|
+
title: 'Unknown component attribute',
|
|
31
|
+
description: `**${value.key}** is not a valid attribute for the "${node.name}" component.`,
|
|
32
|
+
},
|
|
33
|
+
details: { name: value.key, componentName: node.name },
|
|
34
|
+
fixes: ['delete-component-attribute'],
|
|
35
|
+
})
|
|
30
36
|
}
|
|
31
37
|
},
|
|
32
38
|
fixes: {
|
|
@@ -145,14 +145,18 @@ export const invalidComponentStructureRule: Rule<
|
|
|
145
145
|
case 'custom':
|
|
146
146
|
break
|
|
147
147
|
}
|
|
148
|
-
report(
|
|
149
|
-
[...data.path, ...issuePath],
|
|
150
|
-
{
|
|
148
|
+
report({
|
|
149
|
+
path: [...data.path, ...issuePath],
|
|
150
|
+
info: {
|
|
151
|
+
title: 'Invalid component structure',
|
|
152
|
+
description: issue.message,
|
|
153
|
+
},
|
|
154
|
+
details: {
|
|
151
155
|
message: issue.message,
|
|
152
156
|
issue,
|
|
153
157
|
},
|
|
154
|
-
fixes.size > 0 ? Array.from(fixes) : undefined,
|
|
155
|
-
)
|
|
158
|
+
fixes: fixes.size > 0 ? Array.from(fixes) : undefined,
|
|
159
|
+
})
|
|
156
160
|
})
|
|
157
161
|
},
|
|
158
162
|
fixes: {
|
|
@@ -24,7 +24,15 @@ export const noReferenceComponentRule: Rule<void> = {
|
|
|
24
24
|
return
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
report(
|
|
27
|
+
report({
|
|
28
|
+
path: data.path,
|
|
29
|
+
info: {
|
|
30
|
+
title: 'Unused component',
|
|
31
|
+
description:
|
|
32
|
+
'**Component** is never used by any page or component. Consider removing it.',
|
|
33
|
+
},
|
|
34
|
+
fixes: ['delete-component'],
|
|
35
|
+
})
|
|
28
36
|
},
|
|
29
37
|
fixes: {
|
|
30
38
|
'delete-component': removeFromPathFix,
|
|
@@ -19,6 +19,13 @@ export const unknownComponentRule: Rule<{
|
|
|
19
19
|
) {
|
|
20
20
|
return
|
|
21
21
|
}
|
|
22
|
-
report(
|
|
22
|
+
report({
|
|
23
|
+
path,
|
|
24
|
+
info: {
|
|
25
|
+
title: 'Unknown component',
|
|
26
|
+
description: `**${value.name}** does not exist in this project.`,
|
|
27
|
+
},
|
|
28
|
+
details: { name: value.name },
|
|
29
|
+
})
|
|
23
30
|
},
|
|
24
31
|
}
|
|
@@ -36,6 +36,13 @@ export const noContextConsumersRule: Rule<{
|
|
|
36
36
|
if (hasComponents) {
|
|
37
37
|
return
|
|
38
38
|
}
|
|
39
|
-
report(
|
|
39
|
+
report({
|
|
40
|
+
path,
|
|
41
|
+
info: {
|
|
42
|
+
title: 'No context consumers',
|
|
43
|
+
description:
|
|
44
|
+
'Component has no child components or slots, but exposes formulas or workflows in context. Exposed formulas and workflows can only be consumed by child components or slots. Consider unchecking the "Expose in context" option or adding a child component or slot.',
|
|
45
|
+
},
|
|
46
|
+
})
|
|
40
47
|
},
|
|
41
48
|
}
|
|
@@ -22,9 +22,16 @@ export const unknownContextFormulaRule: Rule<{
|
|
|
22
22
|
return
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
report(
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
report({
|
|
26
|
+
path,
|
|
27
|
+
info: {
|
|
28
|
+
title: 'Unknown context formula',
|
|
29
|
+
description: `**${value.path[2]}** is not subscribed. Make sure to subscribe to it in the component context section before using it.`,
|
|
30
|
+
},
|
|
31
|
+
details: {
|
|
32
|
+
providerName: value.path[1],
|
|
33
|
+
formulaName: value.path[2],
|
|
34
|
+
},
|
|
28
35
|
})
|
|
29
36
|
},
|
|
30
37
|
}
|
|
@@ -25,9 +25,16 @@ export const unknownContextProviderFormulaRule: Rule<{
|
|
|
25
25
|
}
|
|
26
26
|
for (const formulaName of value.formulas) {
|
|
27
27
|
if (component.formulas?.[formulaName]?.exposeInContext !== true) {
|
|
28
|
-
report(
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
report({
|
|
29
|
+
path,
|
|
30
|
+
info: {
|
|
31
|
+
title: 'Unknown context provider formula',
|
|
32
|
+
description: `**${formulaName}** does not exist on the context provider **${value.componentName}**. Using an unknown formula will always return *Null*. Make sure to define it before using it.`,
|
|
33
|
+
},
|
|
34
|
+
details: {
|
|
35
|
+
providerName: value.componentName,
|
|
36
|
+
formulaName,
|
|
37
|
+
},
|
|
31
38
|
})
|
|
32
39
|
}
|
|
33
40
|
}
|
|
@@ -25,6 +25,13 @@ export const unknownContextProviderRule: Rule<{ componentName: string }> = {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
report(
|
|
28
|
+
report({
|
|
29
|
+
path,
|
|
30
|
+
info: {
|
|
31
|
+
title: 'Unknown context provider',
|
|
32
|
+
description: `**${value.componentName}** component or page does not exist and cannot be subscribed. Make sure to define it before using it.`,
|
|
33
|
+
},
|
|
34
|
+
details: { componentName: value.componentName },
|
|
35
|
+
})
|
|
29
36
|
},
|
|
30
37
|
}
|
|
@@ -30,10 +30,17 @@ export function createRequiredDirectChildRule(
|
|
|
30
30
|
childNode?.type === 'element' &&
|
|
31
31
|
!childTags.includes(childNode.tag)
|
|
32
32
|
) {
|
|
33
|
-
report(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
report({
|
|
34
|
+
path: [...path.slice(0, 3), childId],
|
|
35
|
+
info: {
|
|
36
|
+
title: 'Invalid child element',
|
|
37
|
+
description: `**${childNode.tag}** should not be a direct first decedent of **${value.tag}**. Valid children are: *${childTags.join('*, *')}*.`,
|
|
38
|
+
},
|
|
39
|
+
details: {
|
|
40
|
+
parentTag: value.tag,
|
|
41
|
+
childTag: childNode.tag,
|
|
42
|
+
allowedChildTags: childTags,
|
|
43
|
+
},
|
|
37
44
|
})
|
|
38
45
|
}
|
|
39
46
|
})
|
|
@@ -26,10 +26,17 @@ export function createRequiredDirectParentRule(
|
|
|
26
26
|
(node) => node.type === 'element' && node.children.includes(nodeId),
|
|
27
27
|
)
|
|
28
28
|
if (parent?.type === 'element' && !parentTags.includes(parent.tag)) {
|
|
29
|
-
report(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
report({
|
|
30
|
+
path,
|
|
31
|
+
info: {
|
|
32
|
+
title: 'Invalid parent element',
|
|
33
|
+
description: `**${value.tag}** should not have a direct parent of type **${parent.tag}**. Valid parents are: *${parentTags.join('*, *')}*.`,
|
|
34
|
+
},
|
|
35
|
+
details: {
|
|
36
|
+
parentTag: parent.tag,
|
|
37
|
+
childTag: value.tag,
|
|
38
|
+
allowedParentTags: parentTags,
|
|
39
|
+
},
|
|
33
40
|
})
|
|
34
41
|
}
|
|
35
42
|
},
|
|
@@ -56,7 +56,14 @@ export function createRequiredElementAttributeRule({
|
|
|
56
56
|
return
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
report(
|
|
59
|
+
report({
|
|
60
|
+
path,
|
|
61
|
+
info: {
|
|
62
|
+
title: 'Missing required attribute',
|
|
63
|
+
description: `**${mainAttribute}** is a required attribute on **${tag}** elements.\n[Learn more](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes)`,
|
|
64
|
+
},
|
|
65
|
+
details: { tag, attribute: mainAttribute },
|
|
66
|
+
})
|
|
60
67
|
}
|
|
61
68
|
},
|
|
62
69
|
}
|
|
@@ -26,7 +26,20 @@ export function createRequiredMetaTagRule(
|
|
|
26
26
|
!formula ||
|
|
27
27
|
(formula.type === 'value' && !formula.value)
|
|
28
28
|
) {
|
|
29
|
-
report(
|
|
29
|
+
report({
|
|
30
|
+
path,
|
|
31
|
+
info: {
|
|
32
|
+
title: 'Missing meta tag',
|
|
33
|
+
description: `**${tag}** is a required tag on page **${
|
|
34
|
+
path[1]
|
|
35
|
+
}**. Missing tags may impact SEO performance. \n[Learn more](${
|
|
36
|
+
tag === 'title'
|
|
37
|
+
? 'https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/title'
|
|
38
|
+
: 'https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta'
|
|
39
|
+
})`,
|
|
40
|
+
},
|
|
41
|
+
details: { tag: tag },
|
|
42
|
+
})
|
|
30
43
|
}
|
|
31
44
|
},
|
|
32
45
|
}
|
|
@@ -70,9 +70,32 @@ export const elementWithoutInteractiveContentRule: Rule<{
|
|
|
70
70
|
const childTags = searchChildren(component, value.children)
|
|
71
71
|
if (childTags.length > 0) {
|
|
72
72
|
childTags.forEach((ic) =>
|
|
73
|
-
report(
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
report({
|
|
74
|
+
path,
|
|
75
|
+
info: {
|
|
76
|
+
title: `${value.tag} includes interactive content element(s)`,
|
|
77
|
+
description: `\`${
|
|
78
|
+
value.tag
|
|
79
|
+
}\` elements are not allowed to include [interactive content](https://developer.mozilla.org/en-US/docs/Web/HTML/Guides/Content_categories#interactive_content) elements.
|
|
80
|
+
This ${value.tag} element could potentially include a \`${ic.tag}\` element${
|
|
81
|
+
'whenAttributeIsPresent' in ic
|
|
82
|
+
? ` with the \`${ic.whenAttributeIsPresent}\` attribute present`
|
|
83
|
+
: ''
|
|
84
|
+
}${
|
|
85
|
+
'whenAttributeIsNot' in ic
|
|
86
|
+
? ` where the \`${ic.whenAttributeIsNot.attribute}\` attribute is not \`${ic.whenAttributeIsNot.value}\``
|
|
87
|
+
: ''
|
|
88
|
+
}.
|
|
89
|
+
Learn more about permitted content for the \`${
|
|
90
|
+
value.tag
|
|
91
|
+
}\` element on [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/${
|
|
92
|
+
value.tag
|
|
93
|
+
}#technical_summary)`,
|
|
94
|
+
},
|
|
95
|
+
details: {
|
|
96
|
+
parentTag: value.tag,
|
|
97
|
+
invalidChild: ic,
|
|
98
|
+
},
|
|
76
99
|
}),
|
|
77
100
|
)
|
|
78
101
|
}
|
|
@@ -54,7 +54,14 @@ export const imageWithoutDimensionRule: Rule = {
|
|
|
54
54
|
return
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
report(
|
|
57
|
+
report({
|
|
58
|
+
path,
|
|
59
|
+
info: {
|
|
60
|
+
title: 'Image dimension missing',
|
|
61
|
+
description:
|
|
62
|
+
'**Image elements** should have explicit width and height to prevent layout shifts.\n[Learn more](https://web.dev/articles/serve-images-with-correct-dimensions#avoid_layout_shifts_by_specifying_dimensions)',
|
|
63
|
+
},
|
|
64
|
+
})
|
|
58
65
|
},
|
|
59
66
|
}
|
|
60
67
|
|
|
@@ -17,6 +17,13 @@ export const nonEmptyVoidElementRule: Rule<{ tag: string }> = {
|
|
|
17
17
|
) {
|
|
18
18
|
return
|
|
19
19
|
}
|
|
20
|
-
report(
|
|
20
|
+
report({
|
|
21
|
+
path,
|
|
22
|
+
info: {
|
|
23
|
+
title: 'Non-empty void element',
|
|
24
|
+
description: `The **${value.tag}** element has child element(s), but ${value.tag} elements do not [support child elements](https://developer.mozilla.org/en-US/docs/Glossary/Void_element).`,
|
|
25
|
+
},
|
|
26
|
+
details: { tag: value.tag },
|
|
27
|
+
})
|
|
21
28
|
},
|
|
22
29
|
}
|
|
@@ -16,7 +16,14 @@ export const duplicateEventTriggerRule: Rule<{ trigger: string }> = {
|
|
|
16
16
|
return
|
|
17
17
|
}
|
|
18
18
|
if (eventTriggers.has(event.trigger)) {
|
|
19
|
-
report(
|
|
19
|
+
report({
|
|
20
|
+
path: [...path, 'events', key],
|
|
21
|
+
info: {
|
|
22
|
+
title: 'Duplicate event trigger',
|
|
23
|
+
description: `**${event.trigger}** is used as a trigger in multiple events. Consider consolidating them into a single event.`,
|
|
24
|
+
},
|
|
25
|
+
details: { trigger: event.trigger },
|
|
26
|
+
})
|
|
20
27
|
}
|
|
21
28
|
eventTriggers.add(event.trigger)
|
|
22
29
|
})
|
|
@@ -41,7 +41,15 @@ export const noReferenceEventRule: Rule<{ name: string }> = {
|
|
|
41
41
|
if (events.has(event.name)) {
|
|
42
42
|
return
|
|
43
43
|
}
|
|
44
|
-
report(
|
|
44
|
+
report({
|
|
45
|
+
path: args.path,
|
|
46
|
+
info: {
|
|
47
|
+
title: 'Unused event',
|
|
48
|
+
description: `**${event.name}** is never triggered. Consider removing it and clean up any usages.`,
|
|
49
|
+
},
|
|
50
|
+
details: { name: event.name },
|
|
51
|
+
fixes: ['delete-event'],
|
|
52
|
+
})
|
|
45
53
|
},
|
|
46
54
|
fixes: {
|
|
47
55
|
'delete-event': removeFromPathFix,
|
|
@@ -25,7 +25,14 @@ export const unknownEventRule: Rule<{
|
|
|
25
25
|
)
|
|
26
26
|
Object.entries(value.events).forEach(([eventKey, event]) => {
|
|
27
27
|
if (isDefined(event) && !componentEvents.has(event.trigger)) {
|
|
28
|
-
report(
|
|
28
|
+
report({
|
|
29
|
+
path: [...path, 'events', eventKey],
|
|
30
|
+
info: {
|
|
31
|
+
title: 'Unknown event',
|
|
32
|
+
description: `**${event.trigger}** does not exist. Calling an unknown event will have no effect.`,
|
|
33
|
+
},
|
|
34
|
+
details: { name: event.trigger },
|
|
35
|
+
})
|
|
29
36
|
}
|
|
30
37
|
})
|
|
31
38
|
},
|
|
@@ -14,7 +14,14 @@ export const unknownTriggerEventRule: Rule<{
|
|
|
14
14
|
const [, componentName] = path
|
|
15
15
|
const component = files.components[componentName]
|
|
16
16
|
if (!component?.events?.some((e) => e.name === value.event)) {
|
|
17
|
-
report(
|
|
17
|
+
report({
|
|
18
|
+
path,
|
|
19
|
+
info: {
|
|
20
|
+
title: 'Unknown event trigger',
|
|
21
|
+
description: `Event **${value.event}** does not exist. Make sure to define it before triggering it.`,
|
|
22
|
+
},
|
|
23
|
+
details: { name: value.event },
|
|
24
|
+
})
|
|
18
25
|
}
|
|
19
26
|
},
|
|
20
27
|
}
|
|
@@ -13,7 +13,14 @@ export const duplicateFormulaArgumentNameRule: Rule<{
|
|
|
13
13
|
const argumentNames = new Set<string>()
|
|
14
14
|
value.arguments?.forEach((arg) => {
|
|
15
15
|
if (argumentNames.has(arg.name)) {
|
|
16
|
-
report(
|
|
16
|
+
report({
|
|
17
|
+
path,
|
|
18
|
+
info: {
|
|
19
|
+
title: 'Duplicate formula argument name',
|
|
20
|
+
description: `Multiple arguments with the name **${arg.name}** exist. Ensure argument names are unique.`,
|
|
21
|
+
},
|
|
22
|
+
details: { name: arg.name },
|
|
23
|
+
})
|
|
17
24
|
}
|
|
18
25
|
argumentNames.add(arg.name)
|
|
19
26
|
})
|