ESLint formatter (v2.0.1) that generates GitHub Actions annotations for linting errors and warnings, enabling inline code annotations in pull request diffs and checks. When run outside a GitHub Actions environment, it falls back to ESLint's built-in stylish formatter. Optionally outputs JSON for SonarCloud integration. Includes TypeScript type definitions. Compatible with ESLint 8 and 9 (flat config).
npm install eslint-formatter-ghaVerified import paths — ran on the pinned version, not inferred.
Shows CLI usage and programmatic usage with ESM import, linting a directory and formatting results.
Use `-f gha` in CLI or set formatter to 'eslint-formatter-gha' in config.
Ensure GITHUB_ACTIONS=true is set in your GitHub Actions workflow; for other CI, consider a different formatter.
Set SONARSCANNER only when intended; handle file writes carefully.
Run `npm install --save-dev eslint-formatter-gha`.
Use `-f gha` instead of `-f eslint-formatter-gha`.
Use dynamic import: `const ghaFormatter = await import('eslint-formatter-gha')` or switch to ESM imports.No dependency data recorded yet.