Registry / devops / eslint-formatter-jslint-xml

eslint-formatter-jslint-xml

JSON →
library9.0.1jsnpmunverified

Standalone ESLint formatter that outputs JSLint-compatible XML for integration with CI/CD pipelines or Jenkins. Current stable version is 9.0.1, maintained by Fregante. This package is part of a collection of standalone ESLint formatters, offering lightweight extraction without depending on ESLint's full packages. No release cadence specified; library is released alongside ESLint major versions. Differentiators: zero dependencies, ships TypeScript types, supports Node 18+. Works exclusively with ESLint >=9 (flat config only).

npm install eslint-formatter-jslint-xml
INSTALL
IMPORT
SIG · ESLINT-FORMATTER-J
E
eslint-formatter-jslint-xml
devopsjavascriptv9.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.

eslintFormatterJslintXml
import eslintFormatterJslintXml from 'eslint-formatter-jslint-xml'
import { eslintFormatterJslintXml } from 'eslint-formatter-jslint-xml'
The module exports a default function; named export does not exist.
eslintFormatterJslintXml
const eslintFormatterJslintXml = require('eslint-formatter-jslint-xml')
CJS require is allowed but deprecated; prefer ESM imports.
type FormatterFunction
import type { FormatterFunction } from 'eslint-formatter-jslint-xml'
import { FormatterFunction } from 'eslint-formatter-jslint-xml'
TypeScript users: type-only export. Not available in CJS.

Demonstrates using the formatter with ESLint's flat config (ESLint >=9). Lints files and outputs JSLint XML.

import eslintFormatterJslintXml from 'eslint-formatter-jslint-xml'; import { ESLint } from 'eslint'; const eslint = new ESLint(); const results = await eslint.lintFiles(['src/**/*.js']); const xml = eslintFormatterJslintXml(results, results[0]?.filePath); console.log(xml);
Debug
Known issues
breakingESLint flat config required: ".eslintrc.*" files are ignored in ESLint 9+. Use eslint.config.js.
fix
Create eslint.config.js (or .mjs/.cjs) and ensure eslint >=9.
affects: >=9
deprecatedCommonJS require() is deprecated for this package. Prefer ESM import.
fix
Use 'import eslintFormatterJslintXml from \'eslint-formatter-jslint-xml\'' in ESM context.
affects: >=9
gotchaSecond argument to formatter is the file path, not options. Passing wrong type may produce empty <file> elements.
fix
Ensure second argument is a string (file path) or undefined. For results from multiple files, pass the results array directly and don't pass a second argument for aggregated output.
affects: >=9
gotchaOutput XML may contain fatal errors with missing 'line' or 'char' attributes. Some parsers may reject this.
fix
Handle XML parsing carefully; expect optional attributes on <issue> for fatal errors.
affects: >=9
gotchaFormatter does not escape XML special characters in reason/evidence fields. This can produce invalid XML if lint messages contain <>&.
fix
Sanitize lint messages manually if needed. The issue is present in upstream ESLint as well.
affects: >=8
Errors
Common errors & fixes
Error: Cannot find module 'eslint-formatter-jslint-xml'
Package not installed or not in node_modules path.
fix
Install package: npm install eslint-formatter-jslint-xml
TypeError: eslintFormatterJslintXml is not a function
Incorrect import: using named import instead of default import.
fix
Use: import eslintFormatterJslintXml from 'eslint-formatter-jslint-xml'
Error: This formatter requires ESLint 9+ with flat config
ESLint version <9 or using legacy config (.eslintrc).
fix
Upgrade to eslint@^9 and create eslint.config.js.
SyntaxError: Unexpected token 'export'
Trying to require() the package in a CommonJS context without transpilation.
fix
Use dynamic import: const eslintFormatterJslintXml = (await import('eslint-formatter-jslint-xml')).default; or switch to ESM.
Upgrade
Version history
9.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
eslint-formatter-jslint-xml — npm install eslint-formatter-jslint-xml · libregistry