mocha,jasmine的Typescript 2定义会导致重复的标识符

Sim*_*xca 2 typescript typescript-typings

重现的步骤:
1)npm install @types/mocha @types/jasmine
2)tsc

node_modules/@types/jasmine/index.d.ts(9,18): error TS2300: Duplicate identifier 'describe'.
node_modules/@types/jasmine/index.d.ts(11,18): error TS2300: Duplicate identifier 'xdescribe'.
...
node_modules/@types/mocha/index.d.ts(33,13): error TS2300: Duplicate identifier 'describe'.
node_modules/@types/mocha/index.d.ts(34,13): error TS2300: Duplicate identifier 'xdescribe'.
...
Run Code Online (Sandbox Code Playgroud)

我的项目结构:

node_modules
test.ts
tsconfig.json
Run Code Online (Sandbox Code Playgroud)

我的代码:

const a: number = 9;
Run Code Online (Sandbox Code Playgroud)

我的tsconfig.json:

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node"
  }
}
Run Code Online (Sandbox Code Playgroud)

Sim*_*xca 9

找到了.将该types选项tsconfig.jsontsc版本2.x 一起使用

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "types": []
  }
}
Run Code Online (Sandbox Code Playgroud)