Registry / testing / dmnlint

dmnlint

JSON →
library0.2.0jsnpmunverified

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.

npm install dmnlint
INSTALL
IMPORT
SIG · DMNLINT
D
dmnlint
testingjavascriptv0.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default export (linter instance)
import Linter from 'dmnlint';
const Linter = require('dmnlint');
ESM default import; CommonJS require() works but is not recommended.
Linter class
import { Linter } from 'dmnlint';
Named export also available if needed.
Configuration type (TypeScript)
import type { DMNLintConfig } from 'dmnlint';
TypeScript users should import types when not using at runtime.

Shows how to import and use dmnlint programmatically, including loading a DMN file, linting with default rules, and passing custom configuration.

import Linter from 'dmnlint'; import { readFileSync } from 'fs'; const dmnXml = readFileSync('invoice.dmn', 'utf-8'); const linter = new Linter(); // Simple usage with default rules linter.lint(dmnXml).then(results => { console.log(JSON.stringify(results, null, 2)); }); // With configuration const config = { extends: 'dmnlint:recommended', rules: { 'label-required': 'off', }, }; linter.lint(dmnXml, config).then(results => { if (results.length > 0) { results.forEach(r => console.error(`${r.id} - ${r.message}`)); } });
dmnlint --version
Debug
Known issues
gotchaThe linter expects valid DMN XML; any parse error will throw a synchronous exception before the async lint operation.
fix
Wrap in try-catch for synchronous parsing errors.
affects: >=0.1.0
gotchaConfiguration file (.dmnlintrc) must be in JSON format; other formats are not supported.
fix
Convert configuration to JSON.
affects: >=0.1.0
gotchaCustom rules must be exported as a function that returns an object with rule definitions; see documentation.
fix
Follow the plugin example structure.
affects: >=0.1.0
deprecatedUsing 'require' with default import may lead to CommonJS/ESM interop issues.
fix
Use import syntax or dynamic import() if needed.
affects: >=0.1.0
Errors
Common errors & fixes
Error: No such file or directory: .dmnlintrc
Missing configuration file at working directory.
fix
Create a .dmnlintrc file or use programmatic config.
Error: Could not find rule: label-required
Rule name misspelled or not installed/loaded.
fix
Check rule name; ensure rules are available via extends or plugin.
TypeError: Linter is not a constructor
Using import incorrectly (e.g., destructuring default import).
fix
Use: import Linter from 'dmnlint';
SyntaxError: Unexpected token } in JSON at position 20
Invalid JSON in .dmnlintrc file.
fix
Fix JSON syntax with a linter or validator.
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies
dmn-moddlerequiredParses DMN XML into a model object graph for rule checking
min-dashrequiredUtility library used for object and array operations
Agent activity
13 hits · last 30 days
node
12
Amazon
1
Resources
dmnlint — npm install dmnlint · libregistry