首页 > 解决方案 > 如何让 VS Code 识别 tsconfig.json?

问题描述

在我的 node.js 项目.ts文件中,我有

#date_created: Date = new Date();

但是VSCode说

Private identifiers are only available when targeting ECMAScript 2015 and higher.ts(18028)

但是在文件夹的根目录中,我有这个tsconfig.json文件

{
    "compilerOptions": {
        "outDir": "./dist/",
        "noImplicitAny": true,
        "module": "ES6",
        "target": "ES6",
        "lib": ["ES6"],
        "allowJs": false
    }
}

感觉就像 VS Code 没有正确阅读这个。我怎样才能解决这个问题?

标签: node.jstypescript

解决方案


推荐阅读