Socket
Socket
Sign inDemoInstall

bpmnlint

Package Overview
Dependencies
3
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0-alpha1 to 1.0.0-alpha2

17

lib/linter.js

@@ -1,3 +0,1 @@

const path = require("path");
const testRule = require("./testRule");

@@ -11,2 +9,4 @@ const utils = require("./utils");

require("../rules/bpmnlint-label-required");
/**

@@ -18,4 +18,3 @@ * Applies a rule on the moddleRoot and adds reports to the finalReport

*/
function applyRule({ moddleRoot, ruleName, ruleFlagIdx, rulePath }) {
const rule = require("../rules/bpmnlint-label-required")(utils);
function applyRule({ moddleRoot, ruleFlagIdx, rule }) {
const flagName = flagsMap[ruleFlagIdx];

@@ -35,13 +34,13 @@ let reports = [];

Object.entries(config).forEach(([ruleName, value]) => {
let rulePath, ruleFlagIdx;
let rule, ruleFlagIdx;
if (typeof value === "object" && value !== null) {
rulePath = value.path;
rule = require(value.path)(utils);
ruleFlagIdx = value.flag;
} else {
try {
rulePath = require.resolve(`../rules/bpmnlint-${ruleName}`);
rule = require(`../rules/bpmnlint-${ruleName}`)(utils);
} catch (e) {
try {
rulePath = require.resolve(`bpmnlint-${ruleName}`);
rule = require(`../../bpmnlint-${ruleName}/index.js`)(utils);
} catch (e) {

@@ -55,3 +54,3 @@ console.error(`Couldn't find path to rule ${ruleName}.`);

const [flagName, reports] = Object.entries(
applyRule({ moddleRoot, ruleName, ruleFlagIdx, rulePath })
applyRule({ moddleRoot, ruleFlagIdx, rule })
)[0];

@@ -58,0 +57,0 @@

{
"name": "bpmnlint",
"version": "1.0.0-alpha1",
"version": "1.0.0-alpha2",
"main": "index.js",

@@ -5,0 +5,0 @@ "repository": "https://github.com/siffogh/bpmnlint/",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc