【发布时间】:2023-03-28 21:55:02
【问题描述】:
我想修正警告:
警告:找不到父 tsconfig.json
在IntelliJ IDEA 2016.3 中的 TypeScript Errors 选项卡中。我的 TypeScript 代码位于 src 目录中,并且我的 TypeScript 输出将按预期转到 lib,而不会将 src 文件夹添加到 lib。
我在其他项目中使用了lib 文件夹,它似乎按预期工作。所以这似乎不是一个大问题,但我偶尔会遇到 TSLint 的问题,它有时似乎无法获取 .tsx 文件是 JSX 并且 lints 不正确,并且似乎偶尔将其视为正常的 @987654329 @ 文件。最终它似乎想通了。我想知道这是否与我的 TSLint 设置配置为使用 tsconfig.json 有关。
我之前也有.js 转译文件出现在src 文件夹中的.ts 文件旁边,但自从我最近修改了我的tsconfig.json 之后就没有了。
文件如下:
tsconfig.json
src/index.ts
lib/index.js
lib/index.d.ts
我已升级到 TypeScript 2.1.4,但在 2.0.10 中看到了它。
我的tsconfig.json 文件:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"jsx": "react",
"allowJs": false,
"isolatedModules": false,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"declaration": true,
"noImplicitAny": false,
"noImplicitUseStrict": true,
"noEmitHelpers": false,
"removeComments": true,
"noLib": false,
"sourceMap": true,
"inlineSources": true,
"preserveConstEnums": true,
"allowSyntheticDefaultImports": true,
"suppressImplicitAnyIndexErrors": true,
"rootDir": "./src",
"outDir": "./lib"
},
"include": [
"./src/**/*"
],
"compileOnSave": true,
"atom": {
"rewriteTsconfig": false
}
}
【问题讨论】:
标签: typescript intellij-idea webstorm tsconfig