Skip to content

Commit

Permalink
docs(README): document modern way of working
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Oct 10, 2024
1 parent 368c080 commit 2e88241
Showing 1 changed file with 33 additions and 18 deletions.
51 changes: 33 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,47 @@ Common lint rules for [bpmn.io](https://bpmn.io) projects.

## Use

Extend `bpmn-io/*` in your base eslint configuration:
Extend one or more of our recommended configurations:

```json
{
"extends": "plugin:bpmn-io/browser"
}
```
```javascript
import bpmnIoPlugin from 'eslint-plugin-bpmn-io';

If you use [mocha](https://mochajs.org/) for testing, place another `.eslintrc` into your `test` folder and extend from `bpmn-io/mocha`:
export default [
...bpmnIoPlugin.configs.recommended
]
```

```json
{
"extends": "plugin:bpmn-io/mocha"
}
If you use [mocha](https://mochajs.org/) for testing, add the mocha profile to your specs:

```javascript
import bpmnIoPlugin from 'eslint-plugin-bpmn-io';

export default [
...bpmnIoPlugin.configs.browser,
...bpmnIoPlugin.configs.mocha.map(config => {
return {
...config,
files: [
'**/*.spec.js'
]
};
})
]
```


## Available Recommended Configurations
## Available Configurations

Base configurations:

* `browser`: Use for browser based projects
* `node`: Use for node based projects
* `recommended`: Use for libraries where no environment is assumed

We ship with a few blue prints:
Special purpose configurations:

* `bpmn-io/browser`: Use for browser based projects
* `bpmn-io/jsx`: Use `jsx` in conjunction with `browser`
* `bpmn-io/node`: Use for node based projects
* `bpmn-io/mocha`: Use for libraries tested with `mocha` + `chai`
* `bpmn-io/recommended`: Use for libraries where no environment is assumed
* `jsx`: Use `jsx` in conjunction with `browser`
* `mocha`: Use for libraries tested with `mocha` + `chai`


## License
Expand Down

0 comments on commit 2e88241

Please sign in to comment.