https://github.com/nielsvanvelzen/eslint-formatter-gcq
ESLint formatter for GitLab Code Quality
https://github.com/nielsvanvelzen/eslint-formatter-gcq
code-quality codeclimate eslint eslint-formatter eslintformatter gitlab gitlab-code-quality
Last synced: about 1 month ago
JSON representation
ESLint formatter for GitLab Code Quality
- Host: GitHub
- URL: https://github.com/nielsvanvelzen/eslint-formatter-gcq
- Owner: nielsvanvelzen
- License: mit
- Created: 2023-12-19T09:14:33.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-12-19T10:24:04.000Z (over 1 year ago)
- Last Synced: 2024-05-01T14:53:49.543Z (12 months ago)
- Topics: code-quality, codeclimate, eslint, eslint-formatter, eslintformatter, gitlab, gitlab-code-quality
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/eslint-formatter-gcq
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eslint-formatter-gcq
An opinionated ESLint formatter that outputs [GitLab Code Quality compatible JSON](https://docs.gitlab.com/ee/ci/testing/code_quality.html#implement-a-custom-tool).
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:
```shell
npm install -D eslint-formatter-gcq
```## Usage
Run ESLint with the -f (or --format) and -o (or --output) flags like so:
```shell
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:
```json
{
"scripts": {
"lint": "eslint .",
}
}```
Next, add a linting task to your gitlab-ci.yaml:
```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!