Skip to content

Commit 7dce306

Browse files
committed
refactor: enhance CI workflow and README for Markdown linting and formatting
1 parent af114e6 commit 7dce306

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ jobs:
2525
run: npm ci
2626
- name: Lint code
2727
run: npm run lint
28-
- name: Lint Markdown files
29-
run: npm run lint:md
3028
- name: Check formatting
3129
run: npm run format
30+
- name: Lint Markdown files
31+
run: npm run lint:md
32+
- name: Check Markdown formatting
33+
run: npm run format:md
3234
- name: Run tests
3335
run: npm test

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,15 @@ In the project directory, you can run:
5656
- `npm run lint:fix`: Lints and automatically fixes fixable issues.
5757
- `npm run format`: Checks for formatting issues with Prettier.
5858
- `npm run format:fix`: Formats all supported files with Prettier.
59+
- `npm run format:md`: Checks for formatting issues with Prettier for Markdown files.
60+
- `npm run format:md:fix`: Formats all Markdown files with Prettier.
61+
5962

6063
## How It Works
6164

6265
### Pre-commit Hooks
6366

64-
This project uses `Husky` and `lint-staged` to run `eslint --fix` and `prettier --write` on staged `.js` files every time you make a commit. This automated quality gate ensures that no code that violates the style guide ever gets into the codebase.
67+
This project uses `Husky` and `lint-staged` to run `eslint --fix`, `prettier --write` (for both code and Markdown), and `markdownlint --fix` on staged files every time you make a commit. This automated quality gate ensures that no code or documentation that violates the style guide ever gets into the codebase.
6568

6669
If a file has linting or formatting errors, the tools will attempt to fix them automatically. If they can, the fixed code is what gets committed. If they can't, the commit is aborted so you can fix the issues manually.
6770

@@ -76,8 +79,9 @@ Both workflows perform the following steps across multiple Node.js versions (18.
7679

7780
1. **Install dependencies** using `npm ci` for fast, reliable installs.
7881
2. **Lint code** with `npm run lint`.
79-
3. **Check formatting** with `npm run format`.
80-
4. **Run tests** with `npm test`.
82+
3. **Check Markdown formatting** with `npm run format:md`.
83+
4. **Check formatting** with `npm run format`.
84+
5. **Run tests** with `npm test`.
8185

8286
## Customization
8387

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
"lint:fix": "eslint . --fix",
1010
"format": "prettier --check .",
1111
"format:fix": "prettier --write .",
12+
"format:md": "prettier --check '**/*.md'",
13+
"format:md:fix": "prettier --write '**/*.md'",
1214
"lint:md": "markdownlint --ignore-path .gitignore .",
1315
"lint:md:fix": "markdownlint --ignore-path .gitignore --fix .",
1416
"prepare": "husky install"

0 commit comments

Comments
 (0)