【发布时间】:2018-07-04 12:58:10
【问题描述】:
最近我在一个typescript项目的VSCode中遇到如下情况:
文件:some-interface.ts
// no import statements have been skipped. This is the whole file:
export interface SomeInterface {
property: AnotherInterface;
}
和文件:another-interface.ts:
export interface AnotherInterface {
// ...
}
好的 - 因为some-interface.ts VS 代码中没有 import 语句,所以告诉我找不到类型 AnotherInterface 的错误。当然,这是预期的行为。 但是我不小心从another-interface.ts 中删除了export 关键字 - VS 代码停止抱怨并且可以正确解析类型。
那么有人知道这里发生了什么吗?这是预期的行为还是打字稿或 vs 代码的错误?
【问题讨论】:
标签: typescript visual-studio-code