-
-
Notifications
You must be signed in to change notification settings - Fork 111
ci(lint): Add code formatting tools #763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b081408
ci(lint): 添加tony's vscode代码风格控制
NoiseFan 13cd8c2
ci(lint): 添加Lint Staged
NoiseFan f98116b
ci(lint): 添加vscode 插件建议
NoiseFan feeef1f
ci: add autofix for pr
NoiseFan a802aa5
ci: 移除vscode相关的推荐
NoiseFan 011c4c0
ci: 合并上游eslint规则,并解决eslint报错
NoiseFan f724e3b
Merge branch 'dev' into ci/lint_fix
NoiseFan c3eeb91
fix: 修复文件中的lint错误
NoiseFan 5b5544d
ci: 移除vscode相关的推荐
NoiseFan 3816098
fix: 修复文件中的lint错误
NoiseFan f9abcbc
fix: lint error
NoiseFan 7a40a3e
Merge branch 'dev' into ci/lint_fix
NoiseFan 9b98e8f
chore(ci): add simple-git-hooks & prepare command
NoiseFan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| name: autofix.ci | ||
|
|
||
| on: | ||
| pull_request: | ||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| autofix: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Use Node.js lts/* | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: lts/* | ||
|
|
||
| - name: Setup | ||
| run: npm i -g @antfu/ni | ||
|
|
||
| - name: Install | ||
| run: nci | ||
|
|
||
| - name: Lint | ||
| run: nr lint --fix | ||
|
|
||
| - uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,5 +17,4 @@ cypress/downloads | |
| cypress/screenshots | ||
| public/user-avatars | ||
| public/sponsors | ||
| .vscode | ||
| .vitepress/cache | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "recommendations": [ | ||
| "dbaeumer.vscode-eslint" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| { | ||
| // Disable the default formatter, use eslint instead | ||
| "prettier.enable": false, | ||
| "editor.formatOnSave": false, | ||
|
|
||
| // Auto fix | ||
| "editor.codeActionsOnSave": { | ||
| "source.fixAll.eslint": "explicit", | ||
| "source.organizeImports": "never" | ||
| }, | ||
|
|
||
| // Silent the stylistic rules in your IDE, but still auto fix them | ||
| "eslint.rules.customizations": [ | ||
| { "rule": "style/*", "severity": "off", "fixable": true }, | ||
| { "rule": "format/*", "severity": "off", "fixable": true }, | ||
| { "rule": "*-indent", "severity": "off", "fixable": true }, | ||
| { "rule": "*-spacing", "severity": "off", "fixable": true }, | ||
| { "rule": "*-spaces", "severity": "off", "fixable": true }, | ||
| { "rule": "*-order", "severity": "off", "fixable": true }, | ||
| { "rule": "*-dangle", "severity": "off", "fixable": true }, | ||
| { "rule": "*-newline", "severity": "off", "fixable": true }, | ||
| { "rule": "*quotes", "severity": "off", "fixable": true }, | ||
| { "rule": "*semi", "severity": "off", "fixable": true } | ||
| ], | ||
|
|
||
| // Enable eslint for all supported languages | ||
| "eslint.validate": [ | ||
| "javascript", | ||
| "javascriptreact", | ||
| "typescript", | ||
| "typescriptreact", | ||
| "vue", | ||
| "html", | ||
| "markdown", | ||
| "json", | ||
| "jsonc", | ||
| "yaml", | ||
| "toml", | ||
| "xml", | ||
| "gql", | ||
| "graphql", | ||
| "astro", | ||
| "svelte", | ||
| "css", | ||
| "less", | ||
| "scss", | ||
| "pcss", | ||
| "postcss" | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.