无法解决VSCode中ESLint的问题 [英] Can't solve problems with ESLint in VSCode
问题描述
我已经安装了 ESLint 扩展,然后在我的本地项目上初始化,解决了 ESLint 问题.没有更多的问题出现,启动应用程序,但编译失败,所有的问题再次出现.我该怎么办?在 vscode 中我没有问题,但在浏览器中我有很多问题.vscode 中的问题窗口启动应用程序后本地浏览器
I have installed ESLint extension, then initialized on my local project, solved ESLint problems. No more problems appeared, started application, but failed to compile, all the problems reappeared. what should i do? in vscode i have no problems but in browser i have a lot of problems.problems window in vscodebrowser in localhost after i start the app
推荐答案
更新 .eslintrc.json 然后再次解决问题.这次我编译时没有错误!
updated .eslintrc.json then solved the problems again. this time when i compile i get no errors!
{解析器选项":{ecmaVersion":6,ecmaFeatures":{jsx":真},源类型":模块";},
{ "parserOptions": { "ecmaVersion": 6, "ecmaFeatures": { "jsx": true }, "sourceType": "module" },
设置":{反应":{版本":检测"}},
"settings": { "react": { "version": "detect" } },
插件":[反应"],
规则":{反应/jsx-无绑定":[错误",{allowArrowFunctions":真,allowBind":假,ignoreRefs":真}],react/no-did-update-set-state":错误",反应/无未知属性":错误",反应/无未使用的道具类型":错误",反应/道具类型":错误",react/react-in-jsx-scope":错误"}}
"rules": { "react/jsx-no-bind": ["error", { "allowArrowFunctions": true, "allowBind": false, "ignoreRefs": true }], "react/no-did-update-set-state": "error", "react/no-unknown-property": "error", "react/no-unused-prop-types": "error", "react/prop-types": "error", "react/react-in-jsx-scope": "error" } }
这篇关于无法解决VSCode中ESLint的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!