Linter for FEEL expressions.
npm install @bpmn-io/feel-lint
Linting for FEEL expressions.
There are 2 ways to use this library:
The lintExpression function takes a string expression and returns a list of linting errors.
``javascript
import { lintExpression } from "@bpmn-io/feel-lint"
lintExpression('foo = bar');
`
You may pass custom language configuration to the editor. Checkout @camunda/feel-builtins for a reference of built-in functions.
`javascript
import { camundaBuiltins } from '@camunda/feel-builtins';
lintExpression('> 10, "yes", mike\'s name', {
dialect: 'unaryTests',
builtins: camundaBuiltins,
variables: [
{
name: mike's name`
}
]
});
The cmFeelLinter function returns a LintSource that you can use to extend your CodeMirror instance.
`javascript
import { cmFeelLinter } from "@bpmn-io/feel-lint"
import { linter } from '@codemirror/lint';
// ...
const myEditor = new EditorView({
state: EditorState.create({
doc: '',
extensions: [
linter(cmFeelLinter())
]
})
});
`
To get the development setup make sure to have NodeJS installed.
As soon as you are set up, clone the project and execute
```
npm install
npm run dev
MIT