不尊重打字稿库

时间:2021-04-14 08:16:34

标签: typescript

我的 tsconfig 看起来像这样

{
    "compileOnSave": false,
    "compilerOptions": {
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "module": "ESNext",
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "ES5",
    "lib": [
        "DOM",
        "ES5"
    ],
    "esModuleInterop": true,
    "typeRoots": ["src/types"],
    "types": [
        "animejs",
        "hammerjs",
        "jasmine",
        "node"
    ]
}

}

现在我预计在使用诸如

之类的代码时会出现故障
Object.values({'a': 1});

鉴于 ES5 不支持 Object.values,我预计会出现编译错误,但是这只是简单地通过而没有错误并且编译时就好像没有发现错误一样。

版本

"ts-loader": "~8.1.0",
"tslib": "~2.2.0",
"typescript": "~4.2.4",

我不确定我遗漏了什么?

提前致谢

0 个答案:

没有答案