Registry / devops / eslint-formatter-github-checks

eslint-formatter-github-checks

JSON →
library1.0.0jsnpmunverified

An ESLint formatter that outputs JSON conforming to the GitHub Checks API 'Update a check run' endpoint. Version 1.0.0, no clear release cadence. Key differentiator: designed for GitHub Actions CI, producing structured output that integrates with GitHub Checks summaries. Alternative to standard ESLint formatters for CI pipelines.

npm install eslint-formatter-github-checks
INSTALL
IMPORT
SIG · ESLINT-FORMATTER-G
E
eslint-formatter-github-checks
devopsjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

eslint-formatter-github-checks
npx eslint --format github-checks <files>
eslint --format eslint-formatter-github-checks <files>
Use the package name without 'eslint-formatter-' prefix if you want the short form 'github-checks'.
require('eslint-formatter-github-checks')
const formatter = await import('eslint-formatter-github-checks');
const formatter = require('eslint-formatter-github-checks');
ESM only (package type module). Node >=14 required.

Shows how to run ESLint with the github-checks formatter in a GitHub Actions workflow, outputting JSON for the Checks API.

// Run ESLint in a GitHub Actions workflow: steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version: '16' - run: npm ci - run: npx eslint --format github-checks src/ | node -e " const fs = require('fs'); const data = fs.readFileSync('/dev/stdin', 'utf8'); const results = JSON.parse(data); console.log(JSON.stringify(results, null, 2)); "
Debug
Known issues
gotchaFormatter output is only valid for 'Update a check run' API when sent as 'output' with summary and annotations.
fix
Use the output in a GitHub Actions step with actions/github-script or similar to call the API.
affects: >=1.0.0
gotchaRequires Node >=14 due to ESM module type.
fix
Ensure your CI environment uses Node 14+.
affects: >=1.0.0
gotchaThe formatter expects ESLint to be run on files that exist; running on stdin may produce unexpected results.
fix
Always provide file path(s) to ESLint.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'eslint-formatter-github-checks'
Package not installed or not in node_modules.
fix
Run 'npm install eslint-formatter-github-checks --save-dev'
TypeError: formatter is not a function
Using require() on an ESM-only package.
fix
Use dynamic import() or change to 'type': 'module' in package.json.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
eslintrequiredPeer dependency; used as a formatter plugin for ESLint.
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-formatter-github-checks — npm install eslint-formatter-github-checks · libregistry