Ant-design-pro: 🐛[BUG] 最新版 v5 执行 i18n-remove 出现依赖错误

Created on 8 Jun 2020  ·  6Comments  ·  Source: ant-design/ant-design-pro

🐛 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

📷 复现步骤

🏞 期望结果

💻 复现代码

© 版本信息

  • Ant Design Pro 版本: [e.g. 4.0.0]
  • umi 版本
  • 浏览器环境
  • 开发环境 [e.g. mac OS]

🚑 其他信息

Inactive 🛑 bug

Most helpful comment

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

安装以下依赖:

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

执行删除操作:

yarn i18n-remove

All 6 comments

同样的问题

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

安装以下依赖:

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

执行删除操作:

yarn i18n-remove

v4也有这个问题🤪

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

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

renyi818 picture renyi818  ·  3Comments

yjz1004 picture yjz1004  ·  3Comments

2uncle-code picture 2uncle-code  ·  3Comments

suifan picture suifan  ·  3Comments

ghost picture ghost  ·  3Comments