Giter Club home page Giter Club logo

camunda-modeler-linter-best-practices-plugin's Introduction

This plugin adds lint rules to the built-in linting feature introduced in Camunda Modeler v5.0 and supporting plugins since v5.4.

To use this plugin with Camunda Modeler v5.2 and older check out the camunda-modeler-5-2 branch.

Custom Linter Rules Example Plugin

Compatible with Camunda Modeler version 5.4 and newer

This plug-in provides custom lint rules to the built-in Camunda Modeler linting feature. Fork it to suit your needs.

Configuring Rules

Use the local .bpmnlintrc file to configure active lint rules.

Checkout the bpmnlint documentation for more information regarding this file.

Creating Rules

This project ships with a bpmnlint extension with the custom namespace. Add or edit rules in the extension's rules directory. Activate the rules via the local .bpmnlintrc file, in order to use them, prefixed with the namespace:

{
 "extends": [
    "bpmnlint:recommended",
    "plugin:custom/recommended"
 ],
 "rules": {
   "custom/no-manual-task": "warn",
   "custom/your-other-rule": "error"
 }
}

Plug-in Discovery

The custom namespace used by the shipped bpmnlint extension is arbitrary, i.e. can be changed freely. However you'd need to take into account how the linting infrastructure discovers rules and configuration:

  • It searches the rule provider library in the NodeJS search path (usually node_modules folder)
    • For a library bpmnlint-plugin-{custom}, given a namespace {custom}
    • For a library {@prefix}/bpmnlint-plugin-{custom}, given a scoped namespace {@prefix}/{custom}
  • Within a rule provider library
    • It searches the rules folder for a file matching an activated rule name
    • It searches the config folder for a file matching a configured configuration or inspect the plug-ins default export

In the case of our custom plug-in custom/recommended reference the custom configuration, exported by our plug-ins entry point. The rule custom/no-manual-task on the other hand references plug-ins entry point.

Bundling

Setup the project:

npm install

Build the plug-in:

npm run all

Continuously rebuild in development mode:

npm run dev

Before you Publish

  • Clearly state which Camunda Modeler version your plug-in is compatible with
  • Give your plug-in a unique name

Additional Resources

Licence

MIT

camunda-modeler-linter-best-practices-plugin's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.