Skip to content

Commit a96eb93

Browse files
authored
feat: add linter CI for vocs-docs (#378)
* feat: add linter CI for vocs-docs * fix: add a new lines
1 parent 844c1c2 commit a96eb93

File tree

4 files changed

+1038
-1
lines changed

4 files changed

+1038
-1
lines changed

.github/workflows/lint.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Lint Vocs Docs
2+
3+
on:
4+
push:
5+
paths:
6+
- 'vocs-docs/**'
7+
pull_request:
8+
paths:
9+
- 'vocs-docs/**'
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
defaults:
15+
run:
16+
working-directory: vocs-docs
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: pnpm/action-setup@v3
20+
with:
21+
version: 8
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
cache: 'pnpm'
26+
- name: Install dependencies
27+
run: pnpm install
28+
- name: Run linter
29+
run: pnpm lint

vocs-docs/.remarkrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import remarkPresetLintRecommended from 'remark-preset-lint-recommended'
2+
import remarkLintNoShortcutReferenceLink from 'remark-lint-no-shortcut-reference-link'
3+
4+
export default {
5+
plugins: [
6+
remarkPresetLintRecommended,
7+
[remarkLintNoShortcutReferenceLink, false]
8+
]
9+
}

vocs-docs/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"scripts": {
77
"dev": "vocs dev",
88
"build": "vocs build",
9-
"preview": "vocs preview"
9+
"preview": "vocs preview",
10+
"lint": "remark ./**/*.mdx --frail"
1011
},
1112
"dependencies": {
1213
"react": "latest",
@@ -15,6 +16,10 @@
1516
},
1617
"devDependencies": {
1718
"@types/react": "latest",
19+
"remark": "^15.0.1",
20+
"remark-cli": "^12.0.1",
21+
"remark-lint-no-shortcut-reference-link": "^4.0.1",
22+
"remark-preset-lint-recommended": "^7.0.1",
1823
"typescript": "latest"
1924
}
2025
}

0 commit comments

Comments
 (0)