{"id":19827,"library":"eslint-plugin-markdown-preferences","title":"eslint-plugin-markdown-preferences","description":"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.","status":"active","version":"0.41.1","language":"javascript","source_language":"en","source_url":"https://github.com/ota-meshi/eslint-plugin-markdown-preferences","tags":["javascript","eslint","eslintplugin","eslint-plugin","markdown","preferences","lint"],"install":[{"cmd":"npm install eslint-plugin-markdown-preferences","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-markdown-preferences","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-markdown-preferences","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; required for ESLint to parse Markdown files. Versions ^7.4.0 or ^8.0.0 supported.","package":"@eslint/markdown","optional":false},{"reason":"Peer dependency; >=9.0.0 required for flat config support.","package":"eslint","optional":false}],"imports":[{"note":"ESM-only; requires Node.js >=20.19.0 or >=22.12.0 or >=24.0.0. Use default import in flat config.","wrong":"const markdownPreferences = require('eslint-plugin-markdown-preferences')","symbol":"markdownPreferences","correct":"import markdownPreferences from 'eslint-plugin-markdown-preferences'"},{"note":"Access via the default import object. The recommended config enables a curated set of rules.","wrong":"require('eslint-plugin-markdown-preferences').configs.recommended","symbol":"configs.recommended","correct":"markdownPreferences.configs.recommended"},{"note":"Stricter opinionated config for style enforcement. Override specific rules as needed.","wrong":"","symbol":"configs.standard","correct":"markdownPreferences.configs.standard"}],"quickstart":{"code":"// eslint.config.js\nimport { defineConfig } from 'eslint/config';\nimport markdown from '@eslint/markdown';\nimport markdownPreferences from 'eslint-plugin-markdown-preferences';\n\nexport default defineConfig([\n  // Enable ESLint's built-in Markdown processor\n  markdown.configs.recommended,\n  // Enable the plugin's recommended config\n  markdownPreferences.configs.recommended,\n  {\n    files: ['**/*.md', '*.md'],\n    rules: {\n      // Enforce sentence case headings\n      'markdown-preferences/heading-casing': ['error', 'sentence-case'],\n      // Disallow trailing punctuation in headings\n      'markdown-preferences/no-heading-trailing-punctuation': 'error',\n      // Require consistent ordered list markers\n      'markdown-preferences/ordered-list-marker-sequence': ['error', { increment: 1 }],\n      // Enforce max line length\n      'markdown-preferences/max-len': ['error', { code: 80 }],\n      // Prefer reference links over inline URLs\n      'markdown-preferences/prefer-linked-words': 'warn',\n    },\n  },\n]);","lang":"javascript","description":"Demonstrates flat config setup for ESLint v9+ with recommended and custom rules."},"warnings":[{"fix":"Update Node.js to ^20.19.0, ^22.12.0, or >=24.0.0.","message":"Requires Node.js ^20.19.0 || ^22.12.0 || >=24.0.0. Older Node versions are unsupported.","severity":"breaking","affected_versions":">=0.41.0"},{"fix":"Migrate to eslint.config.js flat config using defineConfig.","message":"ESLint >=9.0.0 required for flat config; legacy .eslintrc configs are not supported.","severity":"breaking","affected_versions":">=0.41.0"},{"fix":"Update @eslint/markdown to ^8.0.0.","message":"Support for @eslint/markdown v7 may be dropped in future versions; v8 is recommended.","severity":"deprecated","affected_versions":">=0.41.0"},{"fix":"Use import statements and ensure your project is configured for ESM.","message":"Plugin uses ESM exclusively; CommonJS require() will fail. Must use import syntax and 'type': 'module' in package.json or .mjs extension.","severity":"gotcha","affected_versions":">=0.36.0"},{"fix":"Configure your editor to use spaces in Markdown files.","message":"The markdown-preferences/no-tabs rule conflicts with editor settings; ensure your editor does not insert tabs in Markdown files.","severity":"gotcha","affected_versions":">=0.37.0"},{"fix":"Review release notes for rule deprecations before upgrading.","message":"Some rules like 'markdown-preferences/prefer-linked-words' may be renamed in future versions; check changelog before upgrading.","severity":"deprecated","affected_versions":">=0.38.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 --save-dev eslint-plugin-markdown-preferences' and ensure package.json includes it.","cause":"Missing npm installation or incorrect import path.","error":"Error: Cannot find module 'eslint-plugin-markdown-preferences'"},{"fix":"Use 'import markdownPreferences from \"eslint-plugin-markdown-preferences\"' in eslint.config.js.","cause":"Using CommonJS require() instead of ESM import.","error":"TypeError: markdownPreferences is not a function"},{"fix":"Check the rule list at https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/ for valid rule names.","cause":"Rule name misspelled or does not exist.","error":"Error: 'markdown-preferences/unknown-rule' was not found"},{"fix":"Add 'type': 'module' to package.json or rename file to .mjs extension.","cause":"Using ESM import in a CommonJS file without correct configuration.","error":"Parsing error: The keyword 'import' is reserved"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}