一直用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. 19.10 Boost Asio 同步文件传输

    在原生套接字编程中我们介绍了利用文件长度来控制文件传输的方法,本节我们将采用另一种传输方式,我们通过判断字符串是否包含goodbye lyshark关键词来验证文件是否传输结束了,当然了这种传输方式明 ...

  2. UDP通信 [补档-2023-07-22]

    UDP通信 6-1 简介 ​ UDP通信是面向无链接的,不稳定,不可靠,不安全的一种通信方式.TCP在通信前发送方会向接收方进行三次握手链接,然后确认双方链接后才会进行数据传输,最后四次挥手保证链接关 ...

  3. 字节码编程,Javassist篇四《通过字节码插桩监控方法采集运行时入参出参和异常信息》

    作者:小傅哥 博客:https://bugstack.cn 沉淀.分享.成长,让自己和他人都能有所收获! 一.前言 字节码编程插桩这种技术常与 Javaagent 技术结合用在系统的非入侵监控中,这样 ...

  4. 戴尔R7920工作站利用PVE开启vGPU,实现工作站虚拟化(ShareStation)

    介绍 本文介绍了使用Proxmox VE(PVE) + DoraCloud,将一台Dell R7920图形工作站(配置有NVIDIA RTX A6000显卡)实现工作站虚拟化.可以满足多个设计用户同时 ...

  5. 【奶奶看了也不会】AI绘画 Mac安装stable-diffusion-webui绘制AI妹子保姆级教程

    1.作品图 2.准备工作 目前网上能搜到的stable-diffusion-webui的安装教程都是Window和Mac M1芯片的,而对于因特尔芯片的文章少之又少,这就导致我们还在用老Intel 芯 ...

  6. webrtc终极版(题外话)辛苦写文章分享,竟然遇到喷子狂喷,写篇文章回怼下,顺便发表下面对喷子的处理方式

    webrtc终极版(题外话)辛苦写文章分享,竟然遇到喷子狂喷,写篇文章回怼下,顺便发表下面对喷子的处理方式 第一篇文章发过后,出人意料的是,收到了博客园某一位用户的狂喷[注:本系列文章会同步发布到cs ...

  7. NC15291 幸运数字Ⅱ

    题目链接 题目 题目描述 定义一个数字为幸运数字当且仅当它的所有数位都是4或者7. 比如说,47.744.4都是幸运数字而5.17.467都不是. 定义next(x)为大于等于x的第一个幸运数字.给定 ...

  8. NC14701 取数游戏2

    题目链接 题目 题目描述 给定两个长度为n的整数列A和B,每次你可以从A数列的左端或右端取走一个数.假设第i次取走的数为ax,则第i次取走的数的价值vi=bi⋅ax,现在希望你求出∑vi的最大值. 输 ...

  9. 【OpenGL ES】EGL+FBO离屏渲染

    1 前言 ​ FBO离屏渲染 中使用 GLSurfaceView 来驱动 Renderer 渲染图片,为了隐藏 GLSurfaceView,将其设置为透明的,并且宽高都设置为1.本文将使用 EGL 代 ...

  10. 建立DNS隧道绕过校园网认证

    建立DNS隧道绕过校园网认证 因为之前在本科的时候破解过校园网三次,主要就是利用其业务逻辑上的漏洞.53端口未过滤包.重放攻击的手段,然后就是一个博弈的过程,这三次加起来用了大概有一年的时间就被完全堵 ...