{"id":25175,"library":"dmnlint","title":"dmnlint","description":"A configurable linter for DMN (Decision Model and Notation) diagrams that checks against a set of rules to ensure quality and consistency. Version 0.2.0 is the current stable release, with ongoing development on GitHub. It provides CLI usage and supports integration with dmn-js for visual feedback during modeling. Key differentiators: based on bpmnlint architecture, supports custom rules via plugins and configuration through .dmnlintrc files.","status":"active","version":"0.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/bpmn-io/dmnlint","tags":["javascript","dmnlint","dmn","linter","cli","validation","rules"],"install":[{"cmd":"npm install dmnlint","lang":"bash","label":"npm"},{"cmd":"yarn add dmnlint","lang":"bash","label":"yarn"},{"cmd":"pnpm add dmnlint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Parses DMN XML into a model object graph for rule checking","package":"dmn-moddle","optional":false},{"reason":"Utility library used for object and array operations","package":"min-dash","optional":false}],"imports":[{"note":"ESM default import; CommonJS require() works but is not recommended.","wrong":"const Linter = require('dmnlint');","symbol":"default export (linter instance)","correct":"import Linter from 'dmnlint';"},{"note":"Named export also available if needed.","wrong":"","symbol":"Linter class","correct":"import { Linter } from 'dmnlint';"},{"note":"TypeScript users should import types when not using at runtime.","wrong":"","symbol":"Configuration type (TypeScript)","correct":"import type { DMNLintConfig } from 'dmnlint';"}],"quickstart":{"code":"import Linter from 'dmnlint';\nimport { readFileSync } from 'fs';\n\nconst dmnXml = readFileSync('invoice.dmn', 'utf-8');\nconst linter = new Linter();\n\n// Simple usage with default rules\nlinter.lint(dmnXml).then(results => {\n  console.log(JSON.stringify(results, null, 2));\n});\n\n// With configuration\nconst config = {\n  extends: 'dmnlint:recommended',\n  rules: {\n    'label-required': 'off',\n  },\n};\nlinter.lint(dmnXml, config).then(results => {\n  if (results.length > 0) {\n    results.forEach(r => console.error(`${r.id} - ${r.message}`));\n  }\n});","lang":"typescript","description":"Shows how to import and use dmnlint programmatically, including loading a DMN file, linting with default rules, and passing custom configuration."},"warnings":[{"fix":"Wrap in try-catch for synchronous parsing errors.","message":"The linter expects valid DMN XML; any parse error will throw a synchronous exception before the async lint operation.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Convert configuration to JSON.","message":"Configuration file (.dmnlintrc) must be in JSON format; other formats are not supported.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Follow the plugin example structure.","message":"Custom rules must be exported as a function that returns an object with rule definitions; see documentation.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use import syntax or dynamic import() if needed.","message":"Using 'require' with default import may lead to CommonJS/ESM interop issues.","severity":"deprecated","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Create a .dmnlintrc file or use programmatic config.","cause":"Missing configuration file at working directory.","error":"Error: No such file or directory: .dmnlintrc"},{"fix":"Check rule name; ensure rules are available via extends or plugin.","cause":"Rule name misspelled or not installed/loaded.","error":"Error: Could not find rule: label-required"},{"fix":"Use: import Linter from 'dmnlint';","cause":"Using import incorrectly (e.g., destructuring default import).","error":"TypeError: Linter is not a constructor"},{"fix":"Fix JSON syntax with a linter or validator.","cause":"Invalid JSON in .dmnlintrc file.","error":"SyntaxError: Unexpected token } in JSON at position 20"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}