[英]How to disable eslint type errors in react app?
I may be wrong, but from your screenshot it seems you are using VSCode as your IDE. If you just want to stop these errors from showing up in the IDE, adding these overrides in your user/workspace settings should help:-我可能是错的,但从你的屏幕截图来看,你似乎正在使用 VSCode 作为你的 IDE。如果你只是想阻止这些错误出现在 IDE 中,在你的用户/工作区设置中添加这些覆盖应该会有所帮助:-
"typescript.validate.enable": false,
"javascript.validate.enable": false,
Also, it looks like a create-react-app
scaffolded project, if you do not intend to use Typescript, it would be ideal to scaffold the project again without it, if that is still an option!此外,它看起来像一个
create-react-app
脚手架项目,如果您不打算使用 Typescript,那么最好在没有它的情况下再次搭建该项目,如果这仍然是一个选项!
I myself found the solution from here Edit.env:我自己从这里 Edit.env 找到了解决方案:
DISABLE_ESLINT_PLUGIN=true DISABLE_ESLINT_PLUGIN=真
Or in package.json:或者在 package.json 中:
{
"scripts": {
"start": "DISABLE_ESLINT_PLUGIN=true react-scripts start",
"build": "DISABLE_ESLINT_PLUGIN=true react-scripts build",
"test": "DISABLE_ESLINT_PLUGIN=true react-scripts test"
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.