Registry / devops / stylelint-formatter-github-checks

stylelint-formatter-github-checks

JSON →
library1.0.0jsnpmunverified

A Stylelint formatter that outputs JSON structured for the GitHub Checks API 'Update a check run' endpoint. Current stable version 1.0.0. No release cadence noted (single release). Key differentiator: enables GitHub Checks annotations directly from Stylelint output, forked from eslint-formatter-github-checks. Requires Node ^14. Minimal dependencies, no runtime deps. Use case: CI pipelines posting Stylelint results as GitHub Check annotations.

npm install stylelint-formatter-github-checks
INSTALL
IMPORT
SIG · STYLELINT-FORMATTE
S
stylelint-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.

default
const formatter = require('stylelint-formatter-github-checks')
import formatter from 'stylelint-formatter-github-checks'
Package is CommonJS only; ESM import will fail without CJS interop.
formatter function
const formatter = require('stylelint-formatter-github-checks')
const { default: formatter } = require('stylelint-formatter-github-checks')
The module exports the formatter directly, not as named export.
usage via CLI
stylelint "*.css" --custom-formatter=./node_modules/stylelint-formatter-github-checks
stylelint "*.css" --formatter=github-checks
Must use --custom-formatter with full path; built-in --formatter does not support this package.

Demonstrates installation and usage via CLI and programmatically with Node.js CJS.

// Install package // npm install --save-dev stylelint-formatter-github-checks // Use via CLI: // stylelint "*.css" --custom-formatter=node_modules/stylelint-formatter-github-checks // Or programmatically: const stylelint = require('stylelint'); const formatter = require('stylelint-formatter-github-checks'); async function lint() { const result = await stylelint.lint({ files: '*.css', customFormatter: formatter }); console.log(JSON.stringify(result.output)); // outputs GitHub Checks payload } lint();
Debug
Known issues
gotchaMust use --custom-formatter CLI flag; --formatter (built-in) does not accept third-party formatters.
fix
Use --custom-formatter=node_modules/stylelint-formatter-github-checks instead of --formatter.
affects: >=1.0.0
deprecatedNode ^14 engine constraint; not compatible with Node <14.
fix
Upgrade Node.js to version ^14 or use a different formatter.
affects: >=1.0.0
gotchaPackage is CommonJS only; ESM imports (import statement) will fail without proper handling.
fix
Use require() or configure bundler to handle CJS.
affects: >=1.0.0
gotchaOutput JSON is specific to GitHub Checks API; not compatible with other reporters.
fix
Do not use if not integrating with GitHub Checks API; use default Stylelint formatter instead.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: formatter is not a function
Using import statement which returns a module object instead of the default export.
fix
Use const formatter = require('stylelint-formatter-github-checks') instead of import.
Error: Unknown formatter 'github-checks'
Using --formatter instead of --custom-formatter flag.
fix
Use --custom-formatter=./node_modules/stylelint-formatter-github-checks
SyntaxError: Cannot use import statement outside a module
Using import in a CommonJS context without ESM support.
fix
Use require() or add "type": "module" to package.json.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

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