{"id":25496,"library":"eslint-formatter-prompter","title":"eslint-formatter-prompter","description":"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.","status":"active","version":"0.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/jonathannen/eslint-formatter-prompter","tags":["javascript","eslint","formatter","eslintformatter","ai","prompt","lint","typescript"],"install":[{"cmd":"npm install eslint-formatter-prompter","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-formatter-prompter","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-formatter-prompter","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency – formatter requires ESLint >=8.0.0","package":"eslint","optional":false}],"imports":[{"note":"Default export is the formatter; named export does not exist.","wrong":"import { prompter } from 'eslint-formatter-prompter'","symbol":"default","correct":"import prompter from 'eslint-formatter-prompter'"},{"note":"createPrompter is a named export for custom formatter construction.","wrong":"import createPrompter from 'eslint-formatter-prompter'","symbol":"createPrompter","correct":"import { createPrompter } from 'eslint-formatter-prompter'"},{"note":"TypeScript type export – only needed for type annotations.","wrong":"import { FormattedResult } from 'eslint-formatter-prompter'","symbol":"FormattedResult","correct":"import type { FormattedResult } from 'eslint-formatter-prompter'"}],"quickstart":{"code":"// Install: pnpm add --save-dev eslint-formatter-prompter\n// Run ESLint with the formatter:\neslint --format prompter .\n\n// Programmatic usage (ESM):\nimport { createPrompter } from 'eslint-formatter-prompter';\nimport { ESLint } from 'eslint';\n\nconst eslint = new ESLint();\nconst results = await eslint.lintFiles(['src/**/*.js']);\nconst formatter = createPrompter({\n  header: 'Custom header message',\n  footer: 'Custom footer message',\n  ruleMessages: {\n    'no-var': 'Replace var with let or const (prefer const).',\n  },\n});\nconst output = formatter(results);\nconsole.log(output);\n","lang":"typescript","description":"Shows CLI usage and programmatic ESM usage with custom messages."},"warnings":[{"fix":"Pipe output to a file or use pager (less). Example: eslint --format prompter . | less","message":"Formatted output may be truncated by the terminal when very long","severity":"gotcha","affected_versions":"*"},{"fix":"Install the package exactly as named; do not rename. CLI format argument is 'prompter' (without prefix).","message":"ESLint automatic formatter resolution only works with 'eslint-formatter-*' prefix","severity":"gotcha","affected_versions":"*"},{"fix":"Check the latest README or type definitions before upgrading.","message":"createPrompter options object shape may change in future versions","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Use import syntax or configure Node.js to treat .js files as ESM.","message":"Programmatic usage requires ESM; CJS require() will not work","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Subscribe to GitHub releases for API changes.","message":"No known deprecated options yet, but API is experimental","severity":"deprecated","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pnpm add --save-dev eslint-formatter-prompter` (or npm/yarn equivalent) and ensure the format argument is exactly 'prompter'.","cause":"Package not installed or ESLint not resolving correctly with non-standard formatter name.","error":"Error: Cannot find module 'eslint-formatter-prompter'"},{"fix":"Use `import prompter from 'eslint-formatter-prompter'` in ESM. For CJS, use `const prompter = require('eslint-formatter-prompter').default` or switch to ESM.","cause":"Importing default export incorrectly or using require() in CJS.","error":"TypeError: formatter is not a function"},{"fix":"Upgrade ESLint to >=8.0.0 and verify the package is installed. Try `npx eslint --format prompter .`.","cause":"ESLint version too old (<8.0.0) or formatter is not installed in node_modules.","error":"ESLint: Invalid option '--format' - 'prompter'"},{"fix":"Ensure package name is exactly 'eslint-formatter-prompter' and run `npm ls eslint-formatter-prompter` to verify install.","cause":"ESLint resolves formatters from eslint-formatter-<name> but the package isn't in node_modules or is incorrectly named.","error":"error: Unsupported format: prompter"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}