@camunda/linting 3.24.0 → 3.25.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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2022-present Camunda Services GmbH
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2022-present Camunda Services GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,75 +1,75 @@
1
- # @camunda/linting
2
-
3
- [![CI](https://github.com/camunda/linting/actions/workflows/CI.yml/badge.svg)](https://github.com/camunda/linting/actions/workflows/CI.yml)
4
-
5
- The BPMN linter used by the Camunda Desktop and Web Modeler. Batteries included. 🔋
6
-
7
- ## Features
8
-
9
- * bundles [bpmnlint](https://github.com/bpmn-io/bpmnlint) and [bpmnlint-plugin-camunda-compat](https://github.com/camunda/bpmnlint-plugin-camunda-compat/)
10
- * configures linter based on `modeler:executionPlatform` and `modeler:executionPlatformVersion`
11
- * creates error messages to be shown in desktop and web modeler
12
- * creates errors to be shown in properties panel
13
- * creates error overlays to be shown on canvas
14
-
15
- ## Usage
16
-
17
- ```javascript
18
- import Modeler from 'bpmn-js/lib/Modeler';
19
-
20
- import { Linter } from '@camunda/linting';
21
-
22
- import lintingModule from '@camunda/linting/modeler';
23
-
24
- import '@camunda/linting/assets/linting.css';
25
-
26
- const modeler = new Modeler({
27
- additionalModules: [
28
- lintingModule
29
- ]
30
- });
31
-
32
- // configure to be used with desktop or web modeler
33
- const linter = new Linter({
34
- modeler: 'web', // `desktop` or `web` modeler, defaults to `desktop`
35
- type: 'cloud' // `cloud` or `platform` diagrams, defaults to `cloud`
36
- });
37
-
38
- // lint by passing definitions
39
- const reports = await linter.lint(definitions);
40
-
41
- // or passing XML
42
- const reports = await linter.lint(xml);
43
-
44
- ...
45
-
46
- // update errors on canvas and in properties panel (requires bpmn-js-properties-panel >= 1.3.0)
47
- modeler.get('linting').setErrors(reports);
48
-
49
- // show error by selecting element and properties panel entry
50
- modeler.get('linting').showError(report);
51
-
52
- // activate and deactivate errors on canvas
53
- modeler.get('linting').activate();
54
- modeler.get('linting').deactivate();
55
- ```
56
-
57
- ## Development
58
-
59
- ```sh
60
- # install
61
- npm i
62
-
63
- # run tests
64
- npm t
65
-
66
- # run tests in watch mode
67
- npm run test:watch
68
-
69
- # run example
70
- npm start
71
- ```
72
-
73
- ## License
74
-
75
- MIT
1
+ # @camunda/linting
2
+
3
+ [![CI](https://github.com/camunda/linting/actions/workflows/CI.yml/badge.svg)](https://github.com/camunda/linting/actions/workflows/CI.yml)
4
+
5
+ The BPMN linter used by the Camunda Desktop and Web Modeler. Batteries included. 🔋
6
+
7
+ ## Features
8
+
9
+ * bundles [bpmnlint](https://github.com/bpmn-io/bpmnlint) and [bpmnlint-plugin-camunda-compat](https://github.com/camunda/bpmnlint-plugin-camunda-compat/)
10
+ * configures linter based on `modeler:executionPlatform` and `modeler:executionPlatformVersion`
11
+ * creates error messages to be shown in desktop and web modeler
12
+ * creates errors to be shown in properties panel
13
+ * creates error overlays to be shown on canvas
14
+
15
+ ## Usage
16
+
17
+ ```javascript
18
+ import Modeler from 'bpmn-js/lib/Modeler';
19
+
20
+ import { Linter } from '@camunda/linting';
21
+
22
+ import lintingModule from '@camunda/linting/modeler';
23
+
24
+ import '@camunda/linting/assets/linting.css';
25
+
26
+ const modeler = new Modeler({
27
+ additionalModules: [
28
+ lintingModule
29
+ ]
30
+ });
31
+
32
+ // configure to be used with desktop or web modeler
33
+ const linter = new Linter({
34
+ modeler: 'web', // `desktop` or `web` modeler, defaults to `desktop`
35
+ type: 'cloud' // `cloud` or `platform` diagrams, defaults to `cloud`
36
+ });
37
+
38
+ // lint by passing definitions
39
+ const reports = await linter.lint(definitions);
40
+
41
+ // or passing XML
42
+ const reports = await linter.lint(xml);
43
+
44
+ ...
45
+
46
+ // update errors on canvas and in properties panel (requires bpmn-js-properties-panel >= 1.3.0)
47
+ modeler.get('linting').setErrors(reports);
48
+
49
+ // show error by selecting element and properties panel entry
50
+ modeler.get('linting').showError(report);
51
+
52
+ // activate and deactivate errors on canvas
53
+ modeler.get('linting').activate();
54
+ modeler.get('linting').deactivate();
55
+ ```
56
+
57
+ ## Development
58
+
59
+ ```sh
60
+ # install
61
+ npm i
62
+
63
+ # run tests
64
+ npm t
65
+
66
+ # run tests in watch mode
67
+ npm run test:watch
68
+
69
+ # run example
70
+ npm start
71
+ ```
72
+
73
+ ## License
74
+
75
+ MIT
@@ -1,38 +1,38 @@
1
- :root {
2
- --cl-color-white: hsl(0, 0%, 100%);
3
-
4
- --cl-color-info: #0f62fe;
5
- --cl-color-warning: #ff832b;
6
- --cl-color-error: #da1e26;
7
- --cl-color-success: #52b415;
8
- }
9
-
10
- .cl-icon, .cl-icon * {
11
- box-sizing: border-box;
12
- }
13
-
14
- .cl-icon {
15
- --icon-color: white;
16
- --icon-bg-color: #333;
17
- background: var(--icon-bg-color);
18
- color: var(--icon-color);
19
- border-radius: 100%;
20
- height: 20px;
21
- width: 20px;
22
- border: solid 4px var(--icon-bg-color);
23
- display: flex;
24
- align-items: center;
25
- justify-content: center;
26
- }
27
-
28
- .cl-icon-error {
29
- --icon-bg-color: var(--cl-color-error);
30
- }
31
-
32
- .cl-icon-warn {
33
- --icon-bg-color: var(--cl-color-warning);
34
- }
35
-
36
- .cl-icon-info {
37
- --icon-bg-color: var(--cl-color-info);
1
+ :root {
2
+ --cl-color-white: hsl(0, 0%, 100%);
3
+
4
+ --cl-color-info: #0f62fe;
5
+ --cl-color-warning: #ff832b;
6
+ --cl-color-error: #da1e26;
7
+ --cl-color-success: #52b415;
8
+ }
9
+
10
+ .cl-icon, .cl-icon * {
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ .cl-icon {
15
+ --icon-color: white;
16
+ --icon-bg-color: #333;
17
+ background: var(--icon-bg-color);
18
+ color: var(--icon-color);
19
+ border-radius: 100%;
20
+ height: 20px;
21
+ width: 20px;
22
+ border: solid 4px var(--icon-bg-color);
23
+ display: flex;
24
+ align-items: center;
25
+ justify-content: center;
26
+ }
27
+
28
+ .cl-icon-error {
29
+ --icon-bg-color: var(--cl-color-error);
30
+ }
31
+
32
+ .cl-icon-warn {
33
+ --icon-bg-color: var(--cl-color-warning);
34
+ }
35
+
36
+ .cl-icon-info {
37
+ --icon-bg-color: var(--cl-color-info);
38
38
  }
package/lib/Resolver.js CHANGED
@@ -1,31 +1,31 @@
1
- export default class NestedResolver {
2
- constructor(resolvers) {
3
- this.resolvers = resolvers.slice().reverse();
4
- }
5
-
6
- resolveRule(pkg, ruleName) {
7
- for (const resolver of this.resolvers) {
8
- try {
9
- return resolver.resolveRule(pkg, ruleName);
10
- } catch (err) {
11
-
12
- // ignore
13
- }
14
- }
15
-
16
- throw new Error(`unknown rule <${ pkg }/${ ruleName }>`);
17
- }
18
-
19
- resolveConfig(pkg, configName) {
20
- for (const resolver of this.resolvers) {
21
- try {
22
- return resolver.resolveConfig(pkg, configName);
23
- } catch (err) {
24
-
25
- // ignore
26
- }
27
- }
28
-
29
- throw new Error(`unknown config <${ pkg }/${ configName }>`);
30
- }
31
- }
1
+ export default class NestedResolver {
2
+ constructor(resolvers) {
3
+ this.resolvers = resolvers.slice().reverse();
4
+ }
5
+
6
+ resolveRule(pkg, ruleName) {
7
+ for (const resolver of this.resolvers) {
8
+ try {
9
+ return resolver.resolveRule(pkg, ruleName);
10
+ } catch (err) {
11
+
12
+ // ignore
13
+ }
14
+ }
15
+
16
+ throw new Error(`unknown rule <${ pkg }/${ ruleName }>`);
17
+ }
18
+
19
+ resolveConfig(pkg, configName) {
20
+ for (const resolver of this.resolvers) {
21
+ try {
22
+ return resolver.resolveConfig(pkg, configName);
23
+ } catch (err) {
24
+
25
+ // ignore
26
+ }
27
+ }
28
+
29
+ throw new Error(`unknown config <${ pkg }/${ configName }>`);
30
+ }
31
+ }
@@ -54,12 +54,14 @@ const rules = {
54
54
  "camunda-compat/no-expression": "error",
55
55
  "camunda-compat/no-loop": "error",
56
56
  "camunda-compat/no-multiple-none-start-events": "error",
57
+ "camunda-compat/no-priority-definition": "error",
57
58
  "camunda-compat/no-propagate-all-parent-variables": "error",
58
59
  "camunda-compat/no-signal-event-sub-process": "error",
59
60
  "camunda-compat/no-task-schedule": "error",
60
61
  "camunda-compat/no-template": "error",
61
62
  "camunda-compat/no-zeebe-properties": "error",
62
63
  "camunda-compat/no-zeebe-user-task": "error",
64
+ "camunda-compat/priority-definition": "error",
63
65
  "camunda-compat/secrets": "warn",
64
66
  "camunda-compat/sequence-flow-condition": "error",
65
67
  "camunda-compat/signal-reference": "error",
@@ -185,66 +187,74 @@ import rule_24 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-multi
185
187
 
186
188
  cache['bpmnlint-plugin-camunda-compat/no-multiple-none-start-events'] = rule_24;
187
189
 
188
- import rule_25 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-propagate-all-parent-variables';
190
+ import rule_25 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-priority-definition';
189
191
 
190
- cache['bpmnlint-plugin-camunda-compat/no-propagate-all-parent-variables'] = rule_25;
192
+ cache['bpmnlint-plugin-camunda-compat/no-priority-definition'] = rule_25;
191
193
 
192
- import rule_26 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-signal-event-sub-process';
194
+ import rule_26 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-propagate-all-parent-variables';
193
195
 
194
- cache['bpmnlint-plugin-camunda-compat/no-signal-event-sub-process'] = rule_26;
196
+ cache['bpmnlint-plugin-camunda-compat/no-propagate-all-parent-variables'] = rule_26;
195
197
 
196
- import rule_27 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-task-schedule';
198
+ import rule_27 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-signal-event-sub-process';
197
199
 
198
- cache['bpmnlint-plugin-camunda-compat/no-task-schedule'] = rule_27;
200
+ cache['bpmnlint-plugin-camunda-compat/no-signal-event-sub-process'] = rule_27;
199
201
 
200
- import rule_28 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-template';
202
+ import rule_28 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-task-schedule';
201
203
 
202
- cache['bpmnlint-plugin-camunda-compat/no-template'] = rule_28;
204
+ cache['bpmnlint-plugin-camunda-compat/no-task-schedule'] = rule_28;
203
205
 
204
- import rule_29 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-zeebe-properties';
206
+ import rule_29 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-template';
205
207
 
206
- cache['bpmnlint-plugin-camunda-compat/no-zeebe-properties'] = rule_29;
208
+ cache['bpmnlint-plugin-camunda-compat/no-template'] = rule_29;
207
209
 
208
- import rule_30 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-zeebe-user-task';
210
+ import rule_30 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-zeebe-properties';
209
211
 
210
- cache['bpmnlint-plugin-camunda-compat/no-zeebe-user-task'] = rule_30;
212
+ cache['bpmnlint-plugin-camunda-compat/no-zeebe-properties'] = rule_30;
211
213
 
212
- import rule_31 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/secrets';
214
+ import rule_31 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-zeebe-user-task';
213
215
 
214
- cache['bpmnlint-plugin-camunda-compat/secrets'] = rule_31;
216
+ cache['bpmnlint-plugin-camunda-compat/no-zeebe-user-task'] = rule_31;
215
217
 
216
- import rule_32 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/sequence-flow-condition';
218
+ import rule_32 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/priority-definition';
217
219
 
218
- cache['bpmnlint-plugin-camunda-compat/sequence-flow-condition'] = rule_32;
220
+ cache['bpmnlint-plugin-camunda-compat/priority-definition'] = rule_32;
219
221
 
220
- import rule_33 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/signal-reference';
222
+ import rule_33 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/secrets';
221
223
 
222
- cache['bpmnlint-plugin-camunda-compat/signal-reference'] = rule_33;
224
+ cache['bpmnlint-plugin-camunda-compat/secrets'] = rule_33;
223
225
 
224
- import rule_34 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/start-event-form';
226
+ import rule_34 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/sequence-flow-condition';
225
227
 
226
- cache['bpmnlint-plugin-camunda-compat/start-event-form'] = rule_34;
228
+ cache['bpmnlint-plugin-camunda-compat/sequence-flow-condition'] = rule_34;
227
229
 
228
- import rule_35 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/subscription';
230
+ import rule_35 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/signal-reference';
229
231
 
230
- cache['bpmnlint-plugin-camunda-compat/subscription'] = rule_35;
232
+ cache['bpmnlint-plugin-camunda-compat/signal-reference'] = rule_35;
231
233
 
232
- import rule_36 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/task-schedule';
234
+ import rule_36 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/start-event-form';
233
235
 
234
- cache['bpmnlint-plugin-camunda-compat/task-schedule'] = rule_36;
236
+ cache['bpmnlint-plugin-camunda-compat/start-event-form'] = rule_36;
235
237
 
236
- import rule_37 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/timer';
238
+ import rule_37 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/subscription';
237
239
 
238
- cache['bpmnlint-plugin-camunda-compat/timer'] = rule_37;
240
+ cache['bpmnlint-plugin-camunda-compat/subscription'] = rule_37;
239
241
 
240
- import rule_38 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-definition';
242
+ import rule_38 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/task-schedule';
241
243
 
242
- cache['bpmnlint-plugin-camunda-compat/user-task-definition'] = rule_38;
244
+ cache['bpmnlint-plugin-camunda-compat/task-schedule'] = rule_38;
243
245
 
244
- import rule_39 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-form';
246
+ import rule_39 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/timer';
245
247
 
246
- cache['bpmnlint-plugin-camunda-compat/user-task-form'] = rule_39;
248
+ cache['bpmnlint-plugin-camunda-compat/timer'] = rule_39;
247
249
 
248
- import rule_40 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/wait-for-completion';
250
+ import rule_40 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-definition';
249
251
 
250
- cache['bpmnlint-plugin-camunda-compat/wait-for-completion'] = rule_40;
252
+ cache['bpmnlint-plugin-camunda-compat/user-task-definition'] = rule_40;
253
+
254
+ import rule_41 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-form';
255
+
256
+ cache['bpmnlint-plugin-camunda-compat/user-task-form'] = rule_41;
257
+
258
+ import rule_42 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/wait-for-completion';
259
+
260
+ cache['bpmnlint-plugin-camunda-compat/wait-for-completion'] = rule_42;