在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
Typescript v3.9 introduces the @ts-expect-error assertion added to TypeScript 3.9. This assertion is more descriptive than @ts-ignore because, rather than just ignoring the next line, it is explicitly ignoring a compiler error. // @ts-expect-error const num: number = 'hello' // @ts-ignore const num2: number = 'hello Both will work.
If change to: ts-expect-error: means that this should have error, but I want to ingore it. if it compile correctly, then it report a error. If this is not longer be an error, means that something has been changed.
It can help if the types is defined in another file, it was modified without benn notified |
请发表评论