Дублированные @types в библиотеках машинописного текста (index.d.ts - Дублированный идентификатор) для jasmine, jasminewd2, mocha - PullRequest
1 голос
/ 06 марта 2019

У меня есть jasmine, jasminewd2 и mocha в моем проекте Angular. У этих библиотек есть index.d.ts файлы, которые, кажется, дублируются. Есть ли способ избежать этой ошибки? Поскольку моя Visual Studio не может его построить. Я уже пытался исключить эти файлы из моего tsconfig.json файла, обновление версии также не помогает.

6>C:\GIT\proj\node_modules\@types\jasmine\index.d.ts(20,18): error TS2300: Build:Duplicate identifier 'describe'.
6>C:\GIT\proj\node_modules\@types\jasmine\index.d.ts(22,18): error TS2300: Build:Duplicate identifier 'xdescribe'.
6>C:\GIT\proj\node_modules\@types\jasmine\index.d.ts(31,18): error TS2300: Build:Duplicate identifier 'it'.
6>C:\GIT\proj\node_modules\@types\jasmine\index.d.ts(41,18): error TS2300: Build:Duplicate identifier 'xit'.
6>C:\GIT\proj\node_modules\@types\jasminewd2\index.d.ts(10,18): error TS2300: Build:Duplicate identifier 'it'.
6>C:\GIT\proj\node_modules\@types\jasminewd2\index.d.ts(12,18): error TS2300: Build:Duplicate identifier 'xit'.
6>C:\GIT\proj\node_modules\@types\mocha\index.d.ts(36,13): error TS2300: Build:Duplicate identifier 'describe'.
6>C:\GIT\proj\node_modules\@types\mocha\index.d.ts(37,13): error TS2300: Build:Duplicate identifier 'xdescribe'.
6>C:\GIT\proj\node_modules\@types\mocha\index.d.ts(42,13): error TS2300: Build:Duplicate identifier 'it'.
6>C:\GIT\proj\node_modules\@types\mocha\index.d.ts(43,13): error TS2300: Build:Duplicate identifier 'xit'.
6>C:\GIT\proj\node_modules\@types\jasmine\index.d.ts(20,18): error TS2300: Build:Duplicate identifier 'describe'.
6>C:\GIT\proj\node_modules\@types\jasmine\index.d.ts(22,18): error TS2300: Build:Duplicate identifier 'xdescribe'.
6>C:\GIT\proj\node_modules\@types\jasmine\index.d.ts(31,18): error TS2300: Build:Duplicate identifier 'it'.
6>C:\GIT\proj\node_modules\@types\jasmine\index.d.ts(41,18): error TS2300: Build:Duplicate identifier 'xit'.
6>C:\GIT\proj\node_modules\@types\jasminewd2\index.d.ts(10,18): error TS2300: Build:Duplicate identifier 'it'.
6>C:\GIT\proj\node_modules\@types\jasminewd2\index.d.ts(12,18): error TS2300: Build:Duplicate identifier 'xit'.
6>C:\GIT\proj\node_modules\@types\mocha\index.d.ts(36,13): error TS2300: Build:Duplicate identifier 'describe'.
6>C:\GIT\proj\node_modules\@types\mocha\index.d.ts(37,13): error TS2300: Build:Duplicate identifier 'xdescribe'.
6>C:\GIT\proj\node_modules\@types\mocha\index.d.ts(42,13): error TS2300: Build:Duplicate identifier 'it'.
6>C:\GIT\proj\node_modules\@types\mocha\index.d.ts(43,13): error TS2300: Build:Duplicate identifier 'xit'.

1 Ответ

0 голосов
/ 19 марта 2019

Благодаря JimiPajala у нас есть решение.

Я добавил "skipLibCheck": true, в tsconfig.json

Относительно документации: " Пропустить проверку типов всех файлов объявлений ( .d.ts). *" https://www.typescriptlang.org/docs/handbook/compiler-options.html

...