Skip to content

Commit 57e4829

Browse files
committed
workflow: setup zhlint
1 parent 2e93be1 commit 57e4829

File tree

4 files changed

+888
-110
lines changed

4 files changed

+888
-110
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,14 @@ jobs:
3232

3333
- run: PUPPETEER_SKIP_DOWNLOAD=1 pnpm install
3434

35-
- name: Run case police
35+
- name: Run CasePolice
3636
run: npx case-police --fix
3737

38-
- name: Run eslint
39-
run: pnpm run lint
38+
- name: Run zhlint
39+
run: npx zhlint docs/README.zh-CN.md --fix
40+
41+
- name: Run ESLint
42+
run: npx lint-staged
4043

4144
unit-test:
4245
runs-on: ubuntu-latest

docs/README.zh-CN.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828

2929
- Vue 2.6 / 2.7 / 3 通用
3030
- 支持 SSR,Nuxt 2 / 3 通用
31-
- 支持微前端比如 [wujie](https://github.com/Tencent/wujie)
31+
- 支持微前端 (比如 [wujie](https://github.com/Tencent/wujie))
3232
- 编辑模式双向绑定
33-
- 局部注册 + 局部传参,也可以全局注册 + 全局传参[vue-global-config](https://github.com/cloydlau/vue-global-config) 提供技术支持
33+
- 局部注册 + 局部传参,也可以全局注册 + 全局传参 ([vue-global-config](https://github.com/cloydlau/vue-global-config) 提供技术支持)
3434

3535
<br>
3636

@@ -39,8 +39,8 @@
3939
### 外置依赖
4040

4141
- `vue`
42-
- `vanilla-jsoneditor`: [svelte-jsoneditor](https://github.com/josdejong/svelte-jsoneditor)[jsoneditor](https://github.com/josdejong/jsoneditor) 的继任者提供的原生 JS 版本
43-
- `@vue/composition-api`: 仅 Vue 2.6 或更早版本需要
42+
- `vanilla-jsoneditor`[svelte-jsoneditor](https://github.com/josdejong/svelte-jsoneditor) ([jsoneditor](https://github.com/josdejong/jsoneditor) 的继任者) 提供的原生 JS 版本
43+
- `@vue/composition-api`仅 Vue 2.6 或更早版本需要
4444

4545
<br>
4646

@@ -120,7 +120,7 @@ createApp()
120120

121121
#### CDN + UMD
122122

123-
> ⚠ 暂不支持`vanilla-jsoneditor` 不提供 UMD 导出,如有需要请在[这里](https://github.com/josdejong/svelte-jsoneditor/discussions/196)留言。
123+
> ⚠ 暂不支持 (`vanilla-jsoneditor` 不提供 UMD 导出),如有需要请在[这里](https://github.com/josdejong/svelte-jsoneditor/discussions/196)留言。
124124
125125
```html
126126
<!DOCTYPE html>
@@ -232,7 +232,7 @@ Vue.use(JsonEditorVue, {
232232

233233
#### CDN + UMD
234234

235-
> ⚠ 暂不支持`vanilla-jsoneditor` 不提供 UMD 导出,如有需要请在[这里](https://github.com/josdejong/svelte-jsoneditor/discussions/196)留言。
235+
> ⚠ 暂不支持 (`vanilla-jsoneditor` 不提供 UMD 导出),如有需要请在[这里](https://github.com/josdejong/svelte-jsoneditor/discussions/196)留言。
236236
237237
```html
238238
<!DOCTYPE html>
@@ -362,7 +362,7 @@ Vue.use(JsonEditorVue, {
362362

363363
#### CDN + UMD
364364

365-
> ⚠ 暂不支持`vanilla-jsoneditor` 不提供 UMD 导出,如有需要请在[这里](https://github.com/josdejong/svelte-jsoneditor/discussions/196)留言。
365+
> ⚠ 暂不支持 (`vanilla-jsoneditor` 不提供 UMD 导出),如有需要请在[这里](https://github.com/josdejong/svelte-jsoneditor/discussions/196)留言。
366366
367367
```html
368368
<!DOCTYPE html>
@@ -687,8 +687,8 @@ export default {
687687

688688
### `svelte-jsoneditor``json-editor-vue` 中绑定值的差异
689689

690-
- `svelte-jsoneditor`: 一个包含stringified JSON」或「parsed JSON的对象,当作为stringified JSON传入时,会经过 `JSON.parse` 解析。
691-
- `json-editor-vue`: JSON 本身,所见即所得。
690+
- `svelte-jsoneditor`一个包含stringified JSON” 或 “parsed JSON的对象,当作为stringified JSON传入时,会经过 `JSON.parse` 解析。
691+
- `json-editor-vue`JSON 本身,所见即所得。
692692

693693
如果你更倾向于 `svelte-jsoneditor` 的行为:
694694

@@ -700,7 +700,7 @@ export default {
700700
/>
701701
```
702702

703-
> 详情见 https://github.com/josdejong/svelte-jsoneditor/pull/166
703+
> 详情见 https://github.com/josdejong/svelte-jsoneditor/pull/166。
704704
705705
### 布尔类型参数
706706

@@ -749,7 +749,7 @@ import JsonEditorVue from 'json-editor-vue'
749749

750750
## 更新日志
751751

752-
各版本详细改动请参考 [release notes](https://github.com/cloydlau/json-editor-vue/releases)
752+
各版本详细改动请参考 [release notes](https://github.com/cloydlau/json-editor-vue/releases)
753753

754754
<br>
755755

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,10 @@
4444
"dev2.6": "cl switchVue 2.6 && vite --config ./demo/vue2.6/vite.config.ts --open",
4545
"serve": "vite preview",
4646
"doc": "vitepress dev --open /README",
47-
"lint": "eslint --cache {src,__tests__}/**.*",
4847
"build": "vite build",
4948
"test-unit": "vitest run",
5049
"coverage": "vitest run --coverage",
51-
"release": "npx case-police --fix && npx lint-staged && pnpm test-unit && pnpm build && cl release"
50+
"release": "npx case-police --fix && npx zhlint docs/README.zh-CN.md --fix && npx lint-staged && pnpm test-unit && pnpm build && cl release"
5251
},
5352
"peerDependencies": {
5453
"@vue/composition-api": ">=1",
@@ -70,7 +69,7 @@
7069
"@commitlint/cli": "^17.3.0",
7170
"@commitlint/config-conventional": "^17.3.0",
7271
"@types/lodash-es": "^4.17.6",
73-
"@types/node": "^18.11.16",
72+
"@types/node": "^18.11.17",
7473
"@vitejs/plugin-vue": "^4.0.0",
7574
"@vitest/coverage-c8": "^0.25.8",
7675
"@vitest/ui": "^0.25.8",
@@ -80,7 +79,7 @@
8079
"eslint": "^8.30.0",
8180
"happy-dom": "^8.1.0",
8281
"husky": "^8.0.2",
83-
"json-editor-vue": "^0.10.2",
82+
"json-editor-vue": "^0.10.4",
8483
"lint-staged": "^13.1.0",
8584
"lossless-json": "^2.0.3",
8685
"typescript": "^4.9.4",
@@ -90,7 +89,8 @@
9089
"vite-plugin-dts": "^1.7.1",
9190
"vitepress": "1.0.0-alpha.32",
9291
"vitest": "^0.25.8",
93-
"vue": "^3.2.45"
92+
"vue": "^3.2.45",
93+
"zhlint": "^0.7.1"
9494
},
9595
"lint-staged": {
9696
"{src,__tests__}/**.*": [
@@ -100,4 +100,4 @@
100100
"publishConfig": {
101101
"registry": "https://registry.npmjs.org"
102102
}
103-
}
103+
}

0 commit comments

Comments
 (0)