Registry / testing / stylelint-checkstyle-formatter

stylelint-checkstyle-formatter

JSON →
library0.1.2jsnpmunverified

A custom formatter for stylelint that outputs lint results in Checkstyle XML format. Version 0.1.2 is the latest stable release; the package has not been updated since 2017. It is designed for CI/CD pipelines, particularly with Jenkins' Checkstyle Plugin. Key differentiator: converts stylelint output to Checkstyle XML for compatibility with tools expecting that format. No dependencies beyond stylelint.

npm install stylelint-checkstyle-formatter
INSTALL
IMPORT
SIG · STYLELINT-CHECKSTY
S
stylelint-checkstyle-formatter
testingjavascriptv0.1.2
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-checkstyle-formatter')
import formatter from 'stylelint-checkstyle-formatter'
CJS-only; ESM import may fail or require .default. No TypeScript types.
checkstyleFormatter
const checkstyleFormatter = require('stylelint-checkstyle-formatter')
No named export; default export is the formatter function.
formatter
const formatter = require('stylelint-checkstyle-formatter')
import { formatter } from 'stylelint-checkstyle-formatter'
CommonJS module does not have a named 'formatter' export.

Shows using the checkstyle formatter with stylelint's programmatic API.

const stylelint = require('stylelint'); const formatter = require('stylelint-checkstyle-formatter'); stylelint.lint({ files: 'src/**/*.css', config: { rules: { 'block-no-empty': true, } }, formatter }).then(result => { console.log(result.output); }).catch(err => { console.error(err); });
Debug
Known issues
deprecatedThis package is no longer maintained. Stylelint now includes built-in formatters, including checkstyle.
fix
Use stylelint's built-in 'checkstyle' formatter: --custom-formatter=stylelint-checkstyle-formatter or in config: formatter: 'checkstyle'.
affects: *
gotchaThe formatter is CommonJS-only. Using ES module imports may fail.
fix
Use require() instead of import. If using ESM, use createRequire or dynamic import.
affects: *
gotchaNo TypeScript type definitions available.
fix
Define custom types or use @ts-ignore.
affects: *
Errors
Common errors & fixes
Cannot find module 'stylelint-checkstyle-formatter'
Package not installed or missing from node_modules.
fix
npm install stylelint-checkstyle-formatter --save-dev
TypeError: formatter is not a function
Incorrect import: using named import on default CommonJS export.
fix
const formatter = require('stylelint-checkstyle-formatter');
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies
stylelintoptionalpeer dependency; the formatter is used with stylelint
Agent activity
6 hits · last 30 days
node
6
Resources
stylelint-checkstyle-formatter — npm install stylelint-checkstyle-formatter · libregistry