vscode 自动格式化 好使的配置 setting.json 20210622
一直用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的更多相关文章
- vscode代码格式化 空格的配置
一个项目中同事使用webstorm,看我代码的时候说我传上去的会多出空格, VSCode 编辑 Setting.json文件,列出一些可以配置的项目 "javascript.format ...
- 对 vscode 自动格式化的结果不太满意,我们该如何自己调整直至自己满意为止
前提概述 采用vue-cli 3.0自动生成vue项目,选了ESlint+Prettier,在写request.js的时候,顺手用vscode右击格式化文件(Alt+Shift+F),一下子报了8个问 ...
- 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 ...
- vscode 自动修复 setting.json 修改完,得重启浏览器 # 新版(>1.41.0)配置 vscode #解决了
vscode 自动修复 setting.json 修改完,得重启浏览器,不用 npm run dev 就能看到效果 "editor.codeActionsOnSave": { &q ...
- vscode+eslint项目规范化,自动格式化配置(项目中用到的)
项目如果没有格式化插件就会变得十分拥挤,并且因为个人的开发习惯不同,会导致多人配合的时候,某些人的格式不能与你的兼容 导致项目大面积冲突,这样一来统一的格式和开发规范就十分必要了. 1.下载使用vsc ...
- vscode+eslint自动格式化vue代码的方法
前言 使用vscode开发vue项目的时候,为了编码格式的统一化,使用eslint规范进行格式化.此时通过eslint插件可以实现对vue代码的自动格式化. 使用方式 在vscode的插件模块处,搜索 ...
- vs code配置vue自动格式化
vs code配置vue自动格式化 我他妈的要被这个vs code的格式化逼疯了.我在网上看了很多的文章,不是太老就是不好使,遇到太多坑了.在这贴出自己的配置,虽然有多余的代码,虽然可能在未来的更新 ...
- vscode写python时的代码错误提醒和自动格式化
python的代码错误检查通常用pep8.pylint和flake8,自动格式化代码通常用autopep8.yapf.black.这些工具均可以利用pip进行安装,这里介绍传统的利用pip.exe安装 ...
- vsCode 设置vue 保存自动格式化代码
setting { // vscode默认启用了根据文件类型自动设置tabsize的选项 "editor.detectIndentation": false, // 重新设定tab ...
- 解决vscode按下ctrl+S的时候自动格式化
按下ctrl+S的时候自动格式化 为什么需要这种操作? 优点: 保存的时候格式化,让我们的代码自动格式化,减少人工调整. 缺点: 有一些打好包的JS有时候修改一下,但不需要格式化,因为打好包就是要压缩 ...
随机推荐
- 3.3 Windows驱动开发:内核MDL读写进程内存
MDL内存读写是一种通过创建MDL结构体来实现跨进程内存读写的方式.在Windows操作系统中,每个进程都有自己独立的虚拟地址空间,不同进程之间的内存空间是隔离的.因此,要在一个进程中读取或写入另一个 ...
- Python 多线程实现爬取图片
前阵子网上看到有人写爬取妹子图的派森代码,于是乎我也想写一个教程,很多教程都是调用的第三方模块,今天就使用原生库来爬,并且扩展实现了图片鉴定,图片去重等操作,经过了爬站验证,稳如老狗,我已经爬了几万张 ...
- AIX6.1系统NTP同步配置
前言 当AIX系统的本地时间与时间服务器授出的标准时间误差大于±1000秒时.xntpd服务将无法同步时间并变得无法正常工作,请进行ntp配置前,先修改AIX系统的本地时间,尽量和时间服务器的标准 ...
- Linux虚拟机追加扩展磁盘
一.使用VMware给虚拟机追加磁盘 使用VMware打开虚拟机设置对话框,选择硬盘,点击右侧的扩展按钮,输入扩展后的磁盘容量. 点击扩展按钮.提示磁盘已成功扩展. 二.对闲置的空间进行分区 上面扩展 ...
- Mybatis 源码系列:领略设计模式在 Mybatis 其中的应用
目录 一.Builder模式 二.工厂模式 三.单例模式 四.代理模式 五.组合模式 六.模板方式模式 七.适配器模式 八.装饰器模式 九.迭代器模式 虽然我们都知道有23种设计模式,但是大多停留在概 ...
- [Ngbatis源码学习]Ngbatis源码阅读之连接池的创建
Ngbatis源码阅读之连接池的创建 1. NebulaPool的创建 NgbatisBeanFactoryPostProcessor 这个类实现了 BeanFactoryPostProcessor ...
- Shell 特殊符号(变量)用法小结
Shell | 特殊变量 $n 基本语法: $n (功能描述:n 为数字,$0 代表该脚本名称,$1-$9 代表第一到第九个参数,十以上的参数,十以上的参数需要用大括号包含,如${10}) 例如: ...
- PyOCD Notes
Installation Ubuntu20.04 For Ubuntu20.04 the version in apt repository is 0.13.1+dfsg-1, which is to ...
- Elasticsearch, Kibana安装
Centos7 安装Elasticsearch 安装 因为ES启动不能用root账号,手工安装配置较繁琐,故直接用rpm进行安装.根据官网的6.8安装提示 rpm --import https://a ...
- display的值及作用
display的值及作用 display属性可以设置元素的内部和外部显示类型,元素的外部显示类型将决定该元素在流式布局中的表现,例如块级或内联元素,元素的内部显示类型可以控制其子元素的布局,例如gri ...