Registry / testing / eslint-plugin-markdown-preferences

eslint-plugin-markdown-preferences

JSON →
library0.41.1jsnpmunverified

An ESLint plugin (v0.41.1, active development) that enforces consistent formatting and style in Markdown files. It provides over 30 rules covering heading casing, list markers, inline code, link references, table formatting, and more. Supports extended Markdown syntax (custom containers, math) and integrates with @eslint/markdown v7/v8. Auto-fix support for most rules. Alternative to remark-lint with ESLint-native integration, focused on opinionated style enforcement.

npm install eslint-plugin-markdown-preferences
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-MARK
E
eslint-plugin-markdown-preferences
testingjavascriptv0.41.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

markdownPreferences
import markdownPreferences from 'eslint-plugin-markdown-preferences'
const markdownPreferences = require('eslint-plugin-markdown-preferences')
ESM-only; requires Node.js >=20.19.0 or >=22.12.0 or >=24.0.0. Use default import in flat config.
configs.recommended
markdownPreferences.configs.recommended
require('eslint-plugin-markdown-preferences').configs.recommended
Access via the default import object. The recommended config enables a curated set of rules.
configs.standard
markdownPreferences.configs.standard
Stricter opinionated config for style enforcement. Override specific rules as needed.

Demonstrates flat config setup for ESLint v9+ with recommended and custom rules.

// eslint.config.js import { defineConfig } from 'eslint/config'; import markdown from '@eslint/markdown'; import markdownPreferences from 'eslint-plugin-markdown-preferences'; export default defineConfig([ // Enable ESLint's built-in Markdown processor markdown.configs.recommended, // Enable the plugin's recommended config markdownPreferences.configs.recommended, { files: ['**/*.md', '*.md'], rules: { // Enforce sentence case headings 'markdown-preferences/heading-casing': ['error', 'sentence-case'], // Disallow trailing punctuation in headings 'markdown-preferences/no-heading-trailing-punctuation': 'error', // Require consistent ordered list markers 'markdown-preferences/ordered-list-marker-sequence': ['error', { increment: 1 }], // Enforce max line length 'markdown-preferences/max-len': ['error', { code: 80 }], // Prefer reference links over inline URLs 'markdown-preferences/prefer-linked-words': 'warn', }, }, ]);
Debug
Known issues
breakingRequires Node.js ^20.19.0 || ^22.12.0 || >=24.0.0. Older Node versions are unsupported.
fix
Update Node.js to ^20.19.0, ^22.12.0, or >=24.0.0.
affects: >=0.41.0
breakingESLint >=9.0.0 required for flat config; legacy .eslintrc configs are not supported.
fix
Migrate to eslint.config.js flat config using defineConfig.
affects: >=0.41.0
deprecatedSupport for @eslint/markdown v7 may be dropped in future versions; v8 is recommended.
fix
Update @eslint/markdown to ^8.0.0.
affects: >=0.41.0
gotchaPlugin uses ESM exclusively; CommonJS require() will fail. Must use import syntax and 'type': 'module' in package.json or .mjs extension.
fix
Use import statements and ensure your project is configured for ESM.
affects: >=0.36.0
gotchaThe markdown-preferences/no-tabs rule conflicts with editor settings; ensure your editor does not insert tabs in Markdown files.
fix
Configure your editor to use spaces in Markdown files.
affects: >=0.37.0
deprecatedSome rules like 'markdown-preferences/prefer-linked-words' may be renamed in future versions; check changelog before upgrading.
fix
Review release notes for rule deprecations before upgrading.
affects: >=0.38.0
Errors
Common errors & fixes
Error: Cannot find module 'eslint-plugin-markdown-preferences'
Missing npm installation or incorrect import path.
fix
Run 'npm install --save-dev eslint-plugin-markdown-preferences' and ensure package.json includes it.
TypeError: markdownPreferences is not a function
Using CommonJS require() instead of ESM import.
fix
Use 'import markdownPreferences from "eslint-plugin-markdown-preferences"' in eslint.config.js.
Error: 'markdown-preferences/unknown-rule' was not found
Rule name misspelled or does not exist.
fix
Check the rule list at https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/ for valid rule names.
Parsing error: The keyword 'import' is reserved
Using ESM import in a CommonJS file without correct configuration.
fix
Add 'type': 'module' to package.json or rename file to .mjs extension.
Upgrade
Version history
0.41.1latest on npm
Audit
Dependencies
@eslint/markdownrequiredPeer dependency; required for ESLint to parse Markdown files. Versions ^7.4.0 or ^8.0.0 supported.
eslintrequiredPeer dependency; >=9.0.0 required for flat config support.
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-plugin-markdown-preferences — npm install eslint-plugin-markdown-preferences · libregistry