只要我运行tsc -p .
,它就会返回一个错误堆栈:
error TS5023: Unknown compiler option 'checkJs'. error TS5023: Unknown compiler option 'resolveJsonModule'. error TS5023: Unknown compiler option 'noUnusedParameters'. error TS6047: Argument for '--target' option must be 'ES3', 'ES5', or 'ES6'. error TS5023: Unknown compiler option 'esModuleInterop'. error TS5023: Unknown compiler option 'moduleResolution'.
只有 some 个编译器选项被认为是有效的,而大多数不是。
这是我的tsconfig.json
:
{
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"skipDefaultLibCheck": true,
"inlineSourceMap": false,
"noImplicitAny": true,
"resolveJsonModule": true,
"noUnusedParameters": true,
"target": "esnext",
"esModuleInterop": true,
"module": "commonjs",
"moduleResolution": "node",
"outDir": "api/dist"
},
"include": [
"api/src/*"
],
"exclude": [
"node_modules",
"api/test/*"
]
}
我不确定为什么会这样。我在网上找不到任何类似的问题。