@camunda/linting 3.7.2 → 3.8.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.
@@ -22,7 +22,11 @@ const TIMER_PROPERTIES = [
22
22
  */
23
23
  export function getErrors(reports, element) {
24
24
  return reports.reduce((errors, report) => {
25
- if (!element || getBusinessObject(element).get('id') !== report.id) {
25
+ const { category } = report;
26
+
27
+ if (!element
28
+ || getBusinessObject(element).get('id') !== report.id
29
+ || category !== 'error') {
26
30
  return errors;
27
31
  }
28
32
 
@@ -226,7 +230,7 @@ export function getEntryIds(report) {
226
230
  ];
227
231
 
228
232
  for (const [ type, prefix ] of LIST_PROPERTIES) {
229
- if (hasType(data, type)
233
+ if (isType(data, type)
230
234
  && getPropertyName(data)) {
231
235
 
232
236
  const index = path[ path.length - 2 ];
@@ -235,7 +239,7 @@ export function getEntryIds(report) {
235
239
  }
236
240
  }
237
241
 
238
- if (hasType(data, 'zeebe:LoopCharacteristics')) {
242
+ if (isType(data, 'zeebe:LoopCharacteristics')) {
239
243
  return [ `multiInstance-${getPropertyName(data)}` ];
240
244
  }
241
245
 
@@ -298,10 +302,6 @@ export function getErrorMessage(id, report) {
298
302
  return 'Cannot be an expression.';
299
303
  }
300
304
 
301
- if (data.type === ERROR_TYPES.SECRET_EXPRESSION_FORMAT_DEPRECATED) {
302
- return 'Secret expression format deprecated.';
303
- }
304
-
305
305
  if (id === 'isExecutable') {
306
306
  const { parentNode } = data;
307
307
 
@@ -384,7 +384,11 @@ export function getErrorMessage(id, report) {
384
384
  return 'Type must be defined.';
385
385
  }
386
386
 
387
- if (id === 'messageSubscriptionCorrelationKey') {
387
+ if (id === 'messageSubscriptionCorrelationKey'
388
+ && [
389
+ ERROR_TYPES.EXTENSION_ELEMENT_REQUIRED,
390
+ ERROR_TYPES.PROPERTY_REQUIRED
391
+ ].includes(data.type)) {
388
392
  return 'Subscription correlation key must be defined.';
389
393
  }
390
394
 
@@ -498,14 +502,16 @@ function isPropertyError(data, property, type) {
498
502
  && (!type || is(data.node, type));
499
503
  }
500
504
 
501
- function hasType(data, type) {
502
- return data.node && is(data.node, type);
503
- }
504
-
505
505
  function getPropertyName(data) {
506
- const propertyKey = data.type === ERROR_TYPES.PROPERTY_REQUIRED ? 'requiredProperty' : 'property';
506
+ if (data.type === ERROR_TYPES.PROPERTY_REQUIRED) {
507
+ return data.requiredProperty;
508
+ }
507
509
 
508
- return data[ propertyKey ];
510
+ return data.property;
511
+ }
512
+
513
+ function isType(data, type) {
514
+ return data.node && is(data.node, type);
509
515
  }
510
516
 
511
517
  function isOneOfPropertiesRequiredError(data, requiredProperty, type) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/linting",
3
- "version": "3.7.2",
3
+ "version": "3.8.1",
4
4
  "description": "Linting for Camunda Platform",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -32,7 +32,7 @@
32
32
  "@bpmn-io/diagram-js-ui": "^0.2.2",
33
33
  "bpmn-moddle": "^8.0.0",
34
34
  "bpmnlint": "^9.2.0",
35
- "bpmnlint-plugin-camunda-compat": "^2.7.1",
35
+ "bpmnlint-plugin-camunda-compat": "^2.8.1",
36
36
  "bpmnlint-utils": "^1.0.2",
37
37
  "camunda-bpmn-moddle": "^7.0.1",
38
38
  "clsx": "^2.0.0",