Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用@iceworks/spec,eslint升级到8.0之后,npm run eslint会报错 #4741

Closed
mopsky opened this issue Oct 13, 2021 · 4 comments
Closed
Assignees

Comments

@mopsky
Copy link

mopsky commented Oct 13, 2021

> eslint --cache --ext .ts,.tsx ./


Oops! Something went wrong! :(

ESLint: 8.0.0

Error: Failed to load parser '@typescript-eslint/parser' declared in '.eslintrc.js » C:\Users\YangXB\VSCode\pfws.erp.v2\node_modules\eslint-config-ali\typescript\react.js » C:\Users\YangXB\VSCode\pfws.erp.v2\node_modules\eslint-config-ali\rules\typescript.js': Cannot find module '@typescript-eslint/parser'
Require stack:
- C:\Users\YangXB\VSCode\pfws.erp.v2\node_modules\eslint-config-ali\rules\typescript.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.resolve (internal/modules/cjs/helpers.js:94:19)
    at Object.resolve (C:\Users\YangXB\VSCode\pfws.erp.v2\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:1088:46)
    at ConfigArrayFactory._loadParser (C:\Users\YangXB\VSCode\pfws.erp.v2\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3235:39)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (C:\Users\YangXB\VSCode\pfws.erp.v2\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3030:43)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigData (C:\Users\YangXB\VSCode\pfws.erp.v2\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:2971:20)
    at _normalizeObjectConfigData.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (C:\Users\YangXB\VSCode\pfws.erp.v2\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3026:25)
    at _normalizeObjectConfigDataBody.next (<anonymous>)

帮忙看看是什么问题,是不是什么包没安装对

@fyangstudio
Copy link
Collaborator

fyangstudio commented Oct 13, 2021

感谢您的反馈,我们已经复现了这个问题。如果很着急修复这个问题,目前有如下解法:
方案一:使用 ESLint 7.x 版本
方案二:安装2个依赖,覆盖兼容性有问题的版本,添加代码如下:

  "devDependencies": {
+   "@typescript-eslint/eslint-plugin": "^5.0.0",
+   "@typescript-eslint/parser": "^5.0.0",
     "@iceworks/spec": "^1.0.0",
     "eslint": "^8.0.0"
   }

当前我已向 esling-config-ali 反馈,我们可能需要一定的时间回归对 ESLint 8.x 的兼容情况。最新进度我会在这个 issue 中同步。

再次感谢反馈这个问题

@mopsky
Copy link
Author

mopsky commented Oct 13, 2021

收到,感谢

@fyangstudio
Copy link
Collaborator

alibaba/f2e-spec#42

@imsobear
Copy link
Collaborator

@iceworks/spec@1.5.0 已兼容 eslint 8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants