- 🐣 return all found violations on a dependency instead of only one (issue #40 thanks @ajafff again for reporting!, PR #41)
This goes for both the internal API and theerr
andjson
reporters. To accommodate this each 'invalid' dependency'srule
(with only one rule) was replaced with arules
section with an array of violated rules.
API change
before
{
"source": "node_modules/somemodule/src/somemodule.js",
"dependencies": [
{
"module": "./moar-javascript",
"resolved": "node_modules/somemodule/src/moar-javascript.js",
"moduleSystem": "cjs",
"coreModule": false,
"followable": true,
"valid": false,
"rule": {
"severity": "warn",
"name": "my-cool-rule"
}
},
...
]
},
...
after
{
"source": "node_modules/somemodule/src/somemodule.js",
"dependencies": [
{
"module": "./moar-javascript",
"resolved": "node_modules/somemodule/src/moar-javascript.js",
"moduleSystem": "cjs",
"coreModule": false,
"followable": true,
"valid": false,
"rules": [{
"severity": "warn",
"name": "my-cool-rule"
},
{
"severity": "error",
"name": "not-in-allowed"
}]
},
...
]
},
...