eslint-formatter-gitlab
TypeScript icon, indicating that this package has built-in type declarations

5.1.0 • Public • Published

ESLint Formatter for GitLab

Show ESLint results directly in the GitLab code quality results.

Table of Contents

Requirements

This package requires at least Node.js 18 and ESLint 5.

Installation

Install eslint and eslint-formatter-gitlab using your package manager.

npm install --save-dev eslint eslint-formatter-gitlab

Usage

Define a GitLab job to run eslint.

.gitlab-ci.yml:

eslint:
  image: node:20-alpine
  script:
    - npm ci
    - npx eslint --format gitlab .
  artifacts:
    reports:
      codequality: gl-codequality.json

The formatter automatically detects a GitLab CI environment. It detects where to output the code quality report based on the GitLab configuration file.

Example

An example of the results can be seen in Merge Request !1 of eslint-formatter-gitlab itself.

Configuration

ESLint formatters don’t take any configuration options. eslint-formatter-gitlab uses GitLab’s predefined environment variables to configure the output. In addition, the environment variable ESLINT_CODE_QUALITY_REPORT is used to override the location to store the code quality report.

License

MIT © Remco Haszing

Package Sidebar

Install

npm i eslint-formatter-gitlab

Weekly Downloads

142,018

Version

5.1.0

License

MIT

Unpacked Size

12.8 kB

Total Files

6

Last publish

Collaborators

  • remcohaszing