eslint-formatter-mo

raw JSON →
2.4.1 verified Sat Apr 25 auth: no javascript

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.

error Cannot find module 'eslint-formatter-mo'
cause Package not installed or not in node_modules.
fix
Run npm install eslint-formatter-mo --save-dev.
error require() of ES Module eslint-formatter-mo from CommonJS not supported.
cause Using CommonJS require() with ESM-only v2+.
fix
Use import syntax or downgrade to v1.x (not recommended).
error Error: Cannot access 'ruleId' before initialization
cause Bug in v2.4.0 fixed in v2.4.1.
fix
Upgrade to v2.4.1 or later.
breaking v2.0.0 moved to ESM only. CommonJS require() will throw an error.
fix Use import syntax or upgrade to Node 18+ with "type": "module" in package.json.
deprecated v1.x is no longer maintained. Users should upgrade to v2.x.
fix Upgrade to v2.4.1 and migrate to ESM.
gotcha The formatter uses Shiki for syntax highlighting, which requires network access for theme loading on first use.
fix Ensure network access or pre-cache themes. The package will work without highlighting if offline.
gotcha Environment variable MO_THEME must be set before running ESLint, not during.
fix Set MO_THEME in your shell or .env file before calling eslint.
gotcha Output is designed for terminals; may not render correctly in CI logs or non-TTY environments.
fix Use --no-color or pipe output to a file for non-TTY environments.
npm install eslint-formatter-mo
yarn add eslint-formatter-mo
pnpm add eslint-formatter-mo

Shows installation as dev dependency, CLI usage with `-f mo`, programmatic use with import, and custom theme via environment variable.

// Install: npm i eslint-formatter-mo -D
// Use as ESLint formatter via CLI:
// eslint src/ -f mo
// Or programmatically:
import mo from 'eslint-formatter-mo';
import { ESLint } from 'eslint';

const eslint = new ESLint();
const results = await eslint.lintFiles(['src/']);
const formatted = mo(results);
console.log(formatted);

// Custom theme via env var:
// MO_THEME=dracula eslint src/ -f mo