ESLint Formatter Markdown

raw JSON →
1.0.4 verified Sat Apr 25 auth: no javascript maintenance

An ESLint formatter that outputs linting results as Markdown, suitable for use with ESLint CLI, grunt-eslint, or programmatic usage. Current stable version is 1.0.4, last updated July 2017. The package has not seen active development since then, and only supports ESLint 2.x and 3.x (with potential issues on newer Node). It depends on lodash. Key differentiators: generates human-readable Markdown reports with summary statistics and sorting, but is largely obsolete due to lack of updates and ESLint's built-in formatter improvements.

error Cannot find module 'eslint-formatter-markdown'
cause The package is not installed or the require path is wrong.
fix
Run npm install eslint-formatter-markdown --save-dev and ensure the require path is correct.
error Error: Invalid format: markdown
cause Using a short format name instead of the full path to the formatter file.
fix
Use --format node_modules/eslint-formatter-markdown/markdown.js.
error TypeError: formatter is not a function
cause Importing the package with ES module syntax instead of CommonJS require.
fix
Use const formatter = require('eslint-formatter-markdown');
gotcha ESLint version compatibility: tested only with ESLint 2 and 3. May not work correctly with ESLint 4+ due to formatter API changes.
fix Consider using ESLint's built-in formatters or a more maintained third-party formatter.
gotcha CLI format path must be absolute or relative to the current directory; using just 'markdown' does not work.
fix Use `--format ./node_modules/eslint-formatter-markdown/markdown.js` or similar.
deprecated Package last updated in 2017. No active maintenance or support for modern ESLint versions. Suggest migrating to an alternative.
fix Use ESLint's built-in formatter 'stylish' or a more recent formatter like 'eslint-formatter-table'.
npm install eslint-formatter-markdown
yarn add eslint-formatter-markdown
pnpm add eslint-formatter-markdown

Shows how to generate Markdown-formatted ESLint output via CLI and programmatically using CommonJS require.

// Install: npm install eslint-formatter-markdown --save-dev
// Use with ESLint CLI:
eslint --format node_modules/eslint-formatter-markdown/markdown.js src/

// Or programmatically:
const eslint = require('eslint');
const formatter = require('eslint-formatter-markdown');

const engine = new eslint.CLIEngine();
const report = engine.executeOnFiles(['src/']);
const markdownOutput = formatter(report.results);
console.log(markdownOutput);