安装eslint

修改eslint配置

rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'space-before-function-paren':0
}

修改setting.json配置

{
// vscode默认启用了根据文件类型自动设置tabsize的选项
"editor.detectIndentation": false, // 重新设定tabsize
"editor.tabSize": 2, // 添加 vue 支持
"eslint.validate": [
"javascript",
"javascriptreact",
{ "language": "vue", "autoFix": true },"html", "vue"
], // #让prettier使用eslint的代码格式进行校验
"prettier.eslintIntegration": true, // #去掉代码结尾的分号
"prettier.semi": false, // #使用带引号替代双引号
"prettier.singleQuote": true, // #让函数(名)和后面的括号之间加个空格
"javascript.format.insertSpaceBeforeFunctionParenthesis": true, // #这个按用户自身习惯选择
"vetur.format.defaultFormatter.html": "js-beautify-html", // #让vue中的js按编辑器自带的ts格式进行格式化
"vetur.format.defaultFormatter.js": "vscode-typescript",
"vetur.format.defaultFormatterOptions": {
// "wrap_attributes": "force-expand-multiline",
"js-beautify-html": {
// "wrap_attributes": "force-aligned"
"wrap_attributes": "auto"
// 其他可选值为: [auto|force|force-aligned|force-expand-multiline] ["auto"]
// "wrap_attributes": "force-expand-multiline",
// "end_with_newline": false
// #vue组件中html代码格式化样式
}
}, // 格式化stylus, 需安装Manta's Stylus Supremacy插件
"stylusSupremacy.insertColons": false, // 是否插入冒号
"stylusSupremacy.insertSemicolons": false, // 是否插入分好
"stylusSupremacy.insertBraces": false, // 是否插入大括号
"stylusSupremacy.insertNewLineAroundImports": false, // import之后是否换行
"stylusSupremacy.insertNewLineAroundBlocks": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"python.linting.pylintArgs": [
"--load-plugins=pylint_django"
],
"python.linting.enabled":true,
"python.formatting.provider": "yapf", // Python相关设置
"eslint.autoFixOnSave": true,
"editor.formatOnSave": true // 两个选择器中是否换行
}

最新文章

  1. Qt 程序打包发布
  2. 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(三)显示地图坐标系模块
  3. 大数据架构师NoSQL建模技术
  4. [R]R的工作流
  5. MVC 文件上传和图片剪辑
  6. irms模拟数据生成及数据分析
  7. 为什么报错说req未定义,createServer只接受匿名函数吗?
  8. ASP.NET MVC进阶
  9. Linux 下Tomcat启动Cannot find ./catalina.sh
  10. SOAPtest报错:error occurred during initialization of vm解决方法
  11. java模式:建造者模式
  12. 巧用CurrentThread.Name来统一标识日志记录
  13. vue 笔记
  14. beego快速入门
  15. BNUOJ-1065或运算的简单解法
  16. 20155231 2016-2017-2 《Java程序设计》第10周学习总结
  17. 探索C++虚函数
  18. 【Hadoop】伪分布式环境搭建、验证
  19. 【BZOJ4542】[Hnoi2016]大数 莫队
  20. css禁止文字被选中

热门文章

  1. intel:spectre&Meltdown侧信道攻击(一)
  2. 【从零开始撸一个App】Dagger2
  3. U盘数据泄露,用不到30行的Python代码就能盗走
  4. MySQL--->存储引擎及图形化工具
  5. JS DOM重点核心笔记
  6. BN系列-未完待续
  7. 2020-07-16:如何获得一个链表的倒数第n个元素?
  8. C#LeetCode刷题之#643-子数组最大平均数 I( Maximum Average Subarray I)
  9. 利用BeautifulSoup去除HTML指定标签和去除注释
  10. FCOS: Fully Convolutional One-Stage Object Detection