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

ESLint 插件上游依赖更新 #14904

Closed
TechQuery opened this issue Nov 28, 2023 · 0 comments · Fixed by #15250
Closed

ESLint 插件上游依赖更新 #14904

TechQuery opened this issue Nov 28, 2023 · 0 comments · Fixed by #15250
Labels
E-easy Helper Wanted - Easy F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x

Comments

@TechQuery
Copy link

相关平台

H5

浏览器版本: Chrome 119
使用框架: React

复现步骤

git clone IdeaMall/mini-app#45 后,在项目根目录执行:

echo "" >> src/store/Base.ts
git add .
npm test

期望结果

ESLint 命令不报错

实际结果

Oops! Something went wrong! :(

ESLint: 8.54.0

TypeError: Cannot read properties of undefined (reading 'length')
Occurred while linting ~/idea2app/IdeaMall/mini-app/src/store/Base.ts:9
Rule: "@typescript-eslint/no-useless-constructor"
    at ~/idea2app/IdeaMall/mini-app/node_modules/.pnpm/@typescript-eslint [email protected]_@typescript-eslint [email protected][email protected][email protected]/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js:30:26
    at Array.some (<anonymous>)
    at checkParams (~/idea2app/IdeaMall/mini-app/node_modules/.pnpm/@typescript-eslint [email protected]_@typescript-eslint [email protected][email protected][email protected]/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js:29:31)
    at MethodDefinition (~/idea2app/IdeaMall/mini-app/node_modules/.pnpm/@typescript-eslint [email protected]_@typescript-eslint [email protected][email protected][email protected]/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js:52:21)
    at ruleErrorHandler (~/idea2app/IdeaMall/mini-app/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1091:28)
    at ~/idea2app/IdeaMall/mini-app/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (~/idea2app/IdeaMall/mini-app/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (~/idea2app/IdeaMall/mini-app/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
    at NodeEventGenerator.applySelectors (~/idea2app/IdeaMall/mini-app/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
    at NodeEventGenerator.enterNode (~/idea2app/IdeaMall/mini-app/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/node-event-generator.js:340:14)
    at CodePathAnalyzer.enterNode (~/idea2app/IdeaMall/mini-app/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:803:23)
    at ~/idea2app/IdeaMall/mini-app/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1126:32
    at Array.forEach (<anonymous>)
    at runRules (~/idea2app/IdeaMall/mini-app/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1121:15)
    at Linter._verifyWithoutProcessors (~/idea2app/IdeaMall/mini-app/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1370:31)
    at Linter._verifyWithConfigArray (~/idea2app/IdeaMall/mini-app/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1822:21)
    at Linter.verify (~/idea2app/IdeaMall/mini-app/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1452:65)
    at Linter.verifyAndFix (~/idea2app/IdeaMall/mini-app/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:2083:29)
    at verifyText (~/idea2app/IdeaMall/mini-app/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/cli-engine/cli-engine.js:254:48)
    at CLIEngine.executeOnFiles (~/idea2app/IdeaMall/mini-app/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/cli-engine/cli-engine.js:834:28)
    at ESLint.lintFiles (~/idea2app/IdeaMall/mini-app/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/eslint/eslint.js:551:23)
    at Object.execute (~/idea2app/IdeaMall/mini-app/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/cli.js:402:36)
    at async main (~/idea2app/IdeaMall/mini-app/node_modules/.pnpm/[email protected]/node_modules/eslint/bin/eslint.js:152:22)

环境信息

👽 Taro v3.6.20


  Taro CLI 3.6.20 environment info:
    System:
      OS: Windows 10 10.0.19045
    Binaries:
      Node: 18.17.0 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.19 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
      npm: 10.1.0 - C:\Program Files\nodejs\npm.CMD
    npmPackages:
      @tarojs/cli: 3.6.20 => 3.6.20
      @tarojs/components: 3.6.20 => 3.6.20
      @tarojs/helper: 3.6.20 => 3.6.20
      @tarojs/plugin-framework-react: 3.6.20 => 3.6.20
      @tarojs/plugin-html: 3.6.20 => 3.6.20
      @tarojs/plugin-platform-alipay: 3.6.20 => 3.6.20
      @tarojs/plugin-platform-h5: 3.6.20 => 3.6.20
      @tarojs/plugin-platform-jd: 3.6.20 => 3.6.20
      @tarojs/plugin-platform-qq: 3.6.20 => 3.6.20
      @tarojs/plugin-platform-swan: 3.6.20 => 3.6.20
      @tarojs/plugin-platform-tt: 3.6.20 => 3.6.20
      @tarojs/plugin-platform-weapp: 3.6.20 => 3.6.20
      @tarojs/runtime: 3.6.20 => 3.6.20
      @tarojs/shared: 3.6.20 => 3.6.20
      @tarojs/taro: 3.6.20 => 3.6.20
      @tarojs/webpack5-runner: 3.6.20 => 3.6.20
      babel-preset-taro: 3.6.20 => 3.6.20
      eslint-config-taro: 3.6.20 => 3.6.20

原因分析

上游库维护者已分析出症结:

typescript-eslint/typescript-eslint#7996 (comment)

以下依赖需要更新:

"@typescript-eslint/parser": "^5.20.0"

parser: require.resolve('@typescript-eslint/parser'),

@taro-bot2 taro-bot2 bot added F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x labels Nov 28, 2023
@github-project-automation github-project-automation bot moved this to Padding in H5 Nov 28, 2023
@ZakaryCode ZakaryCode added the E-easy Helper Wanted - Easy label Feb 21, 2024
ZakaryCode added a commit that referenced this issue Feb 23, 2024
* fix(lint): 对齐模板 eslint 依赖版本 fix #14904

* fix(lint): fix err code lint
@github-project-automation github-project-automation bot moved this from Padding to Done in H5 Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Helper Wanted - Easy F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants