Registry / testing / stylelint-formatter-github

stylelint-formatter-github

JSON →
library1.0.1jsnpmunverified

A stylelint formatter that outputs lint results as GitHub Annotations, enabling error and warning messages to appear directly in GitHub pull request diffs and checks. Version 1.0.1 requires stylelint >= 10 and Node.js >= 10.x. It integrates seamlessly with GitHub Actions CI, providing immediate inline feedback without manual log parsing. Unlike JSON or verbose formatters, this creates machine-readable annotation objects that GitHub surfaces in the UI. Release cadence is low; the package is stable and feature-complete. It is the standard formatter for stylelint usage in GitHub Actions workflows.

npm install stylelint-formatter-github
INSTALL
IMPORT
SIG · STYLELINT-FORMATTE
S
stylelint-formatter-github
testingjavascriptv1.0.1
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
import formatter from 'stylelint-formatter-github'
const formatter = require('stylelint-formatter-github')
ESM export is default. CommonJS require works if the consumer's project supports it, but it is not the primary format.

Configures stylelint to use GitHub annotations formatter and runs linting on CSS files.

// .stylelintrc.js module.exports = { extends: 'stylelint-config-standard', formatter: 'stylelint-formatter-github', }; // In package.json scripts: "lint": "stylelint 'src/**/*.css'" // Or via CLI directly: // stylelint --custom-formatter ./node_modules/stylelint-formatter-github 'src/**/*.css'
Debug
Known issues
gotchaFormatter only works within GitHub Actions or GitHub API environment. It will produce no visible output if run locally.
fix
Use a different formatter (e.g., 'verbose') for local runs, or check CI environment variable.
affects: >=0.0.0
breakingVersion 1.0.0 removed support for Node.js < 10.
fix
Update Node.js to >=10, or stick with older package versions.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Could not find formatter 'stylelint-formatter-github'
Package not installed or not resolved from config file location.
fix
Run 'npm install --save-dev stylelint-formatter-github' and ensure node_modules path is correct.
Error: Cannot find module 'stylelint-formatter-github'
CommonJS require fails in an ESM-only context or due to missing peer dependency.
fix
Use dynamic import: 'import('stylelint-formatter-github')' or install stylelint as a dependency.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
stylelintrequiredPeer dependency: formatter is plugged into stylelint
Agent activity
11 hits · last 30 days
node
8
Resources
stylelint-formatter-github — npm install stylelint-formatter-github · libregistry