{"id":25011,"library":"bpmnlint","title":"bpmnlint","description":"bpmnlint is a BPMN diagram validation tool that checks diagrams against configurable lint rules. Current stable version is 11.12.1, with regular releases (approximately every few weeks). It supports BPMN 2.0 diagrams and provides multiple built-in configuration sets: 'recommended', 'correctness', and 'all'. Key differentiators include its focus on BPMN compliance, extensibility via custom plugins, moddle extension support for custom BPMN extensions, and both CLI and programmatic API usage. It integrates with bpmn-moddle for diagram parsing and is designed for process modelers and developers in BPMN-based workflows.","status":"active","version":"11.12.1","language":"javascript","source_language":"en","source_url":"https://github.com/bpmn-io/bpmnlint","tags":["javascript","bpmnlint","bpmn","linter","cli","validation","rules"],"install":[{"cmd":"npm install bpmnlint","lang":"bash","label":"npm"},{"cmd":"yarn add bpmnlint","lang":"bash","label":"yarn"},{"cmd":"pnpm add bpmnlint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for parsing BPMN XML into a moddle model for validation.","package":"bpmn-moddle","optional":false},{"reason":"Core modeling framework used by bpmn-moddle.","package":"moddle","optional":false},{"reason":"Used for reading and writing moddle objects from XML.","package":"moddle-xml","optional":false}],"imports":[{"note":"bpmnlint uses default export; CommonJS require() is not supported in ESM-first environments. Since v10 the package is ESM-only.","wrong":"const Linter = require('bpmnlint');","symbol":"Linter","correct":"import Linter from 'bpmnlint';"},{"note":"NodeResolver is a named export from internal module, not from the main package. Must import from the specific path.","wrong":"import { NodeResolver } from 'bpmnlint';","symbol":"NodeResolver","correct":"import NodeResolver from 'bpmnlint/lib/resolver/node-resolver';"},{"note":"Default import is the only way; there is no named Linter export.","wrong":"import Linter from 'bpmnlint'; // correct","symbol":"Linter","correct":"import Linter from 'bpmnlint';"}],"quickstart":{"code":"import Linter from 'bpmnlint';\nimport NodeResolver from 'bpmnlint/lib/resolver/node-resolver';\nimport BpmnModdle from 'bpmn-moddle';\n\nconst moddle = new BpmnModdle();\n\nconst linter = new Linter({\n  config: {\n    extends: 'bpmnlint:recommended'\n  },\n  resolver: new NodeResolver()\n});\n\nconst xmlStr = `\n  <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n  <bpmn:definitions xmlns:bpmn=\"http://www.omg.org/spec/BPMN/20100524/MODEL\" \n                     id=\"definitions\" \n                     targetNamespace=\"http://bpmn.io/schema/bpmn\">\n    <bpmn:process id=\"process\" />\n  </bpmn:definitions>\n`;\n\nconst { rootElement: definitions } = await moddle.fromXML(xmlStr);\nconst results = await linter.lint(definitions);\nconsole.log(JSON.stringify(results, null, 2));\n","lang":"typescript","description":"Shows how to programmatically lint a BPMN diagram using the bpmnlint API with a recommended config and NodeResolver."},"warnings":[{"fix":"Switch to ES module imports: use `import Linter from 'bpmnlint'` and ensure your project is configured for ESM.","message":"ESM-only since v10: bpmnlint v10+ is pure ESM and cannot be imported via require().","severity":"breaking","affected_versions":">=10.0.0"},{"fix":"Use `extends: 'bpmnlint:recommended'` instead of directly listing plugins.","message":"Config format deprecated: older `.bpmnlintrc` files using `plugins` array should migrate to `extends` pattern.","severity":"deprecated","affected_versions":">=8.0.0"},{"fix":"Use `import NodeResolver from 'bpmnlint/lib/resolver/node-resolver';`","message":"NodeResolver must be imported from internal path: import { NodeResolver } from 'bpmnlint' does not work.","severity":"gotcha","affected_versions":"all"},{"fix":"Use absolute paths or ensure the moddle extension file is relative to the config file.","message":"Moddle extensions resolution: extensions defined in config are resolved relative to the config file, not the working directory.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Replace const Linter = require('bpmnlint') with `import Linter from 'bpmnlint'`.","cause":"Using require() instead of import in an ESM-only package.","error":"Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'bpmnlint'"},{"fix":"Use default import from 'bpmnlint/lib/resolver/node-resolver': `import NodeResolver from 'bpmnlint/lib/resolver/node-resolver'`.","cause":"Importing NodeResolver as a named export from 'bpmnlint'.","error":"Cannot destructure property 'NodeResolver' of ... is not iterable"},{"fix":"Create a .bpmnlintrc file in your project root with at least `extends: 'bpmnlint:recommended'`.","cause":"Missing or misconfigured .bpmnlintrc file.","error":"No configuration found for bpmnlint"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}