@camunda/linting 3.47.0 → 3.48.1
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/lib/utils/error-messages.js +15 -0
- package/lib/utils/properties-panel.js +48 -12
- package/package.json +2 -2
|
@@ -805,6 +805,21 @@ function getPropertyValueNotAllowedErrorMessage(report, executionPlatform, execu
|
|
|
805
805
|
return getSupportedMessage(`${ getIndefiniteArticle(typeString) } <${ typeString }> with <Binding: ${ bindingTypeString }>`, executionPlatform, executionPlatformVersion, allowedVersion);
|
|
806
806
|
}
|
|
807
807
|
|
|
808
|
+
if (
|
|
809
|
+
(isAny(node, [
|
|
810
|
+
'zeebe:Input',
|
|
811
|
+
'zeebe:Output'
|
|
812
|
+
]) && property === 'target') ||
|
|
813
|
+
(isAny(node, [
|
|
814
|
+
'zeebe:Script',
|
|
815
|
+
'zeebe:CalledDecision'
|
|
816
|
+
]) && property === 'resultVariable') ||
|
|
817
|
+
(is(node, 'zeebe:AdHoc') && property === 'outputCollection') ||
|
|
818
|
+
(is(node, 'zeebe:LoopCharacteristics') && [ 'inputElement', 'outputCollection' ].includes(property))
|
|
819
|
+
) {
|
|
820
|
+
return 'Variable name must start with a letter or an underscore, and may contain only letters, digits, underscores, and dots.';
|
|
821
|
+
}
|
|
822
|
+
|
|
808
823
|
return message;
|
|
809
824
|
}
|
|
810
825
|
|
|
@@ -15,6 +15,8 @@ const TIMER_PROPERTIES = [
|
|
|
15
15
|
'timeCycle'
|
|
16
16
|
];
|
|
17
17
|
|
|
18
|
+
const INVALID_VARIABLE_NAME_ERROR = 'Must be a valid variable name.';
|
|
19
|
+
|
|
18
20
|
/**
|
|
19
21
|
* Get errors for a given element.
|
|
20
22
|
*
|
|
@@ -457,10 +459,6 @@ export function getErrorMessage(id, report) {
|
|
|
457
459
|
return 'FEEL expression must be defined.';
|
|
458
460
|
}
|
|
459
461
|
|
|
460
|
-
if (id === 'resultVariable') {
|
|
461
|
-
return 'Result variable must be defined.';
|
|
462
|
-
}
|
|
463
|
-
|
|
464
462
|
if (id === 'errorCode' && type === ERROR_TYPES.PROPERTY_REQUIRED) {
|
|
465
463
|
return 'Code must be defined.';
|
|
466
464
|
}
|
|
@@ -481,10 +479,6 @@ export function getErrorMessage(id, report) {
|
|
|
481
479
|
return 'Input collection must be defined.';
|
|
482
480
|
}
|
|
483
481
|
|
|
484
|
-
if (id === 'multiInstance-outputCollection') {
|
|
485
|
-
return 'Output collection must be defined.';
|
|
486
|
-
}
|
|
487
|
-
|
|
488
482
|
if (id === 'multiInstance-outputElement') {
|
|
489
483
|
return 'Output element must be defined.';
|
|
490
484
|
}
|
|
@@ -652,6 +646,52 @@ export function getErrorMessage(id, report) {
|
|
|
652
646
|
return 'Variable name must be defined.';
|
|
653
647
|
}
|
|
654
648
|
|
|
649
|
+
if (/^.+-(?:input|output)-[0-9]+-target$/.test(id) && type === ERROR_TYPES.PROPERTY_VALUE_NOT_ALLOWED) {
|
|
650
|
+
return INVALID_VARIABLE_NAME_ERROR;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
if (id === 'resultVariable') {
|
|
654
|
+
if (type === ERROR_TYPES.PROPERTY_REQUIRED) {
|
|
655
|
+
return 'Result variable must be defined.';
|
|
656
|
+
} else if (type === ERROR_TYPES.PROPERTY_VALUE_NOT_ALLOWED) {
|
|
657
|
+
return INVALID_VARIABLE_NAME_ERROR;
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
if (id === 'multiInstance-outputCollection') {
|
|
662
|
+
if (type === ERROR_TYPES.PROPERTY_DEPENDENT_REQUIRED || type === ERROR_TYPES.PROPERTY_REQUIRED) {
|
|
663
|
+
return 'Output collection must be defined.';
|
|
664
|
+
} else if (type === ERROR_TYPES.PROPERTY_VALUE_NOT_ALLOWED) {
|
|
665
|
+
return INVALID_VARIABLE_NAME_ERROR;
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
if (id === 'multiInstance-inputElement') {
|
|
670
|
+
if (type === ERROR_TYPES.PROPERTY_REQUIRED) {
|
|
671
|
+
return 'Input element must be defined.';
|
|
672
|
+
} else if (type === ERROR_TYPES.PROPERTY_VALUE_NOT_ALLOWED) {
|
|
673
|
+
return INVALID_VARIABLE_NAME_ERROR;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
if (id === 'adHocOutputCollection') {
|
|
678
|
+
if (type === ERROR_TYPES.PROPERTY_DEPENDENT_REQUIRED || type === ERROR_TYPES.PROPERTY_REQUIRED) {
|
|
679
|
+
return 'Output collection must be defined.';
|
|
680
|
+
} else if (type === ERROR_TYPES.PROPERTY_NOT_ALLOWED) {
|
|
681
|
+
return getNotSupportedMessage('Output collection', allowedVersion);
|
|
682
|
+
} else if (type === ERROR_TYPES.PROPERTY_VALUE_NOT_ALLOWED) {
|
|
683
|
+
return INVALID_VARIABLE_NAME_ERROR;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
if (id === 'adHocOutputElement') {
|
|
688
|
+
if (type === ERROR_TYPES.PROPERTY_DEPENDENT_REQUIRED || type === ERROR_TYPES.PROPERTY_REQUIRED) {
|
|
689
|
+
return 'Output element must be defined.';
|
|
690
|
+
} else if (type === ERROR_TYPES.PROPERTY_NOT_ALLOWED) {
|
|
691
|
+
return getNotSupportedMessage('Output element', allowedVersion);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
|
|
655
695
|
if (id === 'bindingType') {
|
|
656
696
|
return getNotSupportedMessage('', allowedVersion);
|
|
657
697
|
}
|
|
@@ -664,10 +704,6 @@ export function getErrorMessage(id, report) {
|
|
|
664
704
|
}
|
|
665
705
|
}
|
|
666
706
|
|
|
667
|
-
if (isPropertyDependentRequiredError(data, 'outputCollection', 'zeebe:AdHoc')) {
|
|
668
|
-
return 'Output collection must be defined.';
|
|
669
|
-
}
|
|
670
|
-
|
|
671
707
|
if (isPropertyDependentRequiredError(data, 'outputElement', 'zeebe:AdHoc')) {
|
|
672
708
|
return 'Output element must be defined.';
|
|
673
709
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camunda/linting",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.48.1",
|
|
4
4
|
"description": "Linting for Camunda",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@bpmn-io/diagram-js-ui": "^0.2.3",
|
|
33
33
|
"bpmn-moddle": "^10.0.0",
|
|
34
34
|
"bpmnlint": "^11.10.0",
|
|
35
|
-
"bpmnlint-plugin-camunda-compat": "^2.
|
|
35
|
+
"bpmnlint-plugin-camunda-compat": "^2.48.1",
|
|
36
36
|
"bpmnlint-utils": "^1.0.2",
|
|
37
37
|
"camunda-bpmn-moddle": "^7.0.1",
|
|
38
38
|
"clsx": "^2.0.0",
|