Skip to content
This repository was archived by the owner on Feb 17, 2026. It is now read-only.
This repository was archived by the owner on Feb 17, 2026. It is now read-only.

add the hook and github action for markdownlint #157

@yacosta738

Description

@yacosta738

https://www.npmjs.com/package/markdownlint

We need to ensure that all Markdown files (.md, .mdx) in the project follow consistent formatting and style guidelines. This will improve documentation quality, readability, and maintainability.

The setup should include:
• A pre-commit hook via lefthook to run markdownlint locally before pushing.
• A GitHub Action to run markdownlint on pull requests, ensuring consistency across all contributions.

Technical Plan

  1. Install markdownlint

We will use markdownlint-cli2 because it is faster and supports glob patterns.

npm install --save-dev markdownlint-cli2

  1. Configuration file

Create a .markdownlint.jsonc config in the root of the repo:

{
"default": true,
"MD013": false, // Disable line length rule
"MD033": false, // Allow inline HTML
"MD041": false // Allow missing first header
}

  1. Lefthook pre-commit hook

Update lefthook.yml:

pre-commit:
parallel: true
commands:
markdownlint:
glob: "*.md"
run: npx markdownlint-cli2 {staged_files}

  1. GitHub Action workflow

Create .github/workflows/markdownlint.yml:

name: Markdown Lint

on:
pull_request:
paths:
- "/*.md"
- "
/*.mdx"

jobs:
markdownlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: npm install
- run: npx markdownlint-cli2 "/*.md" "/*.mdx"

  1. Add npm script (optional)

In package.json:

{
"scripts": {
"lint:md": "markdownlint-cli2 "/*.md" "/*.mdx""
}
}

Acceptance Criteria
• markdownlint-cli2 installed as a dev dependency.
• .markdownlint.jsonc configuration file created with agreed rules.
• Lefthook pre-commit hook runs markdownlint on staged Markdown files.
• GitHub Action checks Markdown files on pull requests.
• Any lint violations cause pre-commit or CI to fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions