{"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,"search_vec":"'4.0.1':22 'base':58 'click':16 'clickabl':39 'code':54 'compat':10 'contextu':53 'current':25 'default':61 'differenti':32 'document':44 'editor':38 'end':48 'enhanc':65 'error':45 'eslint':1,5,70,73 'file':19 'file/line/column':33 'formatt':3,6,63,71,74 'friend':2 'function':20 'id':41 'irregular':29 'iterm2':15 'javascript':69 'key':31 'link':34,42 'open':18,36 'output':9 'produc':8 'releas':27 'report':46,72 'rule':40 'snippet':55 'stabl':26 'stylish':62,75 'sublim':12 'summari':51 'termin':67 'text':13 'updat':30 'usabl':68 'version':21","created_at":"2026-04-25T11:18:56.399355+00:00","updated_at":"2026-04-25T11:18:56.399355+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"eslint","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/royriojas/eslint-friendly-formatter","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/eslint-friendly-formatter","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}