简体   繁体   English

保存我的代码时 Eslint 配置错误

[英]Eslint configuration error when saving my code

Error while loading rule 'prettier/prettier': context.getPhysicalFilename is not a function Occurred while linting G:\\quiz-app\\src\\index.js加载规则 'prettier/prettier' 时出错:context.getPhysicalFilename 不是函数在 linting G:\\quiz-app\\src\\index.js 时发生

Why is this happening when I have saved my code in vs-code by pressing ctrl+s?当我通过按 ctrl+s 将代码保存在 vs-code 中时,为什么会发生这种情况?

This happens because eslint-plugin-prettier@4.0.0 is not compatible with eslint@7.11.0 which react-scripts uses and requires an upgrade to eslint@7.32.0.发生这种情况是因为 eslint-plugin-prettier@4.0.0 与 react-scripts 使用的 eslint@7.11.0 不兼容,需要升级到 eslint@7.32.0。

You'll need to upgrade eslint's version by running yarn upgrade -R eslint您需要通过运行yarn upgrade -R eslint来升级 eslint 的版本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM