Skip to content

Use in CI

jscycles fails the build when it finds cycles (status 1) or cannot complete the scan (status 2).

If the project already installs jscycles from npm:

- run: npx jscycles

Or download a verified release binary, with no Node.js needed:

- name: Check for circular imports
run: |
version=v0.2.0
base=https://github.com/ALMaclaine/jscycles/releases/download/$version
curl -sSfLO "$base/jscycles-linux-x86_64"
curl -sSfLO "$base/SHA256SUMS"
sha256sum --check --ignore-missing SHA256SUMS
chmod +x jscycles-linux-x86_64
./jscycles-linux-x86_64

Start with --only or --exclude for the packages that are clean, or with --outer for package cycles only, and widen the check as cycles are fixed.

With pre-commit, using a binary on PATH:

repos:
- repo: local
hooks:
- id: jscycles
name: jscycles
entry: jscycles --quiet
language: system
pass_filenames: false
types_or: [javascript, jsx, ts, tsx]

--json prints a stable report for other tools; see output and JSON. Always check the exit status before trusting a report.