Hacker News new | ask | show | jobs
by pc2g4d 1400 days ago
I've been using DPDM: https://github.com/acrazing/dpdm

These are my package.json scripts for detecting cycles:

  "cycles": "run-p cycles:client cycles:server",
  "cycles:client": "dpdm client/src/\*/\*.ts --exit-code circular:1",
  "cycles:server": "dpdm server/src/server.ts --exit-code circular:1",
The exit code is set like that so that the CI will fail on cycles, since we run this in our CI build.

I also hear people use ESLint, probably this: https://github.com/import-js/eslint-plugin-import/blob/main/...

The fact that the compiler itself doesn't error on cycle imports, and that the errors caused by those imports are so opaque, seems like an oversight to me.