Skip to content

Commit 111ec65

Browse files
authored
Added 'zhlint' to validate the content format (#1076)
* added zhlint to validate the content format * fixed lint jobs in circleci config file * Update package.json * Update .nvmrc
1 parent 742ae52 commit 111ec65

File tree

3 files changed

+43
-5
lines changed

3 files changed

+43
-5
lines changed

.circleci/config.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
docker:
1212
# specify the version you desire here
13-
- image: circleci/node:8
13+
- image: circleci/node:12
1414

1515
# Specify service dependencies here if necessary
1616
# CircleCI maintains a library of pre-built images
@@ -51,3 +51,39 @@ jobs:
5151
git add .
5252
git commit -m "generated docs"
5353
git push origin HEAD:gh-pages --force
54+
lint:
55+
branches:
56+
ignore:
57+
- master
58+
- gh-pages
59+
60+
docker:
61+
# specify the version you desire here
62+
- image: circleci/node:12
63+
64+
# Specify service dependencies here if necessary
65+
# CircleCI maintains a library of pre-built images
66+
# documented at https://circleci.com/docs/2.0/circleci-images/
67+
# - image: circleci/mongo:3.4.4
68+
69+
working_directory: ~/repo
70+
71+
steps:
72+
- checkout
73+
74+
# Download and cache dependencies
75+
- restore_cache:
76+
keys:
77+
- v1-dependencies-{{ checksum "package.json" }}
78+
# fallback to using the latest cache if no exact match is found
79+
- v1-dependencies-
80+
81+
- run: yarn install
82+
83+
- save_cache:
84+
paths:
85+
- node_modules
86+
key: v1-dependencies-{{ checksum "package.json" }}
87+
88+
# run tests!
89+
- run: yarn lint

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v8.9.4
1+
v12

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
},
77
"scripts": {
88
"start": "hexo server",
9+
"lint": "zhlint 'src/v2/{guide,api,style-guide}/*.md'",
910
"build": "node pre-deploy.js && hexo clean && hexo generate",
1011
"deploy": "npm run build && hexo deploy"
1112
},
1213
"engines": {
13-
"node": ">=8.9.0"
14+
"node": ">=12.0.0"
1415
},
1516
"dependencies": {
1617
"hexo": "^3.6.0",
@@ -27,6 +28,7 @@
2728
"hexo-renderer-stylus": "^0.3.3",
2829
"hexo-server": "^0.3.1",
2930
"hoek": "^6.1.2",
30-
"request": "^2.85.0"
31+
"request": "^2.85.0",
32+
"zhlint": "git+https://github.com/Jinjiang/zhlint.git"
3133
}
32-
}
34+
}

0 commit comments

Comments
 (0)