简体   繁体   中英

Typescript tuple lint error not consistent [vscode]

Following along with this great video on how to use types in typescript.

But I notice an inconsistency with my text editor's linting and the video.

The video shows like this

在此处输入图片说明

And mine shows like this

在此处输入图片说明

在此处输入图片说明

If I change the code, so it should not lint any errors, I still get the errors

在此处输入图片说明

What is going on here?

Don't know if this matter but I'm on typescript 3.3.x and the video is on 3.1.x

The video declared the array as follows:

const arr: myList = []

And you declared it like that:

const arr: myList[] = []

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