Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement β†’
Sign In

eslint-plugin-markdown-preferences

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-markdown-preferences

ESLint plugin that enforces our markdown preferences

latest
Source
npmnpm
Version
0.41.1
Version published
Weekly downloads
13K
47.55%
Maintainers
1
Weekly downloads
Β 
Created
Source

eslint-plugin-markdown-preferences

A specialized ESLint plugin that helps enforce consistent writing style and formatting conventions in Markdown files. Perfect for documentation projects, blog posts, and any Markdown content where consistency matters.

NPM license NPM version NPM downloads NPM downloads NPM downloads NPM downloads NPM downloads Build Status

πŸ“› Features

  • πŸ“ Comprehensive style enforcement Enforces consistent heading casing, table header casing, inline code/link usage, emoji notation, and more for unified document style.
  • 🧩 Powerful formatting consistency Strongly standardizes Markdown formatting: whitespace, indentation, spacing, line breaks, list markers, code fences, links, references, thematic breaks, tables, and decorative elementsβ€”ensuring documents are clean and uniform.
  • πŸš€ Extended Markdown syntax support Supports custom containers, mathematical expressions, and other extended syntax for high compatibility with VitePress.
  • πŸ”§ Auto-fix support Most rules support ESLint's --fix option for automatic correction.
  • 🌐 Online Demo & Documentation Try it instantly in the Online Demo and see full documentation.

πŸ“– Documentation

For detailed usage instructions, rule configurations, and examples, visit our comprehensive documentation site.

πŸ’Ώ Installation

npm install --save-dev eslint @eslint/markdown eslint-plugin-markdown-preferences

πŸ“– Usage

Configuration

New Config (eslint.config.js)

Use eslint.config.js file to configure rules. See also: https://eslint.org/docs/latest/use/configure/configuration-files-new.

Example eslint.config.js:

import { defineConfig } from "eslint/config";
// import markdown from "@eslint/markdown";
import markdownPreferences from "eslint-plugin-markdown-preferences";
export default defineConfig([
  // add more generic rule sets here, such as:
  // markdown.configs.recommended,
  markdownPreferences.configs.recommended,
  {
    files: ["**/*.md", "*.md"],
    rules: {
      // override/add rules settings here, such as:
      // 'markdown-preferences/prefer-linked-words': 'error'
    },
  },
]);

This plugin provides configs:

  • *.configs.recommended ... Recommended config provided by the plugin.
  • *.configs.standard ... Enforces opinionated stylistic conventions. You can extend this to enforce any stylistic conventions you like.

See the rule list to get the rules that this plugin provides.

Using Extended Syntax

This plugin experimentally supports some extended Markdown syntax.
To use these extended syntaxes, set the markdown-preferences/extended-syntax language option.

import { defineConfig } from "eslint/config";
import markdownPreferences from "eslint-plugin-markdown-preferences";
export default defineConfig([
  {
    extends: [markdownPreferences.configs.recommended],
    language: "markdown-preferences/extended-syntax",
  },
]);

The following syntaxes are supported:

Legacy Config (.eslintrc)

Is not supported.

βœ… Rules

The --fix option on the command line automatically fixes problems reported by rules which have a wrench πŸ”§ below.
The rules with the following ⭐ are included in the recommended config.
The rules with the following πŸ’„ are included in the standard config.

Preference Rules

  • Rules to unify the expression and description style of documents.
Rule IDDescriptionFixableConfig
markdown-preferences/canonical-code-block-languageenforce canonical language names in code blocksπŸ”§
markdown-preferences/emoji-notationenforce consistent emoji notation style in Markdown files.πŸ”§
markdown-preferences/heading-casingenforce consistent casing in headings.πŸ”§
markdown-preferences/no-heading-trailing-punctuationdisallow trailing punctuation in headings.
markdown-preferences/ordered-list-marker-startenforce that ordered list markers start with 1 or 0πŸ”§πŸ’„
markdown-preferences/prefer-inline-code-wordsenforce the use of inline code for specific words.πŸ”§
markdown-preferences/prefer-linked-wordsenforce the specified word to be a link.πŸ”§
markdown-preferences/table-header-casingenforce consistent casing in table header cells.πŸ”§

Notation Rules

  • Rules related to notation styles in Markdown.
