Registry / testing / eslint-path-formatter

eslint-path-formatter

JSON →
library0.1.1jsnpmunverified

This package provides an ESLint formatter that displays errors with absolute paths and row/column on one line, leveraging source-map support for mapping errors to original source files. Version 0.1.1 is the current stable release; the package has not been updated since 2013 and relies on an unreleased ESLint API, making it potentially incompatible with modern ESLint versions. It is ideal for tools like WebStorm that use RegExp-based output filters to create clickable error links. Notable alternatives include the built-in ESLint formatters (e.g., stylish, unix) or the eslint-formatter-autoloadable package.

npm install eslint-path-formatter
INSTALL
IMPORT
SIG · ESLINT-PATH-FORMAT
E
eslint-path-formatter
testingjavascriptv0.1.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 export
import formatter from 'eslint-path-formatter'
const formatter = require('eslint-path-formatter')
The package is a CommonJS module; in ESM contexts, use default import.
color function
import { color } from 'eslint-path-formatter'
import color from 'eslint-path-formatter/color'
The color function is a named export, not a separate module.
formatter with require
const formatter = require('eslint-path-formatter')
const formatter = require('eslint-path-formatter').default
In CJS, require returns the export directly; there is no .default property.

Shows how to install and use the formatter programmatically with sample ESLint results.

// Install: npm install eslint-path-formatter // Usage in ESLint configuration or CLI: // Pass the path to the module as the formatter option // e.g., in .eslintrc: { "formatter": "./node_modules/eslint-path-formatter" } // Programmatic usage: const formatter = require('eslint-path-formatter'); // Example ESLint results const results = [ { filePath: '/path/to/file.js', messages: [ { line: 10, column: 5, message: 'Unexpected console statement', ruleId: 'no-console', severity: 2 } ], errorCount: 1, warningCount: 0, fixableErrorCount: 0, fixableWarningCount: 0, source: undefined } ]; const output = formatter(results); console.log(output); // Output: "/path/to/file.js: line 10, col 5, Error - Unexpected console statement (no-console)"
Debug
Known issues
deprecatedThis package is unmaintained and relies on unreleased ESLint APIs. It may not work with ESLint 1.0+.
fix
Use built-in ESLint formatters or alternative packages like eslint-formatter-autoloadable.
affects: >=1.0
breakingThe formatter expects a specific result object structure that changed in ESLint 1.0. Errors may occur.
fix
Update to a maintained formatter or patch the package internally.
affects: >=1.0
gotchaThe module path must be passed as an absolute or relative path to the ESLint formatter option, not just the package name.
fix
Use `'./node_modules/eslint-path-formatter'` or `require.resolve('eslint-path-formatter')`.
affects: *
gotchaSource-map support requires manual implementation; automatic detection may not work in all environments.
fix
Ensure sourceMappingURL comments are present in processed files, or disable source-map feature by overriding options.
affects: *
Errors
Common errors & fixes
Cannot find module 'eslint-path-formatter'
Module not installed or path not correctly resolved.
fix
Run 'npm install eslint-path-formatter' and ensure the formatter path is correctly specified (e.g., './node_modules/eslint-path-formatter').
formatter is not a function
Using require('eslint-path-formatter').default instead of the direct export.
fix
Use const formatter = require('eslint-path-formatter'); (no .default).
TypeError: Cannot read property 'messages' of undefined
The formatter is incompatible with ESLint results structure after version 1.0.
fix
Update to a modern ESLint formatter or patch the package to handle new result format.
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

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