[英]ESLint configuration in .eslintrc is invalid: - Unexpected top-level property “import/no-extraneous-dependencies”
I was writing a code to access webcam, click a picture through my react app or browse and upload the picture from your files.我正在编写访问网络摄像头的代码,通过我的反应应用程序单击图片或浏览并从您的文件上传图片。 For using react-html5-camera-phot and grommet I was getting these errors , Basically the error was import/no-extraneous-dependencies error.
对于使用 react-html5-camera-phot 和 grommet,我遇到了这些错误,基本上错误是import/no-extraneous-dependencies错误。
For resolving this, I ran the suggested commands but the issue persisted and I kept getting the same error.为了解决这个问题,我运行了建议的命令,但问题仍然存在,并且我一直收到同样的错误。
Therefore to remove these errors i went through stack overflow, and got a solution that suggested to post import/no-extraneous-dependencies": ["error", {"devDependencies": false, "optionalDependencies": false, "peerDependencies": false}] in my.eslintrc file. I posted this and now I am getting this error:因此,为了消除这些错误,我经历了堆栈溢出,并得到了一个解决方案,建议发布import/no-extraneous-dependencies": ["error", {"devDependencies": false, "optionalDependencies": false, "peerDependencies": false}]在 my.eslintrc 文件中。我发布了这个,现在我收到了这个错误:
ESLint configuration in.eslintrc is invalid: - Unexpected top-level property "import/no-extraneous-dependencies". .eslintrc 中的 ESLint 配置无效:- 意外的顶级属性“import/no-extraneous-dependencies”。
I tried resolving this error too but could not find anything helpful.我也尝试解决此错误,但找不到任何有用的东西。 Please if you can tell me what I am doing wrong, itll be very helpful.
如果你能告诉我我做错了什么,它会非常有帮助。 Thanks in advance.
提前致谢。
You need to put under rules object:您需要根据规则 object:
"rules": {
"import/no-extraneous-dependencies": ["error", {"devDependencies": true}],
...
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.