当我搜索关闭分号时,我得到"semi": 0
或类似的字符
我试着放它,但我的短绒棉仍然把分号放在行上。
下面是我的.eslintrc,我感到困惑的是哪个规则放在了分号上。
{
"parserOptions": {
"ecmaVersion": 8,
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"jsx-quotes": ["error", "prefer-single"],
"react/jsx-boolean-value": "error",
"react/jsx-curly-spacing": ["error", "never"],
"react/jsx-equals-spacing": ["error", "never"],
"react/jsx-indent": ["error", 2],
"react/jsx-indent-props": ["error", 2],
"react/jsx-no-duplicate-props": "error",
"react/jsx-no-undef": "error",
"react/jsx-tag-spacing": ["error", { "beforeSelfClosing": "always" }],
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react/self-closing-comp": "error",
"no-console": 0,
"semi": 0
}
}
答案 0 :(得分:0)
尝试添加以下规则: “半”:[ “错误”, “决不” ]
如果仍未解决,则可能是因为更漂亮(如果已安装)或编辑器正在控制它。
进入vscode设置并添加
"eslint.autoFixOnSave": true,