eslint-formatter-gcq
v0.0.4
Published
ESLint formatter for GitLab Code Quality
Downloads
132
Maintainers
Readme
eslint-formatter-gcq
An opinionated ESLint formatter that outputs GitLab Code Quality compatible JSON. It will always write a stylish formatted report to the terminal and JSON to the ESLint output.
Install
Install the package with your favorite package manager, example for NPM:
npm install -D eslint-formatter-gcq
Usage
Run ESLint with the -f (or --format) and -o (or --output) flags like so:
eslint -f gcq -o codequality.json
You can also use "eslint-formatter-gcq" as formatter name.
In GitLab CI
Add a lint script to your package.json:
{
"scripts": {
"lint": "eslint .",
}
}
Next, add a linting task to your gitlab-ci.yaml:
lint:
image: node:alpine
script:
- npm ci
- npm run lint -- -f gcq -o codequality.json|| true
artifacts:
reports:
codequality:
- codequality.json
And now you are ready to lint in CI!