File tree Expand file tree Collapse file tree 8 files changed +27
-71
lines changed Expand file tree Collapse file tree 8 files changed +27
-71
lines changed Original file line number Diff line number Diff line change 1
- node_modules
1
+ node_modules
2
+ .idea
3
+ .github
4
+ .husky
Original file line number Diff line number Diff line change 65
65
66
66
- name : Code LintFix
67
67
run : |
68
- ./scripts/lint --fix
68
+ bash ./scripts/lint
69
69
70
70
- name : Build Site
71
71
run : |
Original file line number Diff line number Diff line change 7
7
.DS_Store
8
8
* /.vscode
9
9
.idea
10
- # Diagnostic reports (https://nodejs.org/api/report.html)
11
- report. [0-9 ]* . [0-9 ]* . [0-9 ]* . [0-9 ]* .json
12
-
13
- # docs/.vuepress
14
- pids
15
- * .pid
16
- * .seed
17
- * .pid.lock
18
-
19
10
# Coverage directory used by tools like istanbul
20
11
coverage
21
12
* .lcov
22
-
23
13
# nyc test coverage
24
14
.nyc_output
25
-
26
-
27
15
# Dependency directories
28
16
node_modules /
29
17
jspm_packages /
30
-
31
18
# TypeScript v1 declaration files
32
19
typings /
33
-
34
- # TypeScript cache
35
- * .tsbuildinfo
36
-
37
20
# Optional npm cache directory
38
21
.npm
39
-
40
- # Optional eslint cache
41
- .eslintcache
42
-
43
- # Microbundle cache
44
- .rpt2_cache /
45
- .rts2_cache_cjs /
46
- .rts2_cache_es /
47
- .rts2_cache_umd /
48
-
49
22
# Output of 'npm pack'
50
23
* .tgz
51
-
52
-
53
- # dotenv environment variables file
54
- .env
55
- .env.test
56
-
57
24
# parcel-bundler cache (https://parceljs.org/)
58
25
.cache
59
-
60
26
# Next.js build output
61
27
.next
62
-
63
28
.nuxt
64
29
dist
65
-
66
30
# Gatsby files
67
31
.cache /
68
-
69
-
70
32
# vuepress build output
71
33
# .vuepress/dist
72
-
73
- # # static resource
74
34
docs /.vuepress /.cache /
75
35
docs /.vuepress /.temp /
76
36
docs /.vuepress /dist /
77
-
78
-
79
37
# TernJS port file
80
38
.tern-port
81
- /docs /.vuepress /.temp /
82
39
/.husky /
Original file line number Diff line number Diff line change 1
- // 参考:https://github.com/updownpress/markdown-lint/tree/master/rules
1
+ // 参考:< https://github.com/updownpress/markdown-lint/tree/master/rules>
2
2
module . exports = {
3
3
"default" : true ,
4
4
"MD001" : false ,
@@ -69,4 +69,4 @@ module.exports = {
69
69
"MD042" : false ,
70
70
"MD046" : false ,
71
71
"MD049" : false
72
- }
72
+ }
Original file line number Diff line number Diff line change 1
1
** /node_modules /**
2
- CHANGELOG.md
3
2
LICENSE
3
+ .idea
4
+ .husky
5
+ .github
Original file line number Diff line number Diff line change 9
9
},
10
10
"scripts" : {
11
11
"preinstall" : " chmod +x ./scripts/*" ,
12
- "prepare" : " rm -f .husky/pre-commit && husky install && npx husky add .husky/pre-commit \" ./scripts/lint --fix\" && chmod +x .husky/pre-commit" ,
13
12
"dev" : " vuepress dev docs" ,
14
13
"build" : " vuepress build docs" ,
15
14
"build:proxy" : " ./scripts/bundle build_proxy" ,
Original file line number Diff line number Diff line change 37
37
38
38
# 安装项目依赖
39
39
pnpm i --frozen-lockfile --registry https://registry.npmmirror.com
40
-
Original file line number Diff line number Diff line change 1
- #!/usr/ bin/env node
1
+ #! /bin/bash
2
2
3
- /**
4
- *
5
- * 格式化代码
6
- * 例如:
7
- * - ./scripts/lint
8
- * - ./scripts/lint --fix
9
- */
3
+ # #
4
+ # # 自动格式化
5
+ # # - 代码
6
+ # # - markdown文档
7
+ # # 使用:
8
+ # - ./scripts/lint
9
+ # # 参考链接:
10
+ # # - https://eslint.org/docs/latest/use/getting-started
11
+ # # - https://github.com/igorshubovych/markdownlint-cli
12
+ # #
10
13
11
- const { execShell } = require ( './.exec' )
12
- const scriptName = process . argv [ 2 ]
13
- const fixed = scriptName != null ? '--fix' : '' ;
14
+ # 设置 PATH 环境变量,避免command not found问题
15
+ export PATH=" $( pnpm bin) :$PATH "
14
16
15
- // 格式化代码
16
- const lintCode = ` eslint ${ fixed } --ext .js,.ts,.vue --ignore-path .gitignore .` ;
17
+ # ESLint格式化代码
18
+ eslint --fix --ext .js,.ts,.vue --ignore-path .gitignore .
17
19
18
- // 遍历格式化docs目录下的markdown 文档
19
- const lintMd = 'find docs -type f -name \"*.md\" -print0 | xargs -0 -I {} markdownlint -c .markdownlint.js --fix {}' ;
20
-
21
- // 可以在--fix后指定目录
22
- ( async ( ) => await execShell ( [
23
- lintCode ,
24
- lintMd
25
- ] ) ) ( )
20
+ # markdown-cli格式化markdown 文档
21
+ markdownlint ' **/*.md' -c .markdownlint.js -p .markdownlintignore --fix
26
22
You can’t perform that action at this time.
0 commit comments