Skip to content

Commit

Permalink
feat(lint): Implement front matter validator and linter
Browse files Browse the repository at this point in the history
  • Loading branch information
OnkarRuikar committed Apr 26, 2023
1 parent c495a1e commit 35269ad
Show file tree
Hide file tree
Showing 20 changed files with 3,791 additions and 818 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/markdown-lint-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ jobs:
run: yarn --frozen-lockfile

- name: Lint markdown files
run: yarn fix:md
run: |
yarn fix:md
yarn fix:fm
- name: Create PR with only fixable issues
if: success()
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ jobs:
run: |
echo "::add-matcher::.github/workflows/markdownlint-problem-matcher.json"
yarn lint:md
yarn lint:fm
1 change: 1 addition & 0 deletions .github/workflows/pr-check_markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ jobs:
echo "::add-matcher::.github/workflows/markdownlint-problem-matcher.json"
files_to_lint="${{ env.DIFF_DOCUMENTS }}"
yarn markdownlint-cli2 ${files_to_lint}
node scripts/front-matter_linter.js ${files_to_lint}
7 changes: 5 additions & 2 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"*": "prettier --ignore-unknown --write",
"*.md": "markdownlint-cli2-fix",
"!*.md": "prettier --ignore-unknown --write",
"*.md": [
"markdownlint-cli2-fix",
"node scripts/front-matter_linter.js --fix true"
],
"*.{svg,png,jpeg,jpg,gif}": "yarn filecheck"
}
2 changes: 1 addition & 1 deletion .markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -207,5 +207,5 @@
}
},
"customRules": ["markdownlint-rule-search-replace"],
"ignores": ["node_modules", ".github"]
"ignores": ["node_modules", ".github", "tests"]
}
Loading

0 comments on commit 35269ad

Please sign in to comment.