[英]ESLint/Prettier throw errors after node upgrade
I am currently using ESLint and Prettier to lint my React project.我目前正在使用 ESLint 和 Prettier 来检查我的 React 项目。 This is currently using node version 10. When running the lint command, no errors were given
这是当前使用的节点版本 10。运行 lint 命令时,没有给出错误
I have recently upgraded to version 12 without upgrading any other package.我最近升级到版本 12,没有升级任何其他 package。 I now get linting errors
我现在得到 linting 错误
Does ESLint/Prettier rules/errors differ based on the node version? ESLint/Prettier 规则/错误是否因节点版本而异?
You can reinstall linters, formatters in your project with the compatible ones.您可以使用兼容的项目在项目中重新安装 linter、格式化程序。 First copy their name from
package.json
.首先从
package.json
复制他们的名字。 After uninstall them with yarn or npm command.使用 yarn 或 npm 命令卸载它们后。 After removing all the linters, formatters in your package.json.
删除所有短绒后,package.json 中的格式化程序。
rm -fr node_modules/ package-lock.json
npm cache clean --force
# install the packages you have removed
npm i package1 package2 package3 --unsafe-perm
# install other dependencies
npm i --unsafe-perm
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.