Skip to content

Commit

Permalink
更新lint与zhlint配置文件
Browse files Browse the repository at this point in the history
  • Loading branch information
guanguans committed Apr 30, 2024
1 parent 4e9add5 commit fb50f6d
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 19 deletions.
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

[*.{vue,js,scss}]
indent_size = 2
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml,xml,xml.dist}]
indent_size = 2
22 changes: 9 additions & 13 deletions .github/workflows/lint-md.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: lint markdown

on: [push, pull_request]
on: [workflow_dispatch, push, pull_request]

jobs:
lint-markdown:
Expand All @@ -12,18 +12,14 @@ jobs:
- name: Set node version
uses: actions/setup-node@v4

- name: Install dependencies
run: npm install
- name: Install lint-md
run: npm install @lint-md/cli -g

- name: Lint markdown
run: npm run md-fix
- name: Install zhlint
run: npm install zhlint -g

- name: Lint zh_CN
run: npm run zh-fix
- name: Lint markdown
run: lint-md 'README.md' --config=.lintmdrc --threads

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_options: '--no-verify'
commit_message: Fix markdown
file_pattern: '*.md */*.md */*/*.md'
# - name: Lint zh_CN
# run: zhlint 'README.md' --config=.zhlintrc
28 changes: 22 additions & 6 deletions .lintmdrc
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
{
"excludeFiles": [
"src/",
"tests/",
"vendor/"
"./.build/**",
"./.github/**",
"./node_modules/**",
"./vendor/**",
"./vendor-bin/**"
],
"rules": {
"no-empty-code": 1,
"space-around-alphabet": 2,
"space-around-number": 2,
"no-empty-code-lang": 2,
"no-empty-url": 2,
"no-empty-list": 2,
"no-empty-code": 2,
"no-empty-inline-code": 2,
"no-empty-blockquote": 2,
"no-special-characters": 2,
"use-standard-ellipsis": 2,
"no-fullwidth-number": 2,
"no-space-in-link": 2,
"no-multiple-space-blockquote": 2,
"correct-title-trailing-punctuation": 2,
"no-space-in-inline-code": 2,
"no-long-code": [
2,
{
"length": 256,
"length": 120,
"exclude": [
"dot"
]
}
]
}
}
}
6 changes: 6 additions & 0 deletions .zhlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/.build
/.github
/node_modules
/vendor
/vendor-bin
/传说部分/地方传说/鸠龙岗的来历.md
7 changes: 7 additions & 0 deletions .zhlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"preset": "default",
"rules": {
"noSinglePair": false,
"noSpaceBetweenFullwidthContent": false
}
}

0 comments on commit fb50f6d

Please sign in to comment.