bpmnlint-loader

raw JSON →
0.1.6 verified Sat Apr 25 auth: no javascript

Webpack loader that enables bundling bpmnlint configuration files (.bpmnlintrc) for use in browser builds. Requires bpmnlint as a peer dependency. Version 0.1.6 is the latest stable release, maintained by the bpmn-io organization. It seamlessly integrates with webpack to resolve and transpile config files, allowing linter instantiation in webpack bundles. Differentiators: simplifies client-side BPMN linting by leveraging webpack's module system.

error Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type.
cause Webpack does not recognize .bpmnlintrc files without the loader configured.
fix
Add the loader rule as shown in the quickstart.
gotcha Loader only works with bpmnlint config files that are valid JSON or JS export. Ensure the .bpmnlintrc file is parsable by bpmnlint.
fix Validate your .bpmnlintrc content against bpmnlint schema.
gotcha bpmnlint-loader does not validate the config; it only exports the parsed module. Errors in config will surface at runtime in bpmnlint.
fix Use bpmnlint's own validation or test configs separately.
npm install bpmnlint-loader
yarn add bpmnlint-loader
pnpm add bpmnlint-loader

Shows how to configure webpack to use bpmnlint-loader for .bpmnlintrc files and then import them for linter instantiation.

// webpack.config.js
module.exports = {
  module: {
    rules: [
      {
        test: /\.bpmnlintrc$/,
        use: ['bpmnlint-loader']
      }
    ]
  }
};

// Your source code
import { Linter } from 'bpmnlint';
import linterConfig from './.bpmnlintrc';
const linter = new Linter(linterConfig);