Skip to content

Instantly share code, notes, and snippets.

@sverweij
Last active July 22, 2018 11:53
Show Gist options
  • Save sverweij/85645d8151b1313d6379886976dd5956 to your computer and use it in GitHub Desktop.
Save sverweij/85645d8151b1313d6379886976dd5956 to your computer and use it in GitHub Desktop.
dependency-cruiser config with only a circular dependency check
{
"forbidden": [{
"name": "no-circular",
"severity": "error",
"from": {},
"to": { "circular": true }
}],
"options": {
"doNotFollow": "node_modules"
}
}

Use like so:

depcruise -v .dependency-cruiser.circular-only.json src

Sample output:

  error no-circular: src/extract/circle-one.js → src/extract/circle-two.js
  error no-circular: src/extract/circle-three.js → src/extract/circle-one.js
  error no-circular: src/extract/circle-two.js → src/extract/circle-three.js
  error no-circular: src/extract/circular.js → src/extract//ralucric.js
  error no-circular: src/extract/ralucric.js → src/extract/circular.js

✖ 5 dependency violations (5 errors, 0 warnings). 342 modules cruised.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment