Registry / testing / eslint-formatter-checkstyle

eslint-formatter-checkstyle

JSON →
library9.0.1jsnpmunverified

Standalone package extracted from ESLint's built-in checkstyle formatter. Current stable version is 9.0.1, compatible with ESLint 9+. Released as an official standalone package to allow external use without depending on the full ESLint library. Supports Node.js ^18.18.0 || ^20.9.0 || >=21.1.0. Unlike alternative checkstyle formatters from the community, this one is maintained by the ESLint team and ships TypeScript types. Release cadence follows ESLint's major releases as the formatter is derived from ESLint's source.

npm install eslint-formatter-checkstyle
INSTALL
IMPORT
SIG · ESLINT-FORMATTER-C
E
eslint-formatter-checkstyle
testingjavascriptv9.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.

default
import format from 'eslint-formatter-checkstyle'
import { format } from 'eslint-formatter-checkstyle'
The module exports a default function. Named export 'format' does not exist.
type LintResult
import type { LintResult } from 'eslint'
import { LintResult } from 'eslint-formatter-checkstyle'
TypeScript types for the results are not re-exported; use ESLint's types instead.
require (CommonJS)
const format = require('eslint-formatter-checkstyle')
const { format } = require('eslint-formatter-checkstyle')
CommonJS require returns the default export directly, not as named export.

Shows how to import and use the formatter with a sample ESLint results array.

import format from 'eslint-formatter-checkstyle'; const results = [ { filePath: 'foo.js', messages: [ { line: 5, column: 10, severity: 2, message: 'Unexpected foo.', ruleId: 'foo', }, ], errorCount: 1, warningCount: 0, fixableErrorCount: 0, fixableWarningCount: 0, }, ]; const output = format(results); console.log(output);
Debug
Known issues
breakingVersion 9.0.0+ only supports ESLint 9 and Node.js >=18.18.0, dropping support for older ESLint versions and Node.js 16.
fix
Upgrade to ESLint 9 and Node.js >=20.9.0, or stick to version 8.x for older environments.
affects: >=9.0.0
gotchaThe function expects results array with severity as number (2 for error, 1 for warning), not string.
fix
Use numeric severity values as per ESLint's LintResult type.
affects: >=1.0.0
gotchaThe module does not include the ESLint engine; it only formats the results. Run ESLint separately to get results.
fix
Use ESLint programmatic API or CLI to lint first, then pass the results to this formatter.
affects: >=1.0.0
Errors
Common errors & fixes
import { format } from 'eslint-formatter-checkstyle'; SyntaxError: Named export 'format' not found.
Trying to import a named export 'format' which does not exist; the module exports a default function.
fix
Use default import: import format from 'eslint-formatter-checkstyle'
const format = require('eslint-formatter-checkstyle'); format(results); TypeError: format is not a function
The require returns the module itself, but the default export is not automatically assigned if using a wrong destructuring.
fix
Use const format = require('eslint-formatter-checkstyle').default; or check your require cache.
Error: Cannot find module 'eslint-formatter-checkstyle'
Missing dependency or wrong package name.
fix
Run npm install eslint-formatter-checkstyle --save-dev and ensure the version matches your Node.js and ESLint.
Upgrade
Version history
9.0.1latest on npm
Audit
Dependencies
eslintoptionalThe formatter is designed to be used with ESLint, though it may work with other linting tools that output the same data structure.
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-formatter-checkstyle — npm install eslint-formatter-checkstyle · libregistry