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

出现错误:Cannot read properties of undefined (reading 'type')。需要更新下最新的配置信息,否则ESLint将报错失效。 #104

Closed
Yancy1028 opened this issue Feb 16, 2023 · 1 comment

Comments

@Yancy1028
Copy link

导致出现问题的配置行:

目前测试下来,发现的出现问题的地方是 ignoredNodes 下的 JSXElement > * 会导致ESLint 无法进行 lint 操作。

可以考虑更新到版本: https://github.com/benjamn/ast-types/blob/master/src/def/jsx.ts,内容如下:

       ignoredNodes: [
          "JSXElement",
          "JSXAttribute",
          "JSXIdentifier",
          "JSXNamespacedName",
          "JSXMemberExpression",
          "JSXSpreadAttribute",
          "JSXExpressionContainer",
          "JSXOpeningElement",
          "JSXClosingElement",
          "JSXFragment",
          "JSXOpeningFragment",
          "JSXClosingFragment",
          "JSXText",
          "JSXEmptyExpression",
          "JSXSpreadChild",
        ],
  • @vue/cli 版本 5.0.8

  • 安装的项目是vue 2.0 +typescript 的运行环境。

  • ESLint 继承的是 eslint-config-ali/typescript/vue

  • ESLint 版本:7.32.0

  • ESLint 运行时错误提示如下:

[Info  - 18:22:37] ESLint server is starting.
[Info  - 18:22:37] ESLint server running in node v16.13.2
[Info  - 18:22:37] ESLint server is running.
[Info  - 18:22:39] ESLint library loaded from: E:\Yancy\Documents\Visual Studio 2022\Workspaces\路\OfficialWebsite\lufu.tools.line_phone_call.app_ui\node_modules\_eslint@7.32.0@eslint\lib\api.js
[Error - 18:22:45] An unexpected error occurred:
[Error - 18:22:45] TypeError: Cannot read properties of undefined (reading 'type')
……
@guoyunhe
Copy link
Collaborator

guoyunhe commented Apr 3, 2024

请更新到最新版本:

tnpx f2elint@latest

@guoyunhe guoyunhe closed this as completed Apr 3, 2024
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

2 participants