Skip to content

ver0-project/eslint-formatter-gha

Repository files navigation

@ver0/eslint-formatter-gha

NPM Version NPM Downloads Dependents (via libraries.io), scoped npm package GitHub Actions Workflow Status


✍️ ESLint formatter for GitHub Actions - displays linting errors as GitHub Actions annotations

Features

  • Seamlessly converts ESLint results into GitHub Actions annotations
  • Properly formats errors, warnings, and notices based on ESLint severity levels
  • Shows rule IDs alongside error messages

Install

This package can be installed with npm, yarn, or pnpm:

# Using yarn
yarn add -D @ver0/eslint-formatter-gha

# Using npm
npm install --save-dev @ver0/eslint-formatter-gha

# Using pnpm
pnpm add -D @ver0/eslint-formatter-gha

Usage

Command Line

eslint -f @ver0/gha

In GitHub Actions Workflow

- name: Lint
  run: npx eslint . -f @ver0/gha

How It Works

This formatter converts ESLint results into GitHub Actions annotations using the @actions/core library. It maps ESLint severity levels to corresponding GitHub annotation types:

  • Severity 0 → Notice
  • Severity 1 → Warning
  • Severity 2 → Error

Requirements

  • Node.js >=18
  • ESLint

License

MIT