首页 > 解决方案 > tsconfig 文件中的语法错误?

问题描述

在此处输入图像描述

不知道为什么,但在我刚刚创建的这个 tsconfig.js 文件中出现解析错误。来源:https ://www.typescriptlang.org/docs/handbook/react-&-webpack.html

想法?

{
  "compilerOptions": {
    "outDir": "./moonholdings/",
    "sourceMap": true,
    "noImplicitAny": true,
    "module": "commonjs",
    "target": "es6",
    "jsx": "react"
  },
  "include": [
    "./app/**/*"
  ]
}

标签: javascripttypescripttsconfig

解决方案


文件扩展名应该是.json,不是.js


推荐阅读