Registry / devops / eslint-formatter-github-annotations

eslint-formatter-github-annotations

JSON →
library0.1.0jsnpmunverified

An ESLint formatter that outputs lint results as GitHub Checks annotations, enabling inline code annotations in GitHub Actions pull request checks. Version 0.1.0, released as an early-stage package with no reported release cadence. Unlike other ESLint formatters (e.g., json, stylish), this one specifically targets CI integration with GitHub Actions to display warnings/errors directly in pull request diffs. It supports reporting multiple messages per file and uses the standard ESLint formatter API. Potential alternative: @eslint/skip-annotations is more mature but limited to specific use cases.

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

default
import formatter from 'eslint-formatter-github-annotations'
const formatter = require('eslint-formatter-github-annotations')
ESM only; CommonJS require() fails. Use import statement.
github-annotations
npx eslint -f github-annotations .
npx eslint -f eslint-formatter-github-annotations .
The formatter name is 'github-annotations' (not the package name). Use -f github-annotations.
formatter
const formatter = await import('eslint-formatter-github-annotations')
const formatter = require('eslint-formatter-github-annotations')
Dynamic import in ESM; CommonJS require() throws error.

An example package.json configuration to run ESLint with the GitHub annotations formatter, which will produce annotations in GitHub Actions logs.

{ "name": "example-lint", "version": "1.0.0", "scripts": { "lint": "eslint -f github-annotations ." }, "devDependencies": { "eslint": "^8.0.0", "eslint-formatter-github-annotations": "^0.1.0" } }
Debug
Known issues
gotchaThe formatter name is 'github-annotations', not the package name. Using -f eslint-formatter-github-annotations will fail.
fix
Use -f github-annotations when running ESLint.
affects: >=0.1.0
breakingThis package is ESM-only. Attempting to require() it in CommonJS will throw an error.
fix
Use import or dynamic import. If using CommonJS, consider switching to ESM or using a bundler.
affects: >=0.1.0
gotchaRunning this formatter outside of a GitHub Actions environment may produce no output or unexpected results, as it relies on GitHub-specific annotation format.
fix
Only use this formatter in GitHub Actions workflows. For local development, use another formatter like 'stylish'.
affects: >=0.1.0
gotchaESLint must be present as a peer dependency. If ESLint is not installed, the formatter will fail to load.
fix
Ensure eslint is in devDependencies. Install with npm install --save-dev eslint.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'eslint-formatter-github-annotations'
The package is not installed or ESLint cannot locate it.
fix
Run npm install --save-dev eslint-formatter-github-annotations. Ensure node_modules is correct.
Error: Invalid formatter 'eslint-formatter-github-annotations'
Using the package name as formatter name; correct name is 'github-annotations'.
fix
Change -f flag to -f github-annotations.
TypeError: (0 , _default) is not a function
CommonJS require() used with an ESM-only package.
fix
Use import or dynamic import instead of require().
Warning: No annotations were generated
ESLint found no errors/warnings, or running outside GitHub Actions.
fix
Ensure there are lint issues and run in a GitHub Actions workflow.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies
eslintrequiredPeer dependency required to use the formatter. The formatter is an ESLint plugin and will not work without ESLint installed.
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-formatter-github-annotations — npm install eslint-formatter-github-annotations · libregistry