bpmn-io / bpmnlint

Validate BPMN diagrams based on configurable lint rules.
MIT License
123 stars 36 forks source link

Provide utils as main library export #16

Closed nikku closed 5 years ago

nikku commented 6 years ago

There is not much benefit of passing the utils into a rule factory when we could have a library utility export, too. The API would slightly simplify though, possibly making it easier for users to write rules.

Current Rule Layout

// some-rule.js
module.exports = (utils) => {
  return {
    check: (...) => {}
  };
};

Proposed Rule Layout

// some-rule-new.js
import { is } from 'bpmnlint-utils';

export default function() {
  ...
  return {
    check: ...
  };
}
nikku commented 5 years ago

Utils export is dropped from v5. Users should use the bpmnlint-utils package instead.