@camunda/linting 0.12.0 → 0.14.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/lib/Linter.js CHANGED
@@ -1,4 +1,4 @@
1
- import BpmnModdle from 'bpmn-moddle/dist/index';
1
+ import BpmnModdle from 'bpmn-moddle';
2
2
 
3
3
  import { Linter as BpmnLinter } from 'bpmnlint';
4
4
  import StaticResolver from 'bpmnlint/lib/resolver/static-resolver';
@@ -115,6 +115,10 @@ export function getErrorMessage(report, executionPlatform, executionPlatformVers
115
115
  return getExpressionValueNotAllowedErrorMessage(report);
116
116
  }
117
117
 
118
+ if (type === ERROR_TYPES.EXPRESSION_NOT_ALLOWED) {
119
+ return getExpressionNotAllowedErrorMessage(report);
120
+ }
121
+
118
122
  return message;
119
123
  }
120
124
 
@@ -317,6 +321,10 @@ function getPropertyNotAllowedErrorMessage(report, executionPlatform, executionP
317
321
  return `${ getIndefiniteArticle(typeString) } <${ typeString }> with more than one incoming <Sequence Flow> is not supported by ${ getExecutionPlatformLabel(executionPlatform, executionPlatformVersion) }`;
318
322
  }
319
323
 
324
+ if (is(node, 'zeebe:AssignmentDefinition') && property === 'candidateUsers') {
325
+ return getSupportedMessage(`${ getIndefiniteArticle(typeString) } <${ typeString }> with defined <Candidate users>`, executionPlatform, executionPlatformVersion, allowedVersion);
326
+ }
327
+
320
328
  return message;
321
329
  }
322
330
 
@@ -363,6 +371,10 @@ function getPropertyRequiredErrorMessage(report) {
363
371
  return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Error Reference> must have a defined <Error code>`;
364
372
  }
365
373
 
374
+ if (is(node, 'bpmn:Escalation') && requiredProperty === 'escalationCode') {
375
+ return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Escalation Reference> must have a defined <Escalation code>`;
376
+ }
377
+
366
378
  if (is(node, 'zeebe:LoopCharacteristics') && requiredProperty === 'inputCollection') {
367
379
  return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Multi-instance marker> must have a defined <Input collection>`;
368
380
  }
@@ -463,4 +475,22 @@ function getSupportedMessage(prefix, executionPlatform, executionPlatformVersion
463
475
  }
464
476
 
465
477
  return `${ prefix } is not supported by ${ getExecutionPlatformLabel(executionPlatform, executionPlatformVersion) }`;
466
- }
478
+ }
479
+
480
+ function getExpressionNotAllowedErrorMessage(report) {
481
+ const {
482
+ data
483
+ } = report;
484
+
485
+ const {
486
+ node,
487
+ parentNode,
488
+ property
489
+ } = data;
490
+
491
+ if (is(node, 'bpmn:Escalation') && property === 'escalationCode' && is(parentNode, 'bpmn:CatchEvent')) {
492
+ return 'Escalation code used in a catch event must be a static value';
493
+ } else if (is(node, 'bpmn:Error') && property === 'errorCode' && is(parentNode, 'bpmn:CatchEvent')) {
494
+ return 'Error code used in a catch event must be a static value';
495
+ }
496
+ }
@@ -68,6 +68,10 @@ export function getEntryIds(report) {
68
68
  return [ 'errorRef' ];
69
69
  }
70
70
 
71
+ if (isPropertyError(data, 'escalationRef')) {
72
+ return [ 'escalationRef' ];
73
+ }
74
+
71
75
  if (isPropertyError(data, 'messageRef')) {
72
76
  return [ 'messageRef' ];
73
77
  }
@@ -88,6 +92,10 @@ export function getEntryIds(report) {
88
92
  return [ 'errorCode' ];
89
93
  }
90
94
 
95
+ if (isPropertyError(data, 'escalationCode', 'bpmn:Escalation')) {
96
+ return [ 'escalationCode' ];
97
+ }
98
+
91
99
  if (isPropertyError(data, 'name', 'bpmn:Message')) {
92
100
  return [ 'messageName' ];
93
101
  }
@@ -205,6 +213,10 @@ export function getEntryIds(report) {
205
213
  return [ `multiInstance-${getPropertyName(data)}` ];
206
214
  }
207
215
 
216
+ if (isPropertyError(data, 'candidateUsers', 'zeebe:AssignmentDefinition')) {
217
+ return [ 'assignmentDefinitionCandidateUsers' ];
218
+ }
219
+
208
220
  return [];
209
221
  }
210
222
 
@@ -216,6 +228,10 @@ export function getErrorMessage(id, report) {
216
228
  return;
217
229
  }
218
230
 
231
+ if (data.type === ERROR_TYPES.EXPRESSION_NOT_ALLOWED) {
232
+ return 'Cannot be an expression.';
233
+ }
234
+
219
235
  if (id === 'isExecutable') {
220
236
  const { parentNode } = data;
221
237
 
@@ -234,6 +250,10 @@ export function getErrorMessage(id, report) {
234
250
  return 'Global error reference must be defined.';
235
251
  }
236
252
 
253
+ if (id === 'escalationRef') {
254
+ return 'Global escalation reference must be defined.';
255
+ }
256
+
237
257
  if (id === 'messageRef') {
238
258
  return 'Global message reference must be defined.';
239
259
  }
@@ -250,7 +270,11 @@ export function getErrorMessage(id, report) {
250
270
  return 'Result variable must be defined.';
251
271
  }
252
272
 
253
- if (id === 'errorCode') {
273
+ if (id === 'errorCode' && data.type === ERROR_TYPES.PROPERTY_REQUIRED) {
274
+ return 'Code must be defined.';
275
+ }
276
+
277
+ if (id === 'escalationCode' && data.type === ERROR_TYPES.PROPERTY_REQUIRED) {
254
278
  return 'Code must be defined.';
255
279
  }
256
280
 
@@ -326,6 +350,10 @@ export function getErrorMessage(id, report) {
326
350
  return 'Must be an expression, or an ISO 8601 interval.';
327
351
  }
328
352
  }
353
+
354
+ if (id === 'assignmentDefinitionCandidateUsers') {
355
+ return 'Not supported.';
356
+ }
329
357
  }
330
358
 
331
359
  function isExtensionElementNotAllowedError(data, extensionElement, type) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/linting",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "Linting for Camunda Platform",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -25,35 +25,35 @@
25
25
  },
26
26
  "license": "MIT",
27
27
  "dependencies": {
28
- "bpmn-moddle": "^7.1.3",
28
+ "bpmn-moddle": "^8.0.0",
29
29
  "bpmnlint": "^8.0.0",
30
- "bpmnlint-plugin-camunda-compat": "^0.17.0",
30
+ "bpmnlint-plugin-camunda-compat": "^0.20.0",
31
31
  "bpmnlint-utils": "^1.0.2",
32
32
  "min-dash": "^4.0.0",
33
- "min-dom": "^4.0.1",
33
+ "min-dom": "^4.1.0",
34
34
  "zeebe-bpmn-moddle": "^0.17.0"
35
35
  },
36
36
  "devDependencies": {
37
- "bpmn-js": "^9.4.0",
38
- "bpmn-js-properties-panel": "^1.13.0",
39
- "chai": "^4.3.6",
37
+ "bpmn-js": "^11.1.1",
38
+ "bpmn-js-properties-panel": "^1.15.1",
39
+ "chai": "^4.3.7",
40
40
  "cross-env": "^7.0.3",
41
- "eslint": "^8.23.1",
42
- "eslint-plugin-bpmn-io": "^0.16.0",
43
- "karma": "^6.4.0",
41
+ "eslint": "^8.32.0",
42
+ "eslint-plugin-bpmn-io": "^1.0.0",
43
+ "karma": "^6.4.1",
44
44
  "karma-chrome-launcher": "^3.1.1",
45
45
  "karma-debug-launcher": "0.0.5",
46
46
  "karma-env-preprocessor": "^0.1.1",
47
47
  "karma-mocha": "^2.0.1",
48
48
  "karma-sinon-chai": "^2.0.2",
49
49
  "karma-webpack": "^5.0.0",
50
- "mocha": "^10.0.0",
50
+ "mocha": "^10.2.0",
51
51
  "mocha-test-container-support": "^0.2.0",
52
52
  "modeler-moddle": "^0.2.0",
53
- "puppeteer": "^16.2.0",
54
- "sinon": "^14.0.0",
53
+ "puppeteer": "^19.5.2",
54
+ "sinon": "^15.0.1",
55
55
  "sinon-chai": "^3.7.0",
56
- "webpack": "^5.74.0"
56
+ "webpack": "^5.75.0"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "bpmn-js-properties-panel": ">= 1.10.0"