直接上报错图
此时 你需要执行两个命令
yarn add eslint-config-prettier
yarn add eslint-plugin-unicorn
但是,这里会有概率出现自身node.js的版本与其项目的版本不一致所导致的. 其报错信息类似为这种,也有可能直接解决问题。
error execa@7.1.1: The engine "node" is incompatible with this module. Expected version "^14.18.0 || ^16.14.0 || >=18.0.0". Got "16.13.0"
error Found incompatible module.
此时你需要执行一个命令解决版本不兼容问题,该命令是自动补充兼容所报的错误
yarn config set ignore-engines true
然后,重新删除i18n,你会发现出现了另一个错误
Environment key "es2022" is unknown
解决办法就是修改node_modules/@umijs/lint/dist/config/eslint/index.js文件注释这行代码(如图)// es2022: true
注释后测试删除i18n操作,成功!!