eslint-formatter-gcq

0.0.3 • Public • Published

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!

Package Sidebar

Install

npm i eslint-formatter-gcq

Weekly Downloads

41

Version

0.0.3

License

MIT

Unpacked Size

5.4 kB

Total Files

5

Last publish

Collaborators

  • nielsvanvelzen