Registry / devops / eslint-formatter-checkstyle-relative-paths

eslint-formatter-checkstyle-relative-paths

JSON →
library1.0.1jsnpmunverified

An ESLint formatter that outputs Checkstyle XML with file paths relative to the current working directory, helping cross-platform CI and local reproducibility. Version 1.0.1 is the latest and only stable release; it is a simple tweak of ESLint's built-in checkstyle formatter. Unlike the default formatter (which uses absolute paths), this formatter uses relative paths, ensuring consistent output across different environments (e.g., developer machines and CI servers). It has no dependencies and requires no configuration beyond specifying the formatter path. This package is ideal for teams using tools that expect relative paths in Checkstyle reports.

npm install eslint-formatter-checkstyle-relative-paths
INSTALL
IMPORT
SIG · ESLINT-FORMATTER-C
E
eslint-formatter-checkstyle-relative-paths
devopsjavascriptv1.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
eslint --format ./node_modules/eslint-formatter-checkstyle-relative-paths
eslint --format checkstyle-relative-paths
The formatter is not a module; it is used via ESLint's --format flag with the path to the package's main file. Using just the package name without path may not work if the package is not resolved globally.
module.exports
const formatter = require('eslint-formatter-checkstyle-relative-paths');
import formatter from 'eslint-formatter-checkstyle-relative-paths';
The package is CommonJS-only and does not support ESM. Attempting to import it as a default ESM export will fail.
N/A (CLI tool)
npx eslint --format eslint-formatter-checkstyle-relative-paths
npm run eslint -- --format eslint-formatter-checkstyle-relative-paths
Using npx ensures the formatter can be resolved. An alternative is to directly reference the path to the package as shown in the README.

Shows installation and basic usage of the formatter with ESLint, using npx to run ESLint and specifying the formatter path.

// Install the formatter npm install eslint-formatter-checkstyle-relative-paths --save-dev // Run ESLint with the formatter npx eslint --format ./node_modules/eslint-formatter-checkstyle-relative-paths src/
Debug
Known issues
gotchaThe formatter is a CommonJS module; it cannot be imported via ESM import syntax.
fix
Use require() or pass the path to the formatter via ESLint's --format flag.
affects: >=1.0.0
gotchaUsing the package name alone with --format (e.g., --format eslint-formatter-checkstyle-relative-paths) may not work if the package is not installed globally or if ESLint cannot resolve it.
fix
Provide the full path: --format ./node_modules/eslint-formatter-checkstyle-relative-paths
affects: >=1.0.0
gotchaThis formatter only supports ESLint output; it does not validate or transform the input. Ensure eslint itself is installed.
fix
Install eslint as a dev dependency.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'eslint-formatter-checkstyle-relative-paths'
The formatter is not installed or ESLint cannot resolve the module path.
fix
Install the package: npm install eslint-formatter-checkstyle-relative-paths --save-dev. Then use --format with the full path to the package.
TypeError: eslint-formatter-checkstyle-relative-paths is not a function
Attempting to require the package as a function directly, but it exports a function that transforms results, not a runnable function.
fix
Use the package via ESLint's --format flag, not by calling it directly from code.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
eslint-formatter-checkstyle-relative-paths — npm install eslint-formatter-checkstyle-relative-paths · libregistry