Rule IDDescriptionFixableConfig
markdown-preferences/bullet-list-marker-styleenforce consistent bullet list (unordered list) marker styleπŸ”§πŸ’„
markdown-preferences/code-fence-styleenforce a consistent code fence style (backtick or tilde) in Markdown fenced code blocks.πŸ”§πŸ’„
markdown-preferences/definitions-lastrequire link definitions and footnote definitions to be placed at the end of the documentπŸ”§
markdown-preferences/emphasis-delimiters-styleenforce a consistent delimiter style for emphasis and strong emphasisπŸ”§πŸ’„
markdown-preferences/hard-linebreak-styleenforce consistent hard linebreak style.πŸ”§β­πŸ’„
markdown-preferences/level1-heading-styleenforce consistent style for level 1 headingsπŸ”§πŸ’„
markdown-preferences/level2-heading-styleenforce consistent style for level 2 headingsπŸ”§πŸ’„
markdown-preferences/link-destination-styleenforce a consistent style for link destinationsπŸ”§πŸ’„
markdown-preferences/link-title-styleenforce a consistent style for link titlesπŸ”§πŸ’„
markdown-preferences/no-implicit-block-closingdisallow implicit block closing for fenced code blocks, math blocks, and custom containersπŸ”§β­πŸ’„
markdown-preferences/no-text-backslash-linebreakdisallow text backslash at the end of a line.β­πŸ’„
markdown-preferences/ordered-list-marker-styleenforce consistent ordered list marker styleπŸ”§πŸ’„
markdown-preferences/prefer-autolinksenforce the use of autolinks for URLsπŸ”§β­πŸ’„
markdown-preferences/prefer-fenced-code-blocksenforce the use of fenced code blocks over indented code blocksπŸ”§β­πŸ’„
markdown-preferences/prefer-link-reference-definitionsenforce using link reference definitions instead of inline linksπŸ”§
markdown-preferences/strikethrough-delimiters-styleenforce a consistent delimiter style for strikethroughπŸ”§πŸ’„
markdown-preferences/thematic-break-character-styleenforce consistent character style for thematic breaks (horizontal rules) in Markdown.πŸ”§πŸ’„

Whitespace Rules

  • Rules related to whitespace styles in Markdown.
Rule IDDescriptionFixableConfig
markdown-preferences/blockquote-marker-alignmentenforce consistent alignment of blockquote markersπŸ”§β­πŸ’„
markdown-preferences/code-fence-spacingrequire or disallow spacing between opening code fence and language identifierπŸ”§πŸ’„
markdown-preferences/custom-container-marker-spacingrequire or disallow spacing between opening custom container marker and infoπŸ”§πŸ’„
markdown-preferences/indentenforce consistent indentation in Markdown filesπŸ”§πŸ’„
markdown-preferences/link-bracket-newlineenforce linebreaks after opening and before closing link bracketsπŸ”§πŸ’„
markdown-preferences/link-bracket-spacingenforce consistent spacing inside link bracketsπŸ”§πŸ’„
markdown-preferences/link-paren-newlineenforce linebreaks after opening and before closing link parenthesesπŸ”§πŸ’„
markdown-preferences/link-paren-spacingenforce consistent spacing inside link parenthesesπŸ”§πŸ’„
markdown-preferences/list-marker-alignmentenforce consistent alignment of list markersπŸ”§β­πŸ’„
markdown-preferences/no-multi-spacesdisallow multiple spacesπŸ”§πŸ’„
markdown-preferences/no-multiple-empty-linesdisallow multiple empty lines in Markdown files.πŸ”§πŸ’„
markdown-preferences/no-tabsdisallow tab characters in Markdown files.πŸ”§πŸ’„
markdown-preferences/no-trailing-spacesdisallow trailing whitespace at the end of lines in Markdown files.πŸ”§πŸ’„
markdown-preferences/padded-custom-containersdisallow or require padding inside custom containersπŸ”§πŸ’„
markdown-preferences/padding-line-between-blocksrequire or disallow padding lines between blocksπŸ”§πŸ’„
markdown-preferences/table-pipe-spacingenforce consistent spacing around table pipesπŸ”§πŸ’„

Decorative Rules

  • Rules related to visual or stylistic decorations in Markdown.
Rule IDDescriptionFixableConfig
markdown-preferences/atx-heading-closing-sequence-lengthenforce consistent length for the closing sequence (trailing #s) in ATX headings.πŸ”§πŸ’„
markdown-preferences/atx-heading-closing-sequenceenforce consistent use of closing sequence in ATX headings.πŸ”§πŸ’„
markdown-preferences/code-fence-lengthenforce consistent code fence length in fenced code blocks.πŸ”§πŸ’„
markdown-preferences/max-lenenforce maximum length for various Markdown entities
markdown-preferences/no-laziness-blockquotesdisallow laziness in blockquotesβ­πŸ’„
markdown-preferences/ordered-list-marker-sequenceenforce consistent ordered list marker numbering (sequential or flat)πŸ”§πŸ’„
markdown-preferences/setext-heading-underline-lengthenforce setext heading underline lengthπŸ”§πŸ’„
markdown-preferences/sort-definitionsenforce a specific order for link definitions and footnote definitionsπŸ”§πŸ’„
markdown-preferences/table-leading-trailing-pipesenforce consistent use of leading and trailing pipes in tables.πŸ”§πŸ’„
markdown-preferences/table-pipe-alignmentenforce consistent alignment of table pipesπŸ”§πŸ’„
markdown-preferences/thematic-break-lengthenforce consistent length for thematic breaks (horizontal rules) in Markdown.πŸ”§πŸ’„
markdown-preferences/thematic-break-sequence-patternenforce consistent repeating patterns for thematic breaks (horizontal rules) in Markdown.πŸ”§πŸ’„

🍻 Contributing

Welcome contributing!

Please use GitHub's Issues/PRs.

Development Tools

  • npm test runs tests and measures coverage.
  • npm run update runs in order to update readme and recommended configuration.

πŸ”’ License

See the LICENSE file for license rights and limitations (MIT).

Keywords

eslint

FAQs

Package last updated on 09 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts