Other CI providers
The GitHub Action handles comments and commit statuses, so it only runs on GitHub. The scanner itself is a CLI, so it runs on any provider: GitLab CI, CircleCI, Jenkins, Buildkite, or a plain script.
Exit codes
By default, React Doctor exits 1 for blocking issues and 0 otherwise. Use --warning-exit-code to give non-blocking warnings a separate status. See the GitLab warning status example.
# Scan the whole project. Fails the job on error-level issues (the default).
npx react-doctor@latest .Useful flags
| Flag | Description |
|---|---|
--blocking <level> | Level that exits |
--scope <value> | Choose |
--project <name> | In a monorepo, scan only certain project(s), comma-separated |
--json | Print a JSON report instead of text, for processing |
See the CLI reference for the full list.
GitLab CI
Generate a gate-only GitLab CI scaffold:
npx react-doctor@latest ci install --provider gitlab-ciYou can also add the job manually:
react-doctor:
image: node:24
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
script:
# Only scan files changed against the target branch.
- npx react-doctor@latest . --scope changed --base "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" --blocking errorIf the job exits non-zero, the pipeline fails. That is the same gate as the GitHub Action, without the comments.
GitLab warning status
For a GitLab warning status without blocking a merge, use a separate warning exit code:
react-doctor:
image: node:24
script:
- npx react-doctor@latest . --warning-exit-code 123
allow_failure:
exit_codes: 123With the default --blocking error, this example uses these exit codes:
1for errors and hard lint failures.123for warnings.0for clean scans.
The warning code must be an integer from 2 to 255. Without --warning-exit-code, warnings exit with 0.
--blocking warning takes priority and exits with 1 for warnings. --blocking none disables the warning exit code. Score-only mode and degraded baseline comparisons also skip the warning exit code.
Warning filters and ciFailure surface settings still apply.
CircleCI, Jenkins, and Buildkite
Run npx react-doctor@latest in a Node 24 step. The exit code determines whether the step passes or fails.