【发布时间】:2020-05-07 01:02:00
【问题描述】:
我在 TS 中使用 create-react-app 并执行 import type 但 eslint 在 VS Code 中抱怨说 Parsing error: '=' expected 悬停在 type 中时 import type。我正在使用 eslint,6.7.2
【问题讨论】:
标签: create-react-app eslint typescript-eslint
我在 TS 中使用 create-react-app 并执行 import type 但 eslint 在 VS Code 中抱怨说 Parsing error: '=' expected 悬停在 type 中时 import type。我正在使用 eslint,6.7.2
【问题讨论】:
标签: create-react-app eslint typescript-eslint
更新:@typescript-eslint/parser 和 @typescript-eslint/eslint-plugin 的最新版本现在支持该语法。
对 TS import type 语法的 ESLint 支持正在进行中。
问题:https://github.com/typescript-eslint/typescript-eslint/issues/1436
拉取请求:https://github.com/typescript-eslint/typescript-eslint/pull/1465
【讨论】:
npm i @typescript-eslint/parser@latest @typescript-eslint/eslint-plugin@latest吗?