Skip to content

Commit

Permalink
feat: add bpmnlint recommended rules built-in
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Feb 7, 2023
1 parent 2a92253 commit b6e1281
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"camunda-cmmn-moddle": "^1.0.0",
"camunda-dmn-js": "^0.8.1",
"camunda-dmn-moddle": "^1.2.0",
"camunda-modeler-plugin-helpers": "^5.1.0",
"canvg-browser": "^1.0.0",
"classnames": "^2.2.6",
"cmmn-js": "^0.20.0",
Expand Down
2 changes: 2 additions & 0 deletions client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

import './styles/style.less';

import './plugins/linting/bpmnlint-recommended-rules';

import {
backend,
config,
Expand Down
22 changes: 22 additions & 0 deletions client/src/plugins/linting/bpmnlint-recommended-rules/.bpmnlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"extends": "bpmnlint:recommended",
"rules": {
"conditional-flows": "warn",
"end-event-required": "warn",
"event-sub-process-typed-start-event": "warn",
"fake-join": "warn",
"label-required": "warn",
"no-bpmndi": "warn",
"no-complex-gateway": "warn",
"no-disconnected": "warn",
"no-duplicate-sequence-flows": "warn",
"no-gateway-join-fork": "warn",
"no-implicit-split": "warn",
"no-inclusive-gateway": "warn",
"single-blank-start-event": "warn",
"single-event-definition": "warn",
"start-event-required": "warn",
"sub-process-blank-start-event": "warn",
"superfluous-gateway": "warn"
}
}
18 changes: 18 additions & 0 deletions client/src/plugins/linting/bpmnlint-recommended-rules/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
* under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership.
*
* Camunda licenses this file to you under the MIT; you may not use this file
* except in compliance with the MIT License.
*/

import {
registerClientPlugin
} from 'camunda-modeler-plugin-helpers';

import recommendedRules from './.bpmnlintrc';

registerClientPlugin(recommendedRules, 'lintRules.bpmn');
registerClientPlugin(recommendedRules, 'lintRules.cloud-bpmn');
4 changes: 4 additions & 0 deletions client/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ module.exports = {
},
module: {
rules: [
{
test: /\.bpmnlintrc$/i,
use: 'bpmnlint-loader',
},
{
test: /\.js$/,
exclude: /node_modules/,
Expand Down
12 changes: 12 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b6e1281

Please sign in to comment.