I try to migrate an existing ES6 codebase to TypeScript 1.8. To smoothen the path I tried to apply following typescript compiler settings:
{
"compilerOptions": {
"target": "es6",
"allowJs": true,
"sourceMap": true,
"jsx": "react",
"outDir": "built"
},
"exclude": [
"node_modules"
]
}
After compilation with tsc
I have tons of compile errors in type definition files.
Example:
typings/main/definitions/sinon/sinon.d.ts(436,1): error TS2300: Duplicate identifier 'export='.
typings/main/definitions/sinon/sinon.d.ts(440,1): error TS2300: Duplicate identifier 'export='.
The type definitions are maintained by typings
.
Hope someone can give me a hint what is wrong with my environment.
Your issue here is likely that sinon is being included twice. The reason is Typings creates a
main.d.ts
andbrowser.d.ts
and duplicates some of the files. Read more on that here.In short, what you want to do is change your tsconfig to resemble something like the following: