ant-design / ant-design-pro

👨🏻‍💻👩🏻‍💻 Use Ant Design like a Pro!
https://pro.ant.design
MIT License
36.31k stars 8.14k forks source link

🐛[BUG] 最新版 v5 执行 i18n-remove 出现依赖错误 #6786

Closed tomgao365 closed 3 years ago

tomgao365 commented 4 years ago

🐛 bug 描述

$ pro i18n-remove --locale=zh-CN --write
√ 🕵️‍  find js or ts files
√ �📦  load all locale file and build t
- ✂️  remove locale for src/global.tsx.D:\Work\Gao\we-hub\antd-pro\node_modules\eslint\lib\cli-engine\config-array\config-array.js:180
                throw sourceValue.error;
                ^

Error: Failed to load plugin '@typescript-eslint' declared in '.eslintrc.js » D:\Work\Gao\we-hub\antd-pro\node_modules\@umijs\fabric\dist\eslint.js': Cannot find module '@typescript-eslint/eslint-plugin'
Require stack:
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.resolve (internal/modules/cjs/helpers.js:83:19)
    at Object.resolve (D:\Work\Gao\we-hub\antd-pro\node_modules\eslint\lib\shared\relative-module-resolver.js:44:50)
    at ConfigArrayFactory._loadPlugin (D:\Work\Gao\we-hub\antd-pro\node_modules\eslint\lib\cli-engine\config-array-factory.js:959:39)
    at D:\Work\Gao\we-hub\antd-pro\node_modules\eslint\lib\cli-engine\config-array-factory.js:848:33
    at Array.reduce (<anonymous>)
    at ConfigArrayFactory._loadPlugins (D:\Work\Gao\we-hub\antd-pro\node_modules\eslint\lib\cli-engine\config-array-factory.js:844:22)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (D:\Work\Gao\we-hub\antd-pro\node_modules\eslint\lib\cli-engine\config-array-factory.js:667:32)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigData (D:\Work\Gao\we-hub\antd-pro\node_modules\eslint\lib\cli-engine\config-array-factory.js:596:20) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ 'D:\\Work\\Gao\\we-hub\\antd-pro\\__placeholder__.js' ],
  messageTemplate: 'plugin-missing',
  messageData: {
    pluginName: '@typescript-eslint/eslint-plugin',
    resolvePluginsRelativeTo: 'D:\\Work\\Gao\\we-hub\\antd-pro',
    importerName: '.eslintrc.js » D:\\Work\\Gao\\we-hub\\antd-pro\\node_modules\\@umijs\\fabric\\dist\\eslint.js'
  }
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

需要添加

@typescript-eslint/eslint-plugin
eslint-plugin-eslint-comments
eslint-plugin-jest
eslint-plugin-unicorn

📷 复现步骤

🏞 期望结果

💻 复现代码

© 版本信息

🚑 其他信息

ZhelinCheng commented 4 years ago

同样的问题

ZhelinCheng commented 4 years ago

我进行以下操作之后执行成功:

安装以下依赖:

yarn add @typescript-eslint/eslint-plugin eslint-plugin-eslint-comments eslint-plugin-jest eslint-plugin-unicorn -D

执行删除操作:

yarn i18n-remove
zoffyzhang commented 4 years ago

v4也有这个问题🤪

chenshuai2144 commented 4 years ago

看起来只有yarn 会出现先用npm来安装依赖吧

shwzh commented 4 years ago

看起来只有yarn 会出现先用npm来安装依赖吧

@chenshuai2144 怎么解决 不能因为这问题 一直使用npm ?

chenshuai2144 commented 3 years ago

fixed in https://github.com/umijs/sylvanas/pull/11

Swag0908 commented 1 year ago

npm也会出现这个问题的 npm add @typescript-eslint/eslint-plugin eslint-plugin-eslint-comments eslint-plugin-jest eslint-plugin-unicorn -D可以解决