TypeScript 1.5 ES6 模块和来自 DefinitelyTyped 的 .d.ts 文件似乎不兼容

TypeScript 1.5 ES6 modules & .d.ts files from DefinitelyTyped seem incompatible

我正在使用 WebStorm 进行 Web 开发并且最近从内置的 TypeScript 1.4 编译器升级到了 1.5.3。然而,并非一切都如我所愿,因为编译器开始产生错误,提示我删除 --module commonjs 参数并改为切换到 ES6 模块(我正在使用 --target es6)。这样做之后,我开始收到错误消息,指出在以 ES6 为目标时无法使用导入分配,并且我应该改用新的模块语法(错误 1202)。所以我转换了所有文件,但显然这还不够,因为通过 tsd 从 DefinitelyTyped 存储库安装的 .d.ts 文件使用旧语法,使编译器不断给出相同的错误。

我为 .d.ts 文件编写了一个小型转换器,它工作得相当好,尽管偶尔会让我在这里和那里手动修复错误。我想知道是否有更好的解决方法?也许,我错过了什么?

P.S。将 --target 更改为 es5 不是一个选项,否则编译器会抱怨缺少我在项目中大量使用的承诺之类的东西。

Changing the --target to es5 is not an option as the compiler would otherwise complain about absence of things like promises which I heavily use in my project.

使用--target es5 --noLib,然后手动引入es6.lib.d.ts