简体   繁体   中英

TSLint and VSCode Issues: All destructured elements are unused

Error 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)

Error 2:

All destructured elements are unused.

Error 3

Cannot find name 'container'.

在此处输入图片说明

在此处输入图片说明

What settings gone missing?

VSCode: Latest Version OS: Mac Catalina 10.15.3

JSX syntax is only valid in a .tsx file. Since you are in a .ts file, typescript will try to interpret the <> as a type assertion not a JSX tag, and parsing goes bad from there. Change the extension and it should work

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM