Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lint): Implement front matter validator and linter #26410

Merged
merged 4 commits into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 2 additions & 0 deletions .github/workflows/pr-check_markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ jobs:
echo "::add-matcher::.github/workflows/markdownlint-problem-matcher.json"
files_to_lint="${{ env.DIFF_DOCUMENTS }}"
yarn markdownlint-cli2 ${files_to_lint}
echo "Linting front-matter"
node scripts/front-matter_linter.js ${files_to_lint}
8 changes: 6 additions & 2 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"*": "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"
],
"tests/**/*.*": "yarn test:front-matter-linter",
"*.{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"]
}
2 changes: 1 addition & 1 deletion files/en-us/glossary/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "MDN Web Docs Glossary: Definitions of Web-related terms"
slug: Glossary
page-type: glossary-definition
page-type: landing-page
---

Web technologies contain long lists of jargon and abbreviations that are used in documentation and coding. This glossary provides definitions of words and abbreviations you need to know to successfully understand and build for the web.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ short-title: webkitConvertPointFromPageToNode()
slug: Web/API/Window/webkitConvertPointFromPageToNode
page-type: web-api-instance-method
status:
- non-standard
- deprecated
- non-standard
browser-compat: api.Window.webkitConvertPointFromPageToNode
---

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/css/css_scrollbars/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
title: CSS scrollbars styling
slug: Web/CSS/CSS_Scrollbars
page-type: css-module
spec-urls: https://w3c.github.io/csswg-drafts/css-scrollbars/
browser-compat:
- css.properties.scrollbar-color
- css.properties.scrollbar-width
spec-urls: https://w3c.github.io/csswg-drafts/css-scrollbars/
---

{{CSSRef}}{{SeeCompatTable}}
Expand Down
Loading