{"id":19653,"library":"eslint-friendly-formatter","title":"ESLint Friendly Formatter","description":"An ESLint formatter that produces output compatible with Sublime Text and iTerm2 'click to open file' functionality. Version 4.0.1 is the current stable release, with irregular updates. Key differentiators: file/line/column links that open in editors, clickable rule IDs linking to documentation, errors reported at end, and a summary with contextual code snippets. It is based on the default 'stylish' formatter but enhanced for terminal usability.","status":"active","version":"4.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/royriojas/eslint-friendly-formatter","tags":["javascript","eslint","formatter","reporter","eslint formatter","stylish"],"install":[{"cmd":"npm install eslint-friendly-formatter","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-friendly-formatter","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-friendly-formatter","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency - used as a formatter for ESLint","package":"eslint","optional":true}],"imports":[{"note":"ESM default export equivalent to module.exports. Use default import.","wrong":"const formatter = require('eslint-friendly-formatter').default","symbol":"default","correct":"import formatter from 'eslint-friendly-formatter'"},{"note":"CommonJS: module.exports = function, so require() returns the function directly.","wrong":"const { formatter } = require('eslint-friendly-formatter')","symbol":"formatter (CJS)","correct":"const formatter = require('eslint-friendly-formatter')"},{"note":"TypeScript: default import works for both ESM and CJS with esModuleInterop.","wrong":"import * as formatter from 'eslint-friendly-formatter'","symbol":"formatter (TypeScript)","correct":"import formatter from 'eslint-friendly-formatter'"}],"quickstart":{"code":"const formatter = require('eslint-friendly-formatter');\nconst results = [\n  {\n    filePath: 'src/index.js',\n    messages: [\n      {\n        ruleId: 'no-unused-vars',\n        severity: 2,\n        message: 'foo is defined but never used',\n        line: 5,\n        column: 10,\n        nodeType: 'Identifier',\n      },\n    ],\n    errorCount: 1,\n    warningCount: 0,\n    fixableErrorCount: 0,\n    fixableWarningCount: 0,\n    source: 'const foo = 1;',\n  },\n];\nconst output = formatter(results);\nconsole.log(output);\n","lang":"javascript","description":"Demonstrates using eslint-friendly-formatter to format ESLint results for console output with clickable file links."},"warnings":[{"fix":"Use default import: import formatter from 'eslint-friendly-formatter' or use require('eslint-friendly-formatter').default if needed.","message":"v4.0.0 changed from CommonJS to hybrid ESM/CJS, breaking direct require() without .default in some bundlers.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Update to v4.0.0 or later and adjust imports as needed.","message":"v3.x and earlier are deprecated; upgrading to v4+ may break existing CJS code.","severity":"deprecated","affected_versions":"<4.0.0"},{"fix":"Test in your target terminal; configure editor to handle 'file://' URIs.","message":"Clickable file links only work in terminals that support URIs like iTerm2 or Sublime Text; not all terminals.","severity":"gotcha","affected_versions":"all"},{"fix":"Use ESLint's --fix separately; this formatter only displays results.","message":"Formatter does not handle eslint --fix output; only displays messages.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install --save-dev eslint-friendly-formatter; use --format ./node_modules/eslint-friendly-formatter/index.js","cause":"Module not installed or path incorrect when using --format in CLI.","error":"Cannot find module 'eslint-friendly-formatter'"},{"fix":"Use const formatter = require('eslint-friendly-formatter').default if needed; for CJS use require('eslint-friendly-formatter') directly.","cause":"Wrong import style in ESM/CJS interop (e.g., require().default not used).","error":"formatter is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}