一直用idea,今天有个需求得用vscode,发现格式化不好使了

用 vetur 格式化

结果带分行什么的,eslint 过去不了,更新了个好使的配置,记录一下。

{
"update.mode": "manual",
"extensions.autoUpdate": false,
"extensions.autoCheckUpdates": false,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.fontSize": 22,
"editor.fontFamily": "Consolas, 'Courier New', monospace",
"editor.fontLigatures": false,
"editor.fontWeight": "400",
"editor.lineHeight": 28,
"editor.letterSpacing": 0,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": true,
"editor.wordWrap": "off",
"editor.renderLineHighlight": "gutter",
"editor.roundedSelection": true,
"editor.renderControlCharacters": true,
"editor.renderIndentGuides": true,
"editor.dragAndDrop": false,
"editor.minimap.enabled": false,
"editor.minimap.showSlider": "mouseover",
"editor.minimap.renderCharacters": true,
"editor.minimap.maxColumn": 200,
"editor.quickSuggestions": {
"strings": true
},
"editor.suggestSelection": "first",
"window.titleBarStyle": "native",
"window.menuBarVisibility": "visible",
"window.title": "${rootName} - ${dirty}${activeEditorLong}",
"workbench.colorTheme": "Spacegray Eighties Dark",
"workbench.iconTheme": "material-icon-theme",
"workbench.startupEditor": "welcomePage",
"workbench.activityBar.visible": true,
"workbench.sideBar.location": "left",
"workbench.editor.enablePreview": true,
"workbench.editor.tabSizing": "fit",
"workbench.editor.wrapTabs": false,
"workbench.editor.decorations.colors": true,
"workbench.editor.decorations.badges": true,
"workbench.tree.renderIndentGuides": "none",
"workbench.colorCustomizations": {
// "statusBar.background": "#333333",
// "statusBar.foreground": "#adadad",
"terminal.background": "#000000",
"terminal.foreground": "#FFFFFF"
},
"breadcrumbs.enabled": true,
"breadcrumbs.symbolPath": "off",
"explorer.openEditors.visible": 0,
"explorer.compactFolders": false,
"files.encoding": "utf8",
"files.eol": "\r\n",
"files.hotExit": "onExit",
"files.autoSave": "off",
"emmet.includeLanguages": {
"javascript": "javascriptreact"
},
//javascript
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"js/ts.implicitProjectConfig.experimentalDecorators": true,
//git
"git.path": "D:\\Git\\bin\\git.exe",
"git.enableSmartCommit": false,
//terminal
//"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\cmd.exe",
//"terminal.integrated.shell.windows": "D:\\Git\\git-bash.exe",
"terminal.explorerKind": "integrated",
//eslint
"eslint.format.enable": false,
"eslint.validate": [
"javascript",
"javascriptreact",
"vue",
"typescript",
"typescriptreact"
],
//bookmarks
"bookmarks.saveBookmarksInProject": true,
//vetur
"vetur.format.defaultFormatter.js": "vscode-typescript",
"vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "force-aligned"
}
},
"vetur.validation.template": false,
//liveServer
"liveServer.settings.donotVerifyTags": true,
//alias-skip
"alias-skip.mappings": {
"@": "/src",
"_c": "/src/components"
},
"[vue]": {
"editor.defaultFormatter": "hikerpig.vetur"
},
"[markdown]": {
"editor.wordWrap": "on",
"editor.quickSuggestions": false,
"editor.formatOnSave": false
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
// {
// // #让prettier使用eslint的代码格式进行校验
// "javascript.format.enable": false,
// "javascript.format.insertSpaceAfterCommaDelimiter": false,
// "javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
// "javascript.format.insertSpaceAfterConstructor": false,
// "javascript.format.insertSpaceAfterKeywordsInControlFlowStatements": false,
// "javascript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
// "javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
// "javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
// "javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
// "javascript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
// "javascript.format.insertSpaceAfterSemicolonInForStatements": false,
// "javascript.format.insertSpaceBeforeAndAfterBinaryOperators": false,
// "javascript.format.insertSpaceBeforeFunctionParenthesis": false,
// "javascript.format.placeOpenBraceOnNewLineForControlBlocks": false,
// "javascript.format.placeOpenBraceOnNewLineForFunctions": false, // "prettier.eslintIntegration": true,
// "editor.fontSize": 20,
// "workbench.iconTheme": "material-icon-theme",
// "workbench.colorTheme": "Spacegray Eighties Dark",
// // "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
// // "git.enableSmartCommit": true,
// // "git.autofetch": true,
// // "git.confirmSync": false,
// // "[javascript]": {
// // "editor.defaultFormatter": "HookyQR.beautify"
// // },
// // "php.validate.executablePath": "C:\\wamp\\bin\\php\\php5.6.25\\php.exe",
// // "phpserver.browser": "google-chrome",
// // "editor.fontLigatures": null,
// "editor.formatOnSave": true,
// "editor.codeActionsOnSave": {
// "source.fixAll.eslint": true
// },
// "editor.tabSize": 2,
// "editor.insertSpaces": true,
// //javascript
// "javascript.format.insertSpaceBeforeFunctionParenthesis": true,
// // "javascript.implicitProjectConfig.experimentalDecorators": true,
// //eslint
// "eslint.format.enable": false,
// "eslint.validate": ["javascript", "javascriptreact", "vue"],
// //vetur
// "vetur.format.defaultFormatter.js": "vscode-typescript",
// "vetur.format.defaultFormatter.html": "js-beautify-html",
// "vetur.format.defaultFormatterOptions": {
// "js-beautify-html": {
// "wrap_attributes": "force-aligned"
// }
// },
// "vetur.validation.template": false,
// //vetur
// // "vetur.format.defaultFormatter.js": "vscode-typescript",
// // // "vetur.format.defaultFormatter.html": "js-beautify-html",
// // "vetur.format.defaultFormatterOptions": {
// // "js-beautify-html": {
// // "wrap_attributes": "force-aligned"
// // }
// // },
// // "vetur.validation.template": false,
// "terminal.integrated.shell.windows": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
// "git.confirmSync": false,
// "git.enableSmartCommit": true,
// "editor.suggestSelection": "first",
// "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
// "workbench.editorAssociations": {
// "*.ipynb": "jupyter.notebook.ipynb"
// },
// "[html]": {
// "editor.defaultFormatter": "HookyQR.beautify"
// },
// "[javascript]": {
// "editor.defaultFormatter": "vscode.typescript-language-features"
// },
// "[jsonc]": {
// "editor.defaultFormatter": "esbenp.prettier-vscode"
// },
// "[vue]": {
// "editor.defaultFormatter": "esbenp.prettier-vscode"
// }
// }

vscode 自动格式化 好使的配置 setting.json 20210622的更多相关文章

  1. vscode代码格式化 空格的配置

    一个项目中同事使用webstorm,看我代码的时候说我传上去的会多出空格, VSCode 编辑 Setting.json文件,列出一些可以配置的项目   "javascript.format ...

  2. 对 vscode 自动格式化的结果不太满意,我们该如何自己调整直至自己满意为止

    前提概述 采用vue-cli 3.0自动生成vue项目,选了ESlint+Prettier,在写request.js的时候,顺手用vscode右击格式化文件(Alt+Shift+F),一下子报了8个问 ...

  3. prettier+ts+eslint+vscode配置代码保存自动格式化,自动remove unsed declaration,delete no-unused-imports

    每天都要开心(▽)哇: 以这个项目为案例 下面是项目的基本情况 What would you like to build? › App with Quasar CLI, let's go! Proje ...

  4. vscode 自动修复 setting.json 修改完,得重启浏览器 # 新版(>1.41.0)配置 vscode #解决了

    vscode 自动修复 setting.json 修改完,得重启浏览器,不用 npm run dev 就能看到效果 "editor.codeActionsOnSave": { &q ...

  5. vscode+eslint项目规范化,自动格式化配置(项目中用到的)

    项目如果没有格式化插件就会变得十分拥挤,并且因为个人的开发习惯不同,会导致多人配合的时候,某些人的格式不能与你的兼容 导致项目大面积冲突,这样一来统一的格式和开发规范就十分必要了. 1.下载使用vsc ...

  6. vscode+eslint自动格式化vue代码的方法

    前言 使用vscode开发vue项目的时候,为了编码格式的统一化,使用eslint规范进行格式化.此时通过eslint插件可以实现对vue代码的自动格式化. 使用方式 在vscode的插件模块处,搜索 ...

  7. vs code配置vue自动格式化

     vs code配置vue自动格式化 我他妈的要被这个vs code的格式化逼疯了.我在网上看了很多的文章,不是太老就是不好使,遇到太多坑了.在这贴出自己的配置,虽然有多余的代码,虽然可能在未来的更新 ...

  8. vscode写python时的代码错误提醒和自动格式化

    python的代码错误检查通常用pep8.pylint和flake8,自动格式化代码通常用autopep8.yapf.black.这些工具均可以利用pip进行安装,这里介绍传统的利用pip.exe安装 ...

  9. vsCode 设置vue 保存自动格式化代码

    setting { // vscode默认启用了根据文件类型自动设置tabsize的选项 "editor.detectIndentation": false, // 重新设定tab ...

  10. 解决vscode按下ctrl+S的时候自动格式化

    按下ctrl+S的时候自动格式化 为什么需要这种操作? 优点: 保存的时候格式化,让我们的代码自动格式化,减少人工调整. 缺点: 有一些打好包的JS有时候修改一下,但不需要格式化,因为打好包就是要压缩 ...

随机推荐

  1. Python RE 正则表达式模块

    正则表达式,又称规则表达式,(Regular Expression,在代码中常简写为regex.regexp或RE),是一种文本模式,包括普通字符(例如,a 到 z 之间的字母)和特殊字符(称为&qu ...

  2. MySQL 字符串与时间操作函数

    MariaDB [lyshark]> select Name,char_length(Name) from lyshark; -- 求字符串长度 +------------+---------- ...

  3. Linux系统的一些实用操作 [补档-2023-07-30]

    Linux的实用操作 4-1.常用快捷键 强制停止:当某些程序运行时,或者命令输入错误时,可以通过 ctrl + c 来强制结束当前的操作. 退出或登出:当我们要退出某些用户时,或者要退出某些特殊的页 ...

  4. git操作 手写稿

  5. vscode连不上云服务器,一直报超时错误|但是xshell那些又可以连上?为什么vscode连不上?|命令行输出管道报错 -bash: command not found 导致的一系列问题

    前言 那么这里博主先安利一些干货满满的专栏了! 首先是博主的高质量博客的汇总,这个专栏里面的博客,都是博主最最用心写的一部分,干货满满,希望对大家有帮助. 高质量博客汇总https://blog.cs ...

  6. MyBatis动态sql之foreach标签 构建 in 语句

    <foreach> 元素主要用在构建 in 条件中,它可以在 SQL 语句中迭代一个集合.<foreach> 元素的属性主要有 item.index.collection.op ...

  7. TfrxReport.Clear。尽量慎用。

    for MyXuHaoKey in MyXuHaoJianRongSanJieKouDataDicApi.KeySortList do begin //标记下打印编号,吸入淘打的客户 MyTradeA ...

  8. .NET 云原生架构师训练营(模块二 基础巩固 依赖注入)--学习笔记

    2.2.1 核心模块--依赖注入 什么是依赖注入 .NET Core DI 生命周期 服务设计 服务范围检查 ASP.NET Core 依赖注入:https://docs.microsoft.com/ ...

  9. RedHat Enterprise Linux 8.0终端命令界面字体放大缩小

    一.打开RedHat的终端命令界面. 二.放大界面中字体,Ctrl + Shit  + "+" 三.缩小界面中字体,Ctrl +  "-"

  10. offline 2 online | 重要性采样,把 offline + online 数据化为 on-policy samples

    论文标题:Offline-to-Online Reinforcement Learning via Balanced Replay and Pessimistic Q-Ensemble CoRL 20 ...