我是 TypeScript 的新手。
我正在努力将我自己的 React.js 项目迁移到 TypeScript 中,该项目是用 JS 编写的。
我修复了所有错误并检查了它在npm start
.
但是当我尝试用 tsc 编译时,它永远不会工作,也永远不会显示任何日志。
但正如你所看到的,tsc -v
有效。
我在 VSCode 中尝试了 Ctrl+Shift+B,但它也显示了相同的结果,没有。
在我的tsconfig.json
,我只是说outDir
成自动生成tsconfig.json
。
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react",
"outDir": "./dist"
},
"include": [
"./src/*"
]
}
无论如何我可以修复它吗?
提前致谢。