Run ESLint and TypeScript in GitLab CI pipelines and generate a single code quality report.
npm install @agrodt/gitlab-cicqGitLab CICQ is a command-line tool that runs ESLint and TypeScript
checks and generates a single GitLab Code Quality
report in JSON format. It integrates easily into GitLab CI/CD pipelines for
automated code quality reporting.
- Run ESLint checks with optional file patterns.
- Run TypeScript type checks on specified directories.
- Generate a single GitLab-compatible Code Quality report.
- Configurable output path for reports.
- Optional --exit-0 mode to prevent failing CI pipelines.
- Node.js >= 22
- Optional: ESLint and TypeScript (if using --eslint or --typescript)
Install as a dev dependency:
``sh`
npm install -D @agrodt/gitlab-cicq
Run the CLI with the --help option to see available commands:
`
$ gitlab-cicq --help
Usage: gitlab-cicq [options]
Run ESLint and TypeScript checks and output GitLab Code Quality report
Options:
-V, --version output the version number
-e, --eslint [patterns...] run ESLint (defaults to all files when no patterns are given)
-t, --typescript [dirs...] run TypeScript checks (defaults to current directory when no dirs are given)
-o, --output
--exit-0 always exit with 0 (default: false)
-h, --help display help for command
`
Run ESLint on the src directory and TypeScript checks in the current
directory:
`sh`
gitlab-cicq --eslint src --typescript --output reports/codequality.json
Add the generated codequality.json report to your GitLab pipeline:
`yaml``
code_quality:
stage: test
script:
- npm install
- gitlab-cicq --eslint --typescript
artifacts:
reports:
codequality: codequality.json