@camunda/linting 3.23.0 → 3.24.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
+ }
@@ -48,6 +48,7 @@ const rules = {
48
48
  "camunda-compat/link-event": "error",
49
49
  "camunda-compat/loop-characteristics": "error",
50
50
  "camunda-compat/message-reference": "error",
51
+ "camunda-compat/no-binding-type": "error",
51
52
  "camunda-compat/no-candidate-users": "error",
52
53
  "camunda-compat/no-execution-listeners": "error",
53
54
  "camunda-compat/no-expression": "error",
@@ -160,86 +161,90 @@ import rule_18 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/message-
160
161
 
161
162
  cache['bpmnlint-plugin-camunda-compat/message-reference'] = rule_18;
162
163
 
163
- import rule_19 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-candidate-users';
164
+ import rule_19 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-binding-type';
164
165
 
165
- cache['bpmnlint-plugin-camunda-compat/no-candidate-users'] = rule_19;
166
+ cache['bpmnlint-plugin-camunda-compat/no-binding-type'] = rule_19;
166
167
 
167
- import rule_20 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-execution-listeners';
168
+ import rule_20 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-candidate-users';
168
169
 
169
- cache['bpmnlint-plugin-camunda-compat/no-execution-listeners'] = rule_20;
170
+ cache['bpmnlint-plugin-camunda-compat/no-candidate-users'] = rule_20;
170
171
 
171
- import rule_21 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-expression';
172
+ import rule_21 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-execution-listeners';
172
173
 
173
- cache['bpmnlint-plugin-camunda-compat/no-expression'] = rule_21;
174
+ cache['bpmnlint-plugin-camunda-compat/no-execution-listeners'] = rule_21;
174
175
 
175
- import rule_22 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-loop';
176
+ import rule_22 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-expression';
176
177
 
177
- cache['bpmnlint-plugin-camunda-compat/no-loop'] = rule_22;
178
+ cache['bpmnlint-plugin-camunda-compat/no-expression'] = rule_22;
178
179
 
179
- import rule_23 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-multiple-none-start-events';
180
+ import rule_23 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-loop';
180
181
 
181
- cache['bpmnlint-plugin-camunda-compat/no-multiple-none-start-events'] = rule_23;
182
+ cache['bpmnlint-plugin-camunda-compat/no-loop'] = rule_23;
182
183
 
183
- import rule_24 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-propagate-all-parent-variables';
184
+ import rule_24 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-multiple-none-start-events';
184
185
 
185
- cache['bpmnlint-plugin-camunda-compat/no-propagate-all-parent-variables'] = rule_24;
186
+ cache['bpmnlint-plugin-camunda-compat/no-multiple-none-start-events'] = rule_24;
186
187
 
187
- import rule_25 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-signal-event-sub-process';
188
+ import rule_25 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-propagate-all-parent-variables';
188
189
 
189
- cache['bpmnlint-plugin-camunda-compat/no-signal-event-sub-process'] = rule_25;
190
+ cache['bpmnlint-plugin-camunda-compat/no-propagate-all-parent-variables'] = rule_25;
190
191
 
191
- import rule_26 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-task-schedule';
192
+ import rule_26 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-signal-event-sub-process';
192
193
 
193
- cache['bpmnlint-plugin-camunda-compat/no-task-schedule'] = rule_26;
194
+ cache['bpmnlint-plugin-camunda-compat/no-signal-event-sub-process'] = rule_26;
194
195
 
195
- import rule_27 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-template';
196
+ import rule_27 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-task-schedule';
196
197
 
197
- cache['bpmnlint-plugin-camunda-compat/no-template'] = rule_27;
198
+ cache['bpmnlint-plugin-camunda-compat/no-task-schedule'] = rule_27;
198
199
 
199
- import rule_28 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-zeebe-properties';
200
+ import rule_28 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-template';
200
201
 
201
- cache['bpmnlint-plugin-camunda-compat/no-zeebe-properties'] = rule_28;
202
+ cache['bpmnlint-plugin-camunda-compat/no-template'] = rule_28;
202
203
 
203
- import rule_29 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-zeebe-user-task';
204
+ import rule_29 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-zeebe-properties';
204
205
 
205
- cache['bpmnlint-plugin-camunda-compat/no-zeebe-user-task'] = rule_29;
206
+ cache['bpmnlint-plugin-camunda-compat/no-zeebe-properties'] = rule_29;
206
207
 
207
- import rule_30 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/secrets';
208
+ import rule_30 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-zeebe-user-task';
208
209
 
209
- cache['bpmnlint-plugin-camunda-compat/secrets'] = rule_30;
210
+ cache['bpmnlint-plugin-camunda-compat/no-zeebe-user-task'] = rule_30;
210
211
 
211
- import rule_31 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/sequence-flow-condition';
212
+ import rule_31 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/secrets';
212
213
 
213
- cache['bpmnlint-plugin-camunda-compat/sequence-flow-condition'] = rule_31;
214
+ cache['bpmnlint-plugin-camunda-compat/secrets'] = rule_31;
214
215
 
215
- import rule_32 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/signal-reference';
216
+ import rule_32 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/sequence-flow-condition';
216
217
 
217
- cache['bpmnlint-plugin-camunda-compat/signal-reference'] = rule_32;
218
+ cache['bpmnlint-plugin-camunda-compat/sequence-flow-condition'] = rule_32;
218
219
 
219
- import rule_33 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/start-event-form';
220
+ import rule_33 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/signal-reference';
220
221
 
221
- cache['bpmnlint-plugin-camunda-compat/start-event-form'] = rule_33;
222
+ cache['bpmnlint-plugin-camunda-compat/signal-reference'] = rule_33;
222
223
 
223
- import rule_34 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/subscription';
224
+ import rule_34 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/start-event-form';
224
225
 
225
- cache['bpmnlint-plugin-camunda-compat/subscription'] = rule_34;
226
+ cache['bpmnlint-plugin-camunda-compat/start-event-form'] = rule_34;
226
227
 
227
- import rule_35 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/task-schedule';
228
+ import rule_35 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/subscription';
228
229
 
229
- cache['bpmnlint-plugin-camunda-compat/task-schedule'] = rule_35;
230
+ cache['bpmnlint-plugin-camunda-compat/subscription'] = rule_35;
230
231
 
231
- import rule_36 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/timer';
232
+ import rule_36 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/task-schedule';
232
233
 
233
- cache['bpmnlint-plugin-camunda-compat/timer'] = rule_36;
234
+ cache['bpmnlint-plugin-camunda-compat/task-schedule'] = rule_36;
234
235
 
235
- import rule_37 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-definition';
236
+ import rule_37 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/timer';
236
237
 
237
- cache['bpmnlint-plugin-camunda-compat/user-task-definition'] = rule_37;
238
+ cache['bpmnlint-plugin-camunda-compat/timer'] = rule_37;
238
239
 
239
- import rule_38 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-form';
240
+ import rule_38 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-definition';
240
241
 
241
- cache['bpmnlint-plugin-camunda-compat/user-task-form'] = rule_38;
242
+ cache['bpmnlint-plugin-camunda-compat/user-task-definition'] = rule_38;
242
243
 
243
- import rule_39 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/wait-for-completion';
244
+ import rule_39 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-form';
244
245
 
245
- cache['bpmnlint-plugin-camunda-compat/wait-for-completion'] = rule_39;
246
+ cache['bpmnlint-plugin-camunda-compat/user-task-form'] = rule_39;
247
+
248
+ import rule_40 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/wait-for-completion';
249
+
250
+ cache['bpmnlint-plugin-camunda-compat/wait-for-completion'] = rule_40;