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 6565
6666 - name : Code LintFix
6767 run : |
68- ./scripts/lint --fix
68+ bash ./scripts/lint
6969
7070 - name : Build Site
7171 run : |
Original file line number Diff line number Diff line change 77.DS_Store
88* /.vscode
99.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-
1910# Coverage directory used by tools like istanbul
2011coverage
2112* .lcov
22-
2313# nyc test coverage
2414.nyc_output
25-
26-
2715# Dependency directories
2816node_modules /
2917jspm_packages /
30-
3118# TypeScript v1 declaration files
3219typings /
33-
34- # TypeScript cache
35- * .tsbuildinfo
36-
3720# Optional npm cache directory
3821.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-
4922# Output of 'npm pack'
5023* .tgz
51-
52-
53- # dotenv environment variables file
54- .env
55- .env.test
56-
5724# parcel-bundler cache (https://parceljs.org/)
5825.cache
59-
6026# Next.js build output
6127.next
62-
6328.nuxt
6429dist
65-
6630# Gatsby files
6731.cache /
68-
69-
7032# vuepress build output
7133# .vuepress/dist
72-
73- # # static resource
7434docs /.vuepress /.cache /
7535docs /.vuepress /.temp /
7636docs /.vuepress /dist /
77-
78-
7937# TernJS port file
8038.tern-port
81- /docs /.vuepress /.temp /
8239/.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>
22module . exports = {
33 "default" : true ,
44 "MD001" : false ,
@@ -69,4 +69,4 @@ module.exports = {
6969 "MD042" : false ,
7070 "MD046" : false ,
7171 "MD049" : false
72- }
72+ }
Original file line number Diff line number Diff line change 11** /node_modules /**
2- CHANGELOG.md
32LICENSE
3+ .idea
4+ .husky
5+ .github
Original file line number Diff line number Diff line change 99 },
1010 "scripts" : {
1111 "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" ,
1312 "dev" : " vuepress dev docs" ,
1413 "build" : " vuepress build docs" ,
1514 "build:proxy" : " ./scripts/bundle build_proxy" ,
Original file line number Diff line number Diff line change 3737
3838# 安装项目依赖
3939pnpm 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
22
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+ # #
1013
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 "
1416
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 .
1719
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
2622
You can’t perform that action at this time.
0 commit comments