Registry / testing / eslint-formatter-prompter

eslint-formatter-prompter

JSON →
library0.1.1jsnpmunverified

An ESLint custom formatter that transforms standard lint output into structured, directive-rich prompts for AI tools. Version 0.1.1 (experimental) converts ESLint violations into grouped, actionable instructions telling AI what to fix and why, reducing noise and improving automated fix accuracy. Key differentiators: includes per-rule directive context, a mandatory fix header, minimum token usage via grouping, and full customizability of messages. Requires ESLint >=8.x. Ships TypeScript types. Early release with evolving API.

npm install eslint-formatter-prompter
INSTALL
IMPORT
SIG · ESLINT-FORMATTER-P
E
eslint-formatter-prompter
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
✓ import prompter from 'eslint-formatter-prompter'
✗ import { prompter } from 'eslint-formatter-prompter'
Default export is the formatter; named export does not exist.
createPrompter
✓ import { createPrompter } from 'eslint-formatter-prompter'
✗ import createPrompter from 'eslint-formatter-prompter'
createPrompter is a named export for custom formatter construction.
FormattedResult
✓ import type { FormattedResult } from 'eslint-formatter-prompter'
✗ import { FormattedResult } from 'eslint-formatter-prompter'
TypeScript type export – only needed for type annotations.

Shows CLI usage and programmatic ESM usage with custom messages.

// Install: pnpm add --save-dev eslint-formatter-prompter // Run ESLint with the formatter: eslint --format prompter . // Programmatic usage (ESM): import { createPrompter } from 'eslint-formatter-prompter'; import { ESLint } from 'eslint'; const eslint = new ESLint(); const results = await eslint.lintFiles(['src/**/*.js']); const formatter = createPrompter({ header: 'Custom header message', footer: 'Custom footer message', ruleMessages: { 'no-var': 'Replace var with let or const (prefer const).', }, }); const output = formatter(results); console.log(output);
Debug
Known issues
gotchaFormatted output may be truncated by the terminal when very long
fix
Pipe output to a file or use pager (less). Example: eslint --format prompter . | less
affects: *
gotchaESLint automatic formatter resolution only works with 'eslint-formatter-*' prefix
fix
Install the package exactly as named; do not rename. CLI format argument is 'prompter' (without prefix).
affects: *
breakingcreatePrompter options object shape may change in future versions
fix
Check the latest README or type definitions before upgrading.
affects: >=0.1.0
gotchaProgrammatic usage requires ESM; CJS require() will not work
fix
Use import syntax or configure Node.js to treat .js files as ESM.
affects: >=0.1.0
deprecatedNo known deprecated options yet, but API is experimental
fix
Subscribe to GitHub releases for API changes.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'eslint-formatter-prompter'
Package not installed or ESLint not resolving correctly with non-standard formatter name.
fix
Run `pnpm add --save-dev eslint-formatter-prompter` (or npm/yarn equivalent) and ensure the format argument is exactly 'prompter'.
TypeError: formatter is not a function
Importing default export incorrectly or using require() in CJS.
fix
Use `import prompter from 'eslint-formatter-prompter'` in ESM. For CJS, use `const prompter = require('eslint-formatter-prompter').default` or switch to ESM.
ESLint: Invalid option '--format' - 'prompter'
ESLint version too old (<8.0.0) or formatter is not installed in node_modules.
fix
Upgrade ESLint to >=8.0.0 and verify the package is installed. Try `npx eslint --format prompter .`.
error: Unsupported format: prompter
ESLint resolves formatters from eslint-formatter-<name> but the package isn't in node_modules or is incorrectly named.
fix
Ensure package name is exactly 'eslint-formatter-prompter' and run `npm ls eslint-formatter-prompter` to verify install.
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies
eslintrequiredpeer dependency – formatter requires ESLint >=8.0.0
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-formatter-prompter — npm install eslint-formatter-prompter · libregistry