Registry /
testing / eslint-formatter-json-relative
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
default
✓ import formatter from 'eslint-formatter-json-relative'
✗ const formatter = require('eslint-formatter-json-relative')
The package is ESM-only; require() may fail depending on Node.js version and project configuration.
formatter (CommonJS)
✓ const formatter = require('eslint-formatter-json-relative')
✗ import formatter from 'eslint-formatter-json-relative'
While the package is ESM, it may still be required if the project uses CommonJS, but this is not officially supported.
default (with type assertion)
✓ import type { Linter } from 'eslint';
import formatter from 'eslint-formatter-json-relative';
✗ import formatter from 'eslint-formatter-json-relative'; // missing type import for Linter.Formatter
No types are shipped; you may need to cast or use the ESLint type definitions.
Shows installation, CLI usage, and programmatic usage of the formatter, including how to get relative-path JSON output.
// Install: npm i eslint-formatter-json-relative --save-dev
// Use via ESLint CLI:
eslint -f json-relative ./src
// Or programmatically in an ESLint plugin or script:
import formatter from 'eslint-formatter-json-relative';
import { ESLint } from 'eslint';
const eslint = new ESLint();
const results = await eslint.lintFiles(['./src']);
const output = formatter(results);
console.log(output);
Errors
Common errors & fixes
Cannot find module 'eslint-formatter-json-relative'
The package is not installed or is not in the current working directory's node_modules.
fixRun `npm install eslint-formatter-json-relative --save-dev` in the project root.
Error: Formatter 'json-relative' not found
ESLint cannot resolve the formatter name. The package name must be 'eslint-formatter-json-relative' when installed from npm, but the -f argument uses the short name 'json-relative'.
fixUse `eslint -f json-relative` after installing the package correctly.
TypeError: formatter is not a function
Attempting to import the default export incorrectly, e.g., using a named import or importing from the wrong path.
fixUse `import formatter from 'eslint-formatter-json-relative'` (default import) and ensure the package is installed.
Audit
Dependencies
No dependency data recorded yet.