TSLint和VSCode问题:未使用所有已分解元素

问题描述 投票:0回答:1

错误1:

Type assertion using the '<>' syntax is forbidden. Use the 'as' syntax instead. (no-angle-bracket-type-assertion)tslint(1)
This assertion is unnecessary since it does not change the type of the expression. (no-unnecessary-type-assertion)tslint(1)
'SchemaForm' refers to a value, but is being used as a type here.ts(2749)

错误2:

All destructured elements are unused.

错误3

Cannot find name 'container'.

enter image description here

enter image description here

缺少哪些设置?

VSCode:Latest Version操作系统:Mac Catalina 10.15.3

reactjs typescript visual-studio-code tslint macos-catalina
1个回答
0
投票

JSX语法仅在.tsx文件中有效。由于您位于.ts文件中,因此打字稿将尝试将<>解释为类型声明而不是JSX标记,并且从那里解析会变糟。更改扩展名,它应该可以工作

© www.soinside.com 2019 - 2024. All rights reserved.