1 | # bpmn-js-bpmnlint
|
2 |
|
3 | [![CI](https://github.com/bpmn-io/bpmn-js-bpmnlint/workflows/CI/badge.svg)](https://github.com/bpmn-io/bpmn-js-bpmnlint/actions?query=workflow%3ACI)
|
4 |
|
5 | Integrates [bpmnlint](https://github.com/bpmn-io/bpmnlint) into [bpmn-js](https://github.com/bpmn-io/bpmn-js).
|
6 |
|
7 | ![Screenshot](docs/screenshot.png)
|
8 |
|
9 | See this extension in action as part of the [bpmnlint playground](https://github.com/bpmn-io/bpmnlint-playground).
|
10 |
|
11 |
|
12 | ## Usage
|
13 |
|
14 | Integrate the linter into [bpmn-js](https://github.com/bpmn-io/bpmn-js):
|
15 |
|
16 | ```javascript
|
17 | import lintModule from 'bpmn-js-bpmnlint';
|
18 |
|
19 | import 'bpmn-js-bpmnlint/dist/assets/css/bpmn-js-bpmnlint.css';
|
20 |
|
21 | import BpmnModeler from 'bpmn-js/lib/Modeler';
|
22 |
|
23 | import bpmnlintConfig from './.bpmnlintrc';
|
24 |
|
25 | const modeler = new BpmnModeler({
|
26 | linting: {
|
27 | bpmnlint: bpmnlintConfig
|
28 | },
|
29 | additionalModules: [
|
30 | lintModule
|
31 | ]
|
32 | });
|
33 | ```
|
34 |
|
35 |
|
36 | ## Bundle Lint Rules
|
37 |
|
38 | Use an appropriate plugin/loader for your module bundler (cf. [rollup-plugin-bpmnlint](https://github.com/nikku/rollup-plugin-bpmnlint), [bpmnlint-loader](https://github.com/nikku/bpmnlint-loader)) to bundle the bpmnlint configuration directly with your application as [shown above](#usage).
|
39 |
|
40 | Alternatively, pack your local `.bpmnlintrc` file using the [bpmnlint-pack-config](https://github.com/nikku/bpmnlint-pack-config) utility:
|
41 |
|
42 | ```shell
|
43 | bpmnlint-pack-config -c .bpmnlintrc -o bundled-config.js
|
44 | ```
|
45 |
|
46 |
|
47 | ## Plug-in Lint Rules
|
48 |
|
49 | Provide the [packed lint rules](#bundle-lint-rules) via the `linting.bpmnlint` option. You may set it dynamically, too:
|
50 |
|
51 | ```javascript
|
52 | const linting = modeler.get('linting');
|
53 |
|
54 | linting.setLinterConfig(bpmnlintConfig);
|
55 | ```
|
56 |
|
57 |
|
58 | ## Resources
|
59 |
|
60 | * [Issues](https://github.com/bpmn-io/bpmn-js-bpmnlint/issues)
|
61 | * [Playground Project](https://github.com/bpmn-io/bpmnlint-playground)
|
62 |
|
63 |
|
64 | ## Development Setup
|
65 |
|
66 | ```
|
67 | npm install
|
68 | npm run dev
|
69 | ```
|
70 |
|
71 |
|
72 | ## License
|
73 |
|
74 | MIT
|