{"id":19647,"library":"eslint-formatter-mo","title":"eslint-formatter-mo","description":"Good-lookin' ESLint formatter for delightful readability. Current stable version is 2.4.1, released November 2025, with regular updates. Key differentiators: colorful output with code highlighting via Shiki, support for 50+ VS Code themes, JSON/Markdown/CSS highlighting, and auto-fixable markers. ESM-only since v2 (breaking change). Active maintenance with frequent bug fixes.","status":"active","version":"2.4.1","language":"javascript","source_language":"en","source_url":"https://github.com/fengzilong/eslint-formatter-mo","tags":["javascript","eslint","eslint-formatter","eslintformatter","formatter","pretty","fancy","readability"],"install":[{"cmd":"npm install eslint-formatter-mo","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-formatter-mo","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-formatter-mo","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only since v2; CommonJS require will fail.","wrong":"const eslintFormatterMo = require('eslint-formatter-mo')","symbol":"default","correct":"import eslintFormatterMo from 'eslint-formatter-mo'"},{"note":"The default export is a function that takes ESLint results and returns a formatted string.","wrong":"const mo = require('eslint-formatter-mo');","symbol":"default (as formatter function)","correct":"import mo from 'eslint-formatter-mo'; eslint.lintFiles(patterns).then(results => console.log(mo(results)))"},{"note":"Types may be bundled; check package for type definitions.","wrong":"","symbol":"TypeScript type (if provided)","correct":"import type { ESLintFormatter } from 'eslint-formatter-mo'"}],"quickstart":{"code":"// Install: npm i eslint-formatter-mo -D\n// Use as ESLint formatter via CLI:\n// eslint src/ -f mo\n// Or programmatically:\nimport mo from 'eslint-formatter-mo';\nimport { ESLint } from 'eslint';\n\nconst eslint = new ESLint();\nconst results = await eslint.lintFiles(['src/']);\nconst formatted = mo(results);\nconsole.log(formatted);\n\n// Custom theme via env var:\n// MO_THEME=dracula eslint src/ -f mo","lang":"typescript","description":"Shows installation as dev dependency, CLI usage with `-f mo`, programmatic use with import, and custom theme via environment variable."},"warnings":[{"fix":"Use import syntax or upgrade to Node 18+ with \"type\": \"module\" in package.json.","message":"v2.0.0 moved to ESM only. CommonJS require() will throw an error.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Upgrade to v2.4.1 and migrate to ESM.","message":"v1.x is no longer maintained. Users should upgrade to v2.x.","severity":"deprecated","affected_versions":"<2.0.0"},{"fix":"Ensure network access or pre-cache themes. The package will work without highlighting if offline.","message":"The formatter uses Shiki for syntax highlighting, which requires network access for theme loading on first use.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Set MO_THEME in your shell or .env file before calling eslint.","message":"Environment variable MO_THEME must be set before running ESLint, not during.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Use --no-color or pipe output to a file for non-TTY environments.","message":"Output is designed for terminals; may not render correctly in CI logs or non-TTY environments.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install eslint-formatter-mo --save-dev`.","cause":"Package not installed or not in node_modules.","error":"Cannot find module 'eslint-formatter-mo'"},{"fix":"Use `import` syntax or downgrade to v1.x (not recommended).","cause":"Using CommonJS require() with ESM-only v2+.","error":"require() of ES Module eslint-formatter-mo from CommonJS not supported."},{"fix":"Upgrade to v2.4.1 or later.","cause":"Bug in v2.4.0 fixed in v2.4.1.","error":"Error: Cannot access 'ruleId' before initialization"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}