Cover image of remark-lint-plugins project

Remark Lint Plugins


Category
  • dev tools
Tech Stack

JavaScript

I developed a suite of remark-lint plugins to help developers maintain high-quality Markdown documentation. Each plugin focuses on specific aspects of Markdown files to ensure consistency, readability, and adherence to best practices:



heading capitalization

Automatically checks and corrects the capitalization of Markdown headings, ensuring a consistent and professional look. Examples:

Valid Markdown
      
      ## Where to Ask Questions
      ## An Apple
      ## Enable 2FA on GitHub
      ## Flight-or-Fight
        
Invalid Markdown
          
      ## Where To Ask questions
      ## an Apple
      ## Enable 2FA On GitHub
      ## Flight-Or-fight
        
Lint Warnings
  • 1:1-1:26 warning Heading capitalization error. Expected: 'Where to Ask Questions' found: 'Where To Ask questions'.
  • 2:1-2:12 warning Heading capitalization error. Expected: 'An Apple' found: 'an Apple'.
  • 3:1-3:24 warning Heading capitalization error. Expected: 'Enable 2FA on GitHub' found: 'Enable 2FA On GitHub'.
  • 4:1-4:19 warning Heading capitalization error. Expected: 'Flight-or-Fight' found: 'Flight-Or-fight'.


check toc

Validates the Table of Contents (TOC) in your Markdown files, ensuring that it reflects the document structure accurately. Examples:

Valid Markdown
      
      * [Heading One](#heading-one)
        * [Sub Heading](#sub-heading)
      * [Heading Two](#heading-two)

      ## Heading One

      Lorem ipsum dolor sit amet.

      ### Sub Heading

      Lorem ipsum dolor sit amet.

      ## Heading Two

      Lorem ipsum dolor sit amet.
        
Invalid Markdown
      
      * [Heaing One](#heading-one)
        * [Sub Heading](#subheading)
      * [heading Two](#heading-two)

      ## Heading One

      Lorem ipsum dolor sit amet.

      ### Sub Heading

      Lorem ipsum dolor sit amet.

      ## Heading Two

      Lorem ipsum dolor sit amet
        
Lint Warnings
  • 1:3-1:29 warning Incorrect title or URL in TOC. Title: Heaing One, URL: #heading-one
  • 2:5-2:31 warning Incorrect title or URL in TOC. Title: Sub Heading, URL: #subheading
  • 3:3-3:30 warning Incorrect title or URL in TOC. Title: heading Two, URL: #heading-two


code block split list

Ensures that code blocks within lists do not unintentionally split the list, keeping the formatting intact and readable. Examples:

Valid Markdown
      
      1. Item 1

         ```sh
         pnpm run dev
         ```

      2. Item 2
        
Invalid Markdown
        
        1. Item 1

        ```sh
        pnpm run dev
        ```

        2. Item 2
        
Lint Warnings
  • 6:1-8:4 warning Add 3 spaces to the beginning of the code block to align with the list.


smarty pants typography

Enhances the typography of your Markdown files by converting straight quotes, apostrophes, hyphens, and dashes into their more typographically correct forms (curved quotes, em/en dashes). Examples:

The content of the following file.md:
      
      He said, "A 'simple' english sentence..."

      It's will be held from June 1-5. The statement -- if you ask me --- is quite remarkable...
      
        
Will be converted to the following content of file.md:
        
        He said, “A ‘simple’ english sentence…”

        It’s will be held from June 1-5. The statement – if you ask me — is quite remarkable…
        
Lint Warnings
  • 3:1-3:42 warning File has been overwritten
  • 3:1-3:42 warning Smart typography was applied
  • 5:1-5:91 warning Smart typography was applied