Jer*_*L30 15 eslint create-react-app typescript-eslint
我正在create-react-app与 TS 一起使用,import type但 eslint 在 VS Code 中抱怨说,Parsing error: '=' expected当悬停type在import type. 我正在使用 eslint,6.7.2
gol*_*pot 13
更新:@typescript-eslint/parser 和@typescript-eslint/eslint-plugin 的最新版本现在支持该语法。
ESLint 对 TSimport type语法的支持正在进行中。
问题:https : //github.com/typescript-eslint/typescript-eslint/issues/1436
拉取请求:https : //github.com/typescript-eslint/typescript-eslint/pull/1465
如果您使用的是 prettier 而不是 ESLint,那么解决方案是:
npm update prettier@latest
# Or yarn
yarn upgrade prettier@latest
Run Code Online (Sandbox Code Playgroud)
其中安装了更漂亮的版本“2.6.2”。import type { } from './types'这对我的语法有用
| 归档时间: |
|
| 查看次数: |
5229 次 |
| 最近记录: |