Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
479 views
in Technique[技术] by (71.8m points)

javascript - ESLint关闭分号规则(ESLint turn off semicolon rule)

When I search for turning off semicolon, I get "semi": 0 or similar I tried to putting it, but still my linter puts semicolon on lines.(当我搜索关闭分号时,我得到"semi": 0或类似的值,但我尝试将其放在分号上,但我的棉绒仍将分号放在了行上。)

Below is my .eslintrc and I am perplexed which rule is putting semicolon.(下面是我的.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 } }   ask by eugene translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try to add this rule: "semi": [ "error", "never" ](尝试添加以下规则:“ semi”:[“ error”,“ never”])

If still not fixed, the problem may be that prettier (if you installed) or editor is controlling it.(如果仍未解决,则问题可能出在更漂亮 (如果已安装)或编辑器正在控制它。) Go at vscode settings and add(进入vscode设置并添加) "eslint.autoFixOnSave": true,

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...