This package provides ESLint's official 'codeframe' formatter, extracted from ESLint 7 as a standalone module for continued use after its removal in ESLint 8. It displays linting results with a colorful, framed code snippet showing the exact location of each problem. The current stable version is 7.32.2, matching ESLint 7's release cadence, and it is maintained by the eslint-community. Key differentiators: it's the exact same formatter as in ESLint 7, offers a more visually structured output than the default 'stylish' formatter, and can be used as a drop-in replacement with the --format flag.
npm install eslint-formatter-codeframeVerified import paths — ran on the pinned version, not inferred.
Demonstrates installing, running via CLI, and programmatic usage of the codeframe formatter.
Install eslint-formatter-codeframe and use --format codeframe (it will be found automatically if installed in node_modules).
Update to v7.32.2 or later.
Ensure ESLint results include the 'source' field (e.g., by calling CLIEngine with .executeOnFiles(...).results).
Consider using ESLint's built-in formatters or alternative community formatters for ESLint 9+ compatibility.
Run npm install --save-dev eslint-formatter-codeframe
Ensure you pass results that include the source file content (e.g., from .executeOnFiles().results).
Use import codeframe from 'eslint-formatter-codeframe' or const codeframe = require('eslint-formatter-codeframe').defaultInstall eslint-formatter-codeframe globally or ensure it is in the local node_modules when running ESLint.
No dependency data recorded yet.