chore: setup vscode settings (#72)

This commit is contained in:
tecvan 2025-03-20 17:32:52 +08:00 committed by GitHub
parent 95c6b58264
commit a60840756c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 210 additions and 4 deletions

2
.gitignore vendored
View File

@ -94,7 +94,7 @@ jspm_packages/
*.iml *.iml
# Visual Studio Code # Visual Studio Code
.vscode/settings.json !.vscode/settings.json
!.vscode/tasks.json !.vscode/tasks.json
!.vscode/launch.json !.vscode/launch.json

185
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,185 @@
{
"eslint.nodePath": "config/eslint-config/node_modules/eslint",
"prettier.prettierPath": "config/eslint-config/node_modules/prettier",
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.formatOnSave": true,
"editor.formatOnType": false,
"editor.formatOnPaste": false,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
// "source.sortImports": "always"
},
"workbench.editorAssociations": {
"*.mdc": "default"
},
"editor.formatOnSaveMode": "modificationsIfAvailable",
"search.followSymlinks": false,
"search.exclude": {
"**/node_modules": true,
"**/.nyc_output": true,
"**/.rush": true,
"**/pnpm-lock.yaml": true,
"**/CHANGELOG.json": true,
"**/CHANGELOG.md": true,
"common/changes": true,
"**/output": true,
"**/lib": true,
"**/dist": true,
"**/coverage": true,
"common/temp": true
},
"eslint.workingDirectories": [
{
"mode": "auto"
}
],
"files.defaultLanguage": "plaintext",
"files.associations": {
".code-workspace": "jsonc",
".babelrc": "json",
".eslintrc": "jsonc",
".eslintrc*.json": "jsonc",
".stylelintrc": "javascript",
"stylelintrc": "jsonc",
"*.json": "jsonc",
"package.json": "json",
".htmlhintrc": "jsonc",
"htmlhintrc": "jsonc",
"Procfile*": "shellscript",
"README": "markdown",
"**/coverage/**/*.*": "plaintext",
"OWNERS": "yaml",
// pnpm-lock file plaintext vscode
"**/pnpm-lock.yaml": "plaintext",
"**/dist/**": "plaintext",
"**/dist_*/**": "plaintext",
"*.map": "plaintext",
"*.log": "plaintext"
},
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"**/.rush": true,
"**/.swc": true,
"**/rush-logs": true
},
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/*/**": true
},
"search.useIgnoreFiles": true,
//
"editor.rulers": [80, 120],
"files.eol": "\n",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"cSpell.diagnosticLevel": "Warning",
"eslint.probe": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"editor.semanticHighlighting.enabled": false,
"eslint.format.enable": false,
"eslint.enable": true,
"eslint.useFlatConfig": true,
"eslint.codeActionsOnSave.mode": "problems",
"eslint.lintTask.enable": false,
"javascript.validate.enable": false,
"typescript.tsdk": "config/ts-config/node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.disableAutomaticTypeAcquisition": true,
"typescript.format.enable": false,
"typescript.referencesCodeLens.enabled": false,
"typescript.preferGoToSourceDefinition": true,
"typescript.updateImportsOnFileMove.enabled": "never",
// tsserver log
"typescript.tsserver.log": "off",
"typescript.tsserver.experimental.enableProjectDiagnostics": false,
"typescript.workspaceSymbols.excludeLibrarySymbols": true,
"editor.minimap.enabled": true,
"typescript.preferences.includePackageJsonAutoImports": "off",
"typescript.suggest.autoImports": true,
"typescript.tsserver.maxTsServerMemory": 10240,
"typescript.tsserver.enableRegionDiagnostics": false,
"typescript.tsserver.watchOptions": {
"fallbackPolling": "dynamicPriorityPolling",
"synchronousWatchDirectory": true,
"watchDirectory": "useFsEvents",
"watchFile": "useFsEventsOnParentDirectory",
"excludeDirectories": ["/**/node_modules"],
"excludeLibrarySymbols": true,
"excludeFiles": ["/**/node_modules/**"]
},
"css.validate": false,
"scss.validate": false,
"less.validate": false,
"stylelint.enable": true,
"stylelint.validate": ["css", "scss", "less"],
// "stylelint.stylelintPath": "config/stylelint-config/node_modules/stylelint",
"emmet.triggerExpansionOnTab": true,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[less]": {
"editor.defaultFormatter": "stylelint.vscode-stylelint"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[ignore]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
},
"[shellscript]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
},
"[dotenv]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
},
"[svg]": {
"editor.defaultFormatter": "jock.svg"
},
"svg.preview.background": "white",
"[xml]": {
"editor.defaultFormatter": "mblode.pretty-formatter"
},
"[sql]": {
"editor.defaultFormatter": "adpyke.vscode-sql-formatter"
},
"git.openRepositoryInParentFolders": "always",
"references.preferredLocation": "view"
}

View File

@ -183,6 +183,14 @@
"autoinstallerName": "rush-lint-staged", "autoinstallerName": "rush-lint-staged",
"shellCommand": "lint-staged --config common/autoinstallers/rush-lint-staged/.lintstagedrc.js" "shellCommand": "lint-staged --config common/autoinstallers/rush-lint-staged/.lintstagedrc.js"
}, },
{
"name": "commitlint",
"commandKind": "global",
"summary": "⭐️️ Used by the pre-commit Git hook. This command invokes commitlint to ensure that the commit messages meet the conventional commit format",
"safeForSimultaneousRushProcesses": true,
"autoinstallerName": "rush-commitlint",
"shellCommand": "commitlint"
},
// //
{ {
"name": "check-circular-dependency", "name": "check-circular-dependency",
@ -290,7 +298,7 @@
"autoinstallerName": "rush-commands", "autoinstallerName": "rush-commands",
"safeForSimultaneousRushProcesses": true, "safeForSimultaneousRushProcesses": true,
"shellCommand": "concurrently --kill-others --prefix \"{name}\" --names [watch],[demo] -c white,blue \"rush build:watch --to-except @flowgram.ai/demo-free-layout-simple\" \"cd apps/demo-free-layout-simple && rushx dev\"" "shellCommand": "concurrently --kill-others --prefix \"{name}\" --names [watch],[demo] -c white,blue \"rush build:watch --to-except @flowgram.ai/demo-free-layout-simple\" \"cd apps/demo-free-layout-simple && rushx dev\""
}, }
], ],
/** /**
@ -511,5 +519,20 @@
// } // }
// ] // ]
// } // }
{
"parameterKind": "string",
"argumentName": "MESSAGE",
"longName": "--edit",
"description": "",
"associatedCommands": ["commitlint"]
},
{
"parameterKind": "string",
"argumentName": "MESSAGE",
"longName": "--config",
"description": "",
"associatedCommands": ["commitlint"]
}
] ]
} }

View File

@ -34,6 +34,4 @@ else
node common/scripts/install-run-rush.js -q commitlint \ node common/scripts/install-run-rush.js -q commitlint \
--config common/autoinstallers/rush-commitlint/commitlint.config.js \ --config common/autoinstallers/rush-commitlint/commitlint.config.js \
--edit "$1" || exit 1 --edit "$1" || exit 1
# 如果当前分支是 main 分支,则不进行推送
node infra/rush-x/bin/run change || exit 1
fi fi