简体   繁体   English

vscode中奇怪的打字稿Object.values问题

[英]Strange typescript Object.values issue in vscode

I want to write Object.values and TS gives me a visual error (it compiles fine though). 我想编写Object.values ,TS给了我一个视觉上的错误(尽管编译很好)。

ts错误属性值在“ ObjectConstructor”类型上不存在

I've done the googling, restarted vscode, and that's my tsconfig.json . 我完成了谷歌搜索,重新启动了vscode,这就是我的tsconfig.json

在此处输入图片说明

Could this be a linter issue? 难道这是一个小问题? I'm using eslint with eslint-plugin-typescript . 我将eslinteslint-plugin-typescript eslint一起使用。 I did check their docs for something akin to a --lib option, but nothing. 我确实检查了他们的文档是否类似于--lib选项,但是什么也没有。 I assume it should read tsconfig.json . 我认为它应该读tsconfig.json

Oh, using select typescript version set to project's version, not vscode's. 哦,使用select typescript version设置为项目的版本,而不是vscode的版本。

Try using "lib": ["es2018"] for the moment. "lib": ["es2018"]尝试使用"lib": ["es2018"]

Object.values doesn't seem to be included in es2017 , which seems like a regression. Object.values中似乎没有包含es2017 ,这似乎是一种回归。 I've opened this issue to track the problem 我已打开此问题来跟踪问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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