Registry / devops / eslint-formatter-github-actions

eslint-formatter-github-actions

JSON →
library1.1.0jsnpmunverified

An ESLint formatter that outputs warnings and errors as GitHub Actions file annotations. Version 1.1.0 is the current stable release; relatively stable with infrequent updates. It leverages GitHub Actions' annotation syntax for inline problem reporting directly in pull request diffs. Unlike other formatters (e.g., stylish, compact), this one integrates tightly with CI workflows, supporting both warnings and errors and requiring no additional configuration beyond specifying the formatter name.

npm install eslint-formatter-github-actions
INSTALL
IMPORT
SIG · ESLINT-FORMATTER-G
E
eslint-formatter-github-actions
devopsjavascriptv1.1.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.

formatter
eslint -f github-actions
const formatter = require('eslint-formatter-github-actions')
The package is a formatter for ESLint CLI; no JavaScript import needed. Use the -f flag with the name 'github-actions'.
config
// .eslintrc.js module.exports = { formatter: 'github-actions' };
// .eslintrc.js module.exports = { formatter: require('eslint-formatter-github-actions') };
In config file, use string 'github-actions' not the module directly.
API usage
const { CLIEngine } = require('eslint'); const engine = new CLIEngine({ formatter: 'github-actions' });
const eslint = require('eslint-formatter-github-actions'); CLIEngine({ formatter: eslint });
When using ESLint API, set formatter option as string.

Installs the formatter, adds a lint script, and runs ESLint with GitHub Actions annotations.

npm install --save-dev eslint eslint-formatter-github-actions echo '{"scripts": {"lint": "eslint -f github-actions src/"}}' >> package.json npm run lint
Debug
Known issues
gotchaFormatter name must be 'github-actions' not 'eslint-formatter-github-actions'
fix
Use -f github-actions (the npm package name without the prefix).
affects: >=1.0.0
gotchaOutput only works in GitHub Actions environment; local runs produce empty output
fix
Use other formatters for local development; the formatter is designed for CI.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'eslint-formatter-github-actions'
Missing installation or incorrect formatter name
fix
Run 'npm install --save-dev eslint-formatter-github-actions' and use '-f github-actions'.
No output on local ESLint run
Formatter only produces annotations in GitHub Actions; no output in other environments
fix
Use a different formatter (e.g., stylish) for local runs.
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
eslint-formatter-github-actions — npm install eslint-formatter-github-actions · libregistry