dependency-cruiser
Version:
Validate and visualize javascript dependencies. With your rules. ES6, CommonJS, AMD
45 lines (44 loc) • 1.52 kB
JSON
{
"allowed": [{
"from": { "path": "^(src|test)" },
"to": { "path": "^(src|node_modules)" }
}, {
"comment": "because these core modules make sense here",
"from": { "path": "^(src|test)" },
"to": { "path": "^(fs|path)$" }
}, {
"from": { "path": "^bin" },
"to": { "path": "^src/index\\.js" }
}, {
"from": { "path": "^src/index\\.js" },
"to": { "path": "^package\\.json$" }
}, {
"comment": "node_modules may depend core modules",
"from": { "path": "^node_modules" },
"to": { "coreModule": false }
}, {
"comment": "node_modules may depend on node_modules",
"from": { "path": "^node_modules" },
"to": { "path": "^node_modules" }
}, {
"from": { "path": "^test" },
"to": { "path": "^test" }
}],
"forbidden": [{
"name": "no-dep-on-test",
"severity": "error",
"from": { "path": "^src" },
"to": { "path": "^test" }
}, {
"name": "no-external-to-here",
"comment": "you never know...",
"severity": "info",
"from": { "path": "node_modules" },
"to": { "path": "^(src|test|lib)" }
}, {
"name": "not-to-unresolvable",
"severity": "error",
"from": { },
"to": { "couldNotResolve": true }
}]
}