@camunda/linting 0.15.0 → 0.16.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.
@@ -96,7 +96,7 @@ export function getErrorMessage(report, executionPlatform, executionPlatformVers
96
96
  }
97
97
 
98
98
  if (type === ERROR_TYPES.PROPERTY_REQUIRED) {
99
- return getPropertyRequiredErrorMessage(report);
99
+ return getPropertyRequiredErrorMessage(report, executionPlatform, executionPlatformVersion);
100
100
  }
101
101
 
102
102
  if (type === ERROR_TYPES.PROPERTY_VALUE_DUPLICATED) {
@@ -329,13 +329,14 @@ function getPropertyNotAllowedErrorMessage(report, executionPlatform, executionP
329
329
  }
330
330
 
331
331
 
332
- function getPropertyRequiredErrorMessage(report) {
332
+ function getPropertyRequiredErrorMessage(report, executionPlatform, executionPlatformVersion) {
333
333
  const {
334
334
  data,
335
335
  message
336
336
  } = report;
337
337
 
338
338
  const {
339
+ allowedVersion,
339
340
  node,
340
341
  parentNode,
341
342
  requiredProperty
@@ -368,7 +369,13 @@ function getPropertyRequiredErrorMessage(report) {
368
369
  }
369
370
 
370
371
  if (is(node, 'bpmn:Error') && requiredProperty === 'errorCode') {
371
- return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Error Reference> must have a defined <Error code>`;
372
+
373
+ if (parentNode && is(parentNode, 'bpmn:CatchEvent')) {
374
+ return getSupportedMessage(`${ getIndefiniteArticle(typeString) } <${ typeString }> without defined <Error code>`, executionPlatform, executionPlatformVersion, allowedVersion);
375
+ } else if (parentNode && is(parentNode, 'bpmn:ThrowEvent')) {
376
+ return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Error Reference> must have a defined <Error code>`;
377
+ }
378
+
372
379
  }
373
380
 
374
381
  if (is(node, 'bpmn:Escalation') && requiredProperty === 'escalationCode') {
@@ -392,7 +399,13 @@ function getPropertyRequiredErrorMessage(report) {
392
399
  }
393
400
 
394
401
  if (requiredProperty === 'errorRef') {
395
- return `${ getIndefiniteArticle(typeString) } <${ typeString }> must have a defined <Error Reference>`;
402
+
403
+ if (parentNode && is(parentNode, 'bpmn:CatchEvent')) {
404
+ return getSupportedMessage(`${ getIndefiniteArticle(typeString) } <${ typeString }> without defined <Error Reference>`, executionPlatform, executionPlatformVersion, allowedVersion);
405
+ } else if (parentNode && is(parentNode, 'bpmn:ThrowEvent')) {
406
+ return `${ getIndefiniteArticle(typeString) } <${ typeString }> must have a defined <Error Reference>`;
407
+ }
408
+
396
409
  }
397
410
 
398
411
  if (requiredProperty === 'messageRef') {
@@ -493,4 +506,6 @@ function getExpressionNotAllowedErrorMessage(report) {
493
506
  } else if (is(node, 'bpmn:Error') && property === 'errorCode' && is(parentNode, 'bpmn:CatchEvent')) {
494
507
  return 'Error code used in a catch event must be a static value';
495
508
  }
496
- }
509
+
510
+ return report.message;
511
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/linting",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "Linting for Camunda Platform",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -27,7 +27,7 @@
27
27
  "dependencies": {
28
28
  "bpmn-moddle": "^8.0.0",
29
29
  "bpmnlint": "^8.0.0",
30
- "bpmnlint-plugin-camunda-compat": "^0.21.0",
30
+ "bpmnlint-plugin-camunda-compat": "^0.22.0",
31
31
  "bpmnlint-utils": "^1.0.2",
32
32
  "min-dash": "^4.0.0",
33
33
  "min-dom": "^4.1.0",