1
我已经阅读了吨操作系统的帖子,并没有任何人帮助过我。 我使用Atom开发反应/打字稿应用程序。 凌保持打印我的错误:未包含在TypeScript编译上下文中的Atom
"The file "C:/****/src/components/teste.tsx" is not included in the TypeScript compilation context. If this is not intended, please check the "files" or "filesGlob" section of your tsconfig.json file.at line 1 col 1
这是我tsconfig.json:
{
"compileOnSave": false,
"compilerOptions": {
"target": "es5",
"module": "system",
"moduleResolution": "node",
"isolatedModules": false,
"jsx": "react",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"declaration": false,
"noImplicitAny": false,
"removeComments": true,
"noLib": false,
"preserveConstEnums": true,
"suppressImplicitAnyIndexErrors": true
},
"filesGlob": [
"**/*.ts",
"**/*.tsx"
]
}
这是我teste.tsx:
import * as React from 'react';
export class Teste extends React.Component<{}, {}> {
render() {
return(
<div>
Hello, asdas
<Testando />
</div>
);
}
}
export default Teste;
当我运行项目浏览器同步一切工作正常,但Atom的这些错误是讨厌的,有人有线索如何解决这个问题?
(对不起,我的英语) 干杯
您是否尝试在* tsconfig.json *中添加以下属性:''atom“:{”rewriteTsconfig“:true}'和'”files“:[]'? – JeanMel
@JeanMel它现在添加了''files“:[”components/teste.tsx“,”dependencies.tsx“,”main.tsx“]'编辑器将所有应用程序文件带入数组,但即使重新启动,错误仍然存在编辑器,main.tsx和dependencies.tsx不会仅将这个错误带给components/teste.tsx –