标签:括号 ring deb 问题 off mis lse 方法 ebe
vsCode配置
一、vscode使用eslint格式化代码取消自动添加分号:
https://blog.csdn.net/qq_37908043/article/details/90202554
{
"window.zoomLevel": 1,
// "editor.formatOnSave": true, // eslint保存格式化
"vetur.format.defaultFormatterOptions": {
"prettier": {
// 格式化不加分号
"semi": false,
// 格式化为单引号
"singleQuote": true
}
},
// 在方法括号之间插入空格
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"editor.formatOnType": true //开启自动格式化
}
修复了此问题:
11:24 error Strings must use singlequote quotes
11:56 error Extra semicolon semi
13:9 error Strings must use singlequote quotes
19:6 error Extra semicolon semi
23:17 error Strings must use singlequote quotes
23:49 error Extra semicolon semi
27:67 error Extra semicolon semi
28:16 error Extra semicolon semi
32:19 error Strings must use singlequote quotes
32:26 error Extra semicolon semi
41:180 error Extra semicolon semi
44:2 error Extra semicolon semi
错误额外分号半
错误字符串必须使用单引号

二、eslint规则修改:函数括号前必须加空格的规则修改:
https://blog.csdn.net/qq_43416014/article/details/105012478
在根目录下的.eslintrc.js中的rules: {}中添加:
‘space-before-function-paren‘:0
切记要重启。
rules: {
‘no-console‘: process.env.NODE_ENV === ‘production‘ ? ‘error‘ : ‘off‘,
‘no-debugger‘: process.env.NODE_ENV === ‘production‘ ? ‘error‘ : ‘off‘,
‘space-before-function-paren‘:0
}
修复了此问题:
14:17 error Missing space before function parentheses space-before-function-paren
错误函数前缺少空格括号函数前缺少空格

vsCode eslint格式化取消自动添加分号,在括号前插入空格
标签:括号 ring deb 问题 off mis lse 方法 ebe
原文地址:https://www.cnblogs.com/kpengfang/p/13169369.html