ESlint 自动格式化代码 补缺代码 添加空格

问题:代码遇到严格模式下,前后空格原因,以及函数 html css 代码报错情况。
在这里插入图片描述
首先
在这里插入图片描述
第二步 找到这个文件 将里面的代码全部置换下面配置代码
在这里插入图片描述

配置信息如下

{
“fileheader.LastModifiedBy”: “Oralinge”,
“fileheader.Author”: “Oralinge”,
“git.autofetch”: true,
“[html]”: {
“editor.defaultFormatter”: “vscode.html-language-features”
},
“editor.detectIndentation”: false,
// 添加 vue 支持
“eslint.validate”: [
“javascript”,
“javascriptreact”,
{
“language”: “vue”,
“autoFix”: true
}
],
// #这个按用户自身习惯选择
“vetur.format.defaultFormatter.html”: “js-beautify-html”,
// #让vue中的js按编辑器自带的ts格式进行格式化
“vetur.format.defaultFormatter.js”: “vscode-typescript”,
“vetur.format.defaultFormatterOptions”: {
“prettier”: {
“semi”: false
},
“js-beautify-html”: {
“wrap_attributes”: “auto”
// #vue组件中html代码格式化样式
// - auto: 仅在超出行长度时才对属性进行换行。
// - force: 对除第一个属性外的其他每个属性进行换行。
// - force-aligned: 对除第一个属性外的其他每个属性进行换行,并保持对齐。
// - force-expand-multiline: 对每个属性进行换行。
// - aligned-multiple: 当超出折行长度时,将属性进行垂直对齐。
}
},
// 格式化stylus, 需安装Manta’s Stylus Supremacy插件
// “stylusSupremacy.insertColons”: false, // 是否插入冒号
// “stylusSupremacy.insertSemicolons”: false, // 是否插入分好
// “stylusSupremacy.insertBraces”: false, // 是否插入大括号
// “stylusSupremacy.insertNewLineAroundImports”: false, // import之后是否换行
// “stylusSupremacy.insertNewLineAroundBlocks”: false,
“typescript.format.insertSpaceAfterSemicolonInForStatements”: false,
“editor.codeActionsOnSave”: {
“source.fixAll.eslint”: true
},
“files.associations”: {
.cjson": “jsonc”,
"
.wxss”: “css”,
“*.wxs”: “javascript”
},
“emmet.includeLanguages”: {
“wxml”: “html”
},
“minapp-vscode.disableAutoConfig”: true,
“window.zoomLevel”: 0,
“prettier.semi”: false,
“prettier.singleQuote”: true,
“javascript.format.insertSpaceBeforeFunctionParenthesis”: true,
“editor.formatOnType”: true,
“editor.tabSize”: 2,
“eslint.codeAction.disableRuleComment”: {},
“eslint.codeAction.showDocumentation”: {
},
“files.autoSave”: “afterDelay”,
“breadcrumbs.enabled”: true,
“editor.renderWhitespace”: “none”,
“workbench.activityBar.visible”: true,
“editor.minimap.enabled”: false,
“diffEditor.ignoreTrimWhitespace”: false,
“[vue]”: {
“editor.defaultFormatter”: “octref.vetur”
},
“workbench.colorTheme”: “Monokai” // 两个选择器中是否换行
}

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值