配置setting.json
{
"editor.largeFileOptimizations": false,
"editor.fontSize": 15,
"bracketPairColorizer.depreciation-notice": false,
"files.autoSave": "onFocusChange",
"workbench.preferredLightColorTheme": "Visual Studio Light",
"liveServer.settings.donotShowInfoMsg": true,
"liveServer.settings.CustomBrowser": "chrome",
"security.workspace.trust.untrustedFiles": "open",
"editor.tokenColorCustomizations": {
"comments": "#3ee5eb"
},
"emmet.showSuggestionsAsSnippets": true,
"kite.showWelcomeNotificationOnStartup": false,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"javascript.referencesCodeLens.showOnAllFunctions": true,
"javascript.referencesCodeLens.enabled": true,
"typescript.inlayHints.functionLikeReturnTypes.enabled": true,
"typescript.inlayHints.propertyDeclarationTypes.enabled": true,
"typescript.inlayHints.parameterTypes.enabled": true,
"typescript.inlayHints.variableTypes.enabled": true,
"explorer.compactFolders": false,
"workbench.editor.untitled.hint": "hidden",
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs": "active",
"emmet.triggerExpansionOnTab": true,
"js/ts.implicitProjectConfig.strictFunctionTypes": false,
"redhat.telemetry.enabled": true,
// 換行
"editor.wordWrap": "on",
// 是否允许自定义的snippet片段提示
"editor.snippetSuggestions": "top",
// vscode默认启用了根据文件类型自动设置tabsize的选项 不檢查縮進,保存后統一按設置項來設置
"editor.detectIndentation": false,
// 重新设定tabsize 代码缩进修改成 4 个空格
"editor.tabSize": 4,
// #每次保存的时候自动格式化
"editor.formatOnSave": true,
// #每次保存的时候将代码按eslint格式进行修复 使用eslint 風格使用standard 進行代碼規則限制
"editor.fontWeight": "200",
"editor.formatOnType": true,
"git.confirmSync": false,
"team.showWelcomeMessage": false,
"window.zoomLevel": 0,
"editor.renderWhitespace": "boundary",
"editor.cursorBlinking": "smooth",
"editor.wordWrapColumn": 100,
"editor.minimap.enabled": false,
"window.title": "${dirty}${activeEditorMedium}${separator}${rootName}",
"editor.codeLens": true,
// eslint 代码自动检查相关配置
"eslint.enable": true,
"eslint.run": "onType",
"eslint.options": {
"plugins": ["html", "vue"],
"extensions": [".js", ".vue"]
},
"eslint.codeAction.showDocumentation": {
"enable": true
},
/* prettier格式化 */
/* prettier格式化的配置 start */
"prettier.printWidth": 800, // 超过最大值换行
"prettier.tabWidth": 4, // 缩进字节数
"prettier.useTabs": false, // 缩进不使用tab,使用空格
"prettier.semi": true, // 句尾添加分号
"prettier.singleQuote": true, // 使用单引号代替双引号
"prettier.proseWrap": "preserve", // 默认值。因为使用了一些折行敏感型的渲染器(如GitHub comment)而按照markdown文本样式进行折行
"prettier.arrowParens": "avoid", // (x) => {} 箭头函数参数只有一个时是否要有小括号。avoid:省略括号
"prettier.bracketSpacing": true, // 在对象,数组括号与文字之间加空格 "{ foo: bar }"
// "prettier.disableLanguages": ["vue"], // 不格式化vue文件,vue文件的格式化单独设置
"prettier.endOfLine": "auto", // 结尾是 \n \r \n\r auto
"prettier.eslintIntegration": false, //不让prettier使用eslint的代码格式进行校验
"prettier.htmlWhitespaceSensitivity": "ignore",
"prettier.ignorePath": ".prettierignore", // 不使用prettier格式化的文件填写在项目的.prettierignore文件中
"prettier.jsxBracketSameLine": false, // 在jsx中把'>' 是否单独放一行
"prettier.jsxSingleQuote": false, // 在jsx中使用单引号代替双引号
"prettier.parser": "babylon", // 格式化的解析器,默认是babylon
"prettier.requireConfig": false, // Require a 'prettierconfig' to format prettier
"prettier.stylelintIntegration": false, //不让prettier使用stylelint的代码格式进行校验
/* prettier格式化的配置 end */
// #让函数(名)和后面的括号之间加个空格
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
// 格式化stylus, 需安装Manta's Stylus Supremacy插件
"stylusSupremacy.insertColons": false, // 是否插入冒号
"stylusSupremacy.insertSemicolons": false, // 是否插入分号
"stylusSupremacy.insertBraces": false, // 是否插入大括号
"stylusSupremacy.insertNewLineAroundImports": false, // import之后是否换行
"stylusSupremacy.insertNewLineAroundBlocks": false, // 两个选择器中是否换行
"explorer.confirmDelete": false,
"files.associations": {
"*.cjson": "jsonc",
"*.wxss": "css",
"*.wxs": "javascript"
},
"emmet.includeLanguages": {
"wxml": "html"
},
"minapp-vscode.disableAutoConfig": true,
"window.menuBarVisibility": "visible",
"git.enableSmartCommit": true,
"git.autofetch": true,
// 設置行高
"editor.lineHeight": 20,
"search.followSymlinks": false,
"workbench.sideBar.location": "left",
"vscode_custom_css.policy": true,
"javascript.format.placeOpenBraceOnNewLineForControlBlocks": true,
"editor.formatOnPaste": true,
"vsicons.presets.hideFolders": true,
"editor.cursorStyle": "line-thin",
"editor.suggestSelection": "recentlyUsedByPrefix",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
// #每次保存的时候将代码按照 eslint 格式进行修复
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"terminal.integrated.rendererType": "dom",
"vscode_vibrancy.opacity": 1,
"npm.fetchOnlinePackageInfo": false,
"java.import.gradle.offline.enabled": true,
"files.simpleDialog.enable": true,
"calva.referencesCodeLens.enabled": true,
"eslint.format.enable": true,
"eslint.lintTask.enable": true,
"java.signatureHelp.description.enabled": true,
"java.signatureHelp.enabled": true,
"vscodeReactRefactor.enableDebug": true,
"vitest.enable": true,
"vite.https": true,
"javascript.inlayHints.propertyDeclarationTypes.enabled": true,
"tslint.jsEnable": true,
"npm.enableRunFromFolder": true,
"reactSnippets.settings.prettierEnabled": true,
"todo-tree.general.enableFileWatcher": true,
"todo-tree.tree.buttons.groupBySubTag": true,
"target": "es6",
"vetur.format.options.tabSize": 4,
"vetur.format.scriptInitialIndent": true, // js部分是否有初始缩进
"vetur.format.styleInitialIndent": true, // style部分是否有初始缩进
"vetur.completion.scaffoldSnippetSources": {},
"vetur.format.defaultFormatter.html": "js-beautify-html", // js 不换行
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "auto", // html 标签属性 换行设置[auto|force|force-aligned|force-expand-multiline] ["auto"]
"end_with_newline": false, // 在文件结尾添加新行
"wrap_line_length": 120,
"semi": false // 是否在每行末尾添加分号
},
"prettyhtml": {
"singleQuote": false,
"wrapAttributes": false,
"sortAttributes": false
},
"prettier": {
// 不加分号
"semi": false,
// 用单引号
"singleQuote": true,
// 禁止随时添加逗号
"trailingComma": "none"
}
},
// 显示 markdown 中英文切换时产生的特殊字符
"editor.renderControlCharacters": true,
// 新开窗口
"workbench.startupEditor": "newUntitledFile",
// 默认 lf 结尾
"files.eol": "\n",
// vscode update tips
"update.mode": "none",
// Internal terminal
"code-runner.runInTerminal": true,
"code-runner.fileDirectoryAsCwd": true,
// vscode Suggested expansion
"extensions.ignoreRecommendations": false,
"editor.defaultFormatter": "octref.vetur",
"vue-helper.indent-size": 4,
"vue3snippets.useTabs": true,
"vue3snippets.tabWidth": 4,
"vue3snippets.jsxBracketSameLine": true,
"vue3snippets.jsxSingleQuote": true,
"vue3snippets.insertPragma": true,
"vue3snippets.requirePragma": true,
"vue3snippets.vueIndentScriptAndStyle": true,
"easysass.compileAfterSave": true,
"easysass.formats": [
{
"format": "nested",
"extension": ".css"
},
{
"format": "nested",
"extension": ".css"
}
],
"easysass.targetDir": "css/",
"editor.parameterHints": true,
"editor.quickSuggestions": {
"other": true,
"comments": true,
"strings": true
},
"workbench.editor.enablePreview": false,
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
},
"editor.minimap.renderCharacters": false,
"javascript.validate.enable": false,
"editor.inlayHints.enabled": "off",
"javascript.inlayHints.enumMemberValues.enabled": true,
"javascript.inlayHints.functionLikeReturnTypes.enabled": true,
"editor.tabCompletion": "onlySnippets",
"vetur.format.options.useTabs": true,
"[html]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"[sass]": {
"editor.defaultFormatter": "syler.sass-indented"
},
//-------- Code Spell Checker Configuration --------
// The Language locale to use when spell checking. "en", "en-US" and "en-GB" are currently supported by default.
"cSpell.language": "en",
// Controls the maximum number of spelling errors per document.
"cSpell.maxNumberOfProblems": 100,
// Controls the number of suggestions shown.
"cSpell.numSuggestions": 8,
// The minimum length of a word before checking it against a dictionary.
"cSpell.minWordLength": 4,
// Specify file types to spell check.
"cSpell.enabledLanguageIds": ["csharp", "go", "javascript", "javascriptreact", "markdown", "php", "plaintext", "typescript", "typescriptreact", "yml"],
// Enable / Disable the spell checker.
"cSpell.enabled": true,
// Display the spell checker status on the status bar.
"cSpell.showStatus": true,
// Words to add to dictionary for a workspace.
"cSpell.words": [],
// Enable / Disable compound words like 'errormessage'
"cSpell.allowCompoundWords": false,
// Words to be ignored and not suggested.
"cSpell.ignoreWords": ["behaviour"],
// User words to add to dictionary. Should only be in the user settings.
"cSpell.userWords": [],
// Specify paths/files to ignore.
"cSpell.ignorePaths": [
"node_modules", // this will ignore anything the node_modules directory
"**/node_modules", // the same for this one
"**/node_modules/**", // the same for this one
"node_modules/**", // Doesn't currently work due to how the current working directory is determined.
"vscode-extension", //
".git", // Ignore the .git directory
"*.dll", // Ignore all .dll files.
"**/*.dll" // Ignore all .dll files
]
}
标签:false,vscode,eslint,enabled,json,setting,editor,true,prettier From: https://www.cnblogs.com/zhaostudy/p/16587780.html