@nordcraft/search 1.0.84 → 1.0.86
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/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 +8 -1
- 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 +12 -1
- 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/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 +8 -1
- 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 +12 -1
|
@@ -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
|
})
|
|
@@ -23,14 +23,19 @@ export const legacyFormulaRule: Rule<
|
|
|
23
23
|
) {
|
|
24
24
|
return
|
|
25
25
|
}
|
|
26
|
-
report(
|
|
27
|
-
data.path,
|
|
28
|
-
|
|
26
|
+
report({
|
|
27
|
+
path: data.path,
|
|
28
|
+
info: {
|
|
29
|
+
title: 'Legacy formula',
|
|
30
|
+
description: `**${data.value.name}** is deprecated. Replace it with the corresponding core formula.`,
|
|
31
|
+
},
|
|
32
|
+
details: { name: data.value.name },
|
|
29
33
|
// The TYPE and BOOLEAN formulas cannot be autofixed since the logic has changed between the 2 implementations
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
fixes:
|
|
35
|
+
data.value.name !== 'TYPE' && data.value.name !== 'BOOLEAN'
|
|
36
|
+
? ['replace-legacy-formula']
|
|
37
|
+
: undefined,
|
|
38
|
+
})
|
|
34
39
|
},
|
|
35
40
|
fixes: {
|
|
36
41
|
'replace-legacy-formula': replaceLegacyFormula,
|
|
@@ -75,14 +75,21 @@ export const noReferenceComponentFormulaRule: Rule<{
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
report(
|
|
79
|
-
args.path,
|
|
80
|
-
{
|
|
78
|
+
report({
|
|
79
|
+
path: args.path,
|
|
80
|
+
info: {
|
|
81
|
+
title: 'Unused component formula',
|
|
82
|
+
description:
|
|
83
|
+
contextSubscribers.length > 0
|
|
84
|
+
? `**${value.name}** is never used but is subscribed to by: *${contextSubscribers.join('*, *')}*. Consider removing it and clean up the unused context subscriptions.`
|
|
85
|
+
: `**${value.name}** is never used. Consider removing it.`,
|
|
86
|
+
},
|
|
87
|
+
details: {
|
|
81
88
|
contextSubscribers,
|
|
82
89
|
name: value.name,
|
|
83
90
|
},
|
|
84
|
-
['delete-component-formula'],
|
|
85
|
-
)
|
|
91
|
+
fixes: ['delete-component-formula'],
|
|
92
|
+
})
|
|
86
93
|
},
|
|
87
94
|
fixes: {
|
|
88
95
|
'delete-component-formula': removeFromPathFix,
|
|
@@ -85,7 +85,14 @@ export const noReferenceProjectFormulaRule: Rule<void> = {
|
|
|
85
85
|
return
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
report(
|
|
88
|
+
report({
|
|
89
|
+
path,
|
|
90
|
+
info: {
|
|
91
|
+
title: 'Unused global formula',
|
|
92
|
+
description: `Global formula is never used by any formula. Consider removing it.`,
|
|
93
|
+
},
|
|
94
|
+
fixes: ['delete-project-formula'],
|
|
95
|
+
})
|
|
89
96
|
},
|
|
90
97
|
fixes: {
|
|
91
98
|
'delete-project-formula': removeFromPathFix,
|
|
@@ -32,7 +32,14 @@ export const unknownComponentFormulaInputRule: Rule<{
|
|
|
32
32
|
const args = formula.arguments ?? []
|
|
33
33
|
const argName = value.path[1]
|
|
34
34
|
if (!isDefined(argName) || !args.some((arg) => arg.name === argName)) {
|
|
35
|
-
report(
|
|
35
|
+
report({
|
|
36
|
+
path,
|
|
37
|
+
info: {
|
|
38
|
+
title: 'Unknown component formula input',
|
|
39
|
+
description: `The formula input ${argName ?? ''} doesn't exist as an input for this formula.`,
|
|
40
|
+
},
|
|
41
|
+
details: { name: argName },
|
|
42
|
+
})
|
|
36
43
|
}
|
|
37
44
|
},
|
|
38
45
|
}
|
|
@@ -15,7 +15,14 @@ export const unknownFormulaRule: Rule<{
|
|
|
15
15
|
const [, componentName] = path
|
|
16
16
|
const component = files.components[componentName]
|
|
17
17
|
if (!component?.formulas?.[value.name]) {
|
|
18
|
-
report(
|
|
18
|
+
report({
|
|
19
|
+
path,
|
|
20
|
+
info: {
|
|
21
|
+
title: 'Unknown formula',
|
|
22
|
+
description: `**${value.name}** does not exist. Using an unknown formula will always return *Null*`,
|
|
23
|
+
},
|
|
24
|
+
details: { name: value.name },
|
|
25
|
+
})
|
|
19
26
|
}
|
|
20
27
|
},
|
|
21
28
|
}
|
|
@@ -26,7 +26,14 @@ export const unknownProjectFormulaInputRule: Rule<{
|
|
|
26
26
|
const args = formula.arguments ?? []
|
|
27
27
|
const argName = value.path[1]
|
|
28
28
|
if (!isDefined(argName) || !args.some((arg) => arg.name === argName)) {
|
|
29
|
-
report(
|
|
29
|
+
report({
|
|
30
|
+
path,
|
|
31
|
+
info: {
|
|
32
|
+
title: 'Unknown project formula input',
|
|
33
|
+
description: `The formula input ${argName ?? ''} doesn't exist as an input for this formula.`,
|
|
34
|
+
},
|
|
35
|
+
details: { name: argName },
|
|
36
|
+
})
|
|
30
37
|
}
|
|
31
38
|
},
|
|
32
39
|
}
|
|
@@ -18,6 +18,13 @@ export const unknownProjectFormulaRule: Rule<{ name: string }> = {
|
|
|
18
18
|
if (formula) {
|
|
19
19
|
return
|
|
20
20
|
}
|
|
21
|
-
report(
|
|
21
|
+
report({
|
|
22
|
+
path,
|
|
23
|
+
info: {
|
|
24
|
+
title: 'Unknown global formula',
|
|
25
|
+
description: `**${value.name}** does not exist. Using an unknown formula will always return *Null*`,
|
|
26
|
+
},
|
|
27
|
+
details: { name: value.name },
|
|
28
|
+
})
|
|
22
29
|
},
|
|
23
30
|
}
|
|
@@ -16,7 +16,13 @@ export const unknownRepeatIndexFormulaRule: Rule = {
|
|
|
16
16
|
}
|
|
17
17
|
if (path[0] !== 'components' || path[2] !== 'nodes') {
|
|
18
18
|
// Any use outside of a component node is invalid
|
|
19
|
-
return report(
|
|
19
|
+
return report({
|
|
20
|
+
path,
|
|
21
|
+
info: {
|
|
22
|
+
title: 'Unknown repeat index reference',
|
|
23
|
+
description: `The formula references a repeat index, but no repeat formula exist in any of its parent elements.`,
|
|
24
|
+
},
|
|
25
|
+
})
|
|
20
26
|
}
|
|
21
27
|
const [_components, componentName, _nodes, nodeId] = path as string[]
|
|
22
28
|
const component = files.components[componentName]
|
|
@@ -44,7 +50,13 @@ export const unknownRepeatIndexFormulaRule: Rule = {
|
|
|
44
50
|
}
|
|
45
51
|
const parentWithRepeat = findParentWithRepeat([nodeId, node])
|
|
46
52
|
if (!parentWithRepeat) {
|
|
47
|
-
report(
|
|
53
|
+
report({
|
|
54
|
+
path,
|
|
55
|
+
info: {
|
|
56
|
+
title: 'Unknown repeat index reference',
|
|
57
|
+
description: `The formula references a repeat index, but no repeat formula exist in any of its parent elements.`,
|
|
58
|
+
},
|
|
59
|
+
})
|
|
48
60
|
}
|
|
49
61
|
},
|
|
50
62
|
}
|
|
@@ -17,7 +17,13 @@ export const unknownRepeatItemFormulaRule: Rule = {
|
|
|
17
17
|
if (path[0] !== 'components' || path[2] !== 'nodes') {
|
|
18
18
|
// Any use outside of a component node is invalid
|
|
19
19
|
// For instance in global formulas or in workflows
|
|
20
|
-
return report(
|
|
20
|
+
return report({
|
|
21
|
+
path,
|
|
22
|
+
info: {
|
|
23
|
+
title: 'Unknown repeat item reference',
|
|
24
|
+
description: `The formula references a repeat item, but no repeat formula exist in any of its parent elements.`,
|
|
25
|
+
},
|
|
26
|
+
})
|
|
21
27
|
}
|
|
22
28
|
const [_components, componentName, _nodes, nodeId] = path as string[]
|
|
23
29
|
const component = files.components[componentName]
|
|
@@ -45,7 +51,13 @@ export const unknownRepeatItemFormulaRule: Rule = {
|
|
|
45
51
|
}
|
|
46
52
|
const parentWithRepeat = findParentWithRepeat([nodeId, node])
|
|
47
53
|
if (!parentWithRepeat) {
|
|
48
|
-
report(
|
|
54
|
+
report({
|
|
55
|
+
path,
|
|
56
|
+
info: {
|
|
57
|
+
title: 'Unknown repeat item reference',
|
|
58
|
+
description: `The formula references a repeat item, but no repeat formula exist in any of its parent elements.`,
|
|
59
|
+
},
|
|
60
|
+
})
|
|
49
61
|
}
|
|
50
62
|
},
|
|
51
63
|
}
|