ivogabe / gulp-typescript

A TypeScript compiler for gulp with incremental compilation support.
MIT License
839 stars 129 forks source link

getSemanticDiagnostics returning errors #249

Closed adammartin1981 closed 8 years ago

adammartin1981 commented 8 years ago

I'm not sure if this is a gulp-typescript, or Typescript issue, however I'll raise here, and be happily shot down if it does turn out to be Typescript related.

I'm using a tsconfig.json file, both for the cmd line 'tsc' and also the same file for gulp-tyepscript.

When running from the cmd line, I don't get any erroneous output, however when running via gulp-typescript - I get semantic errors.

I'm not sure if this is going from 1.6.x. to 1.7.x, my code or an issue with gulp-typescript/Typescript.

The reason for flagging is that I don't necessarily know why I'm not seeing this output (or equivalent) via the 'tsc' command line and why I am within gulp-typescript.

I think the output from gulp-typescript is correct - i.e I can just about see why some errors are there, but slightly concerned that they're not being flagged elsewhere.

adammartin1981 commented 8 years ago

Sorry about this - found a fix - it was due to an erroneous *.d.ts file within the source.

https://github.com/DefinitelyTyped/DefinitelyTyped/issues/4035

It relates to angular-ui-router (thanks @kenhowardpdx), removing the d.ts file fixes the issue, and no more semantic errors.

For reference I was getting a lot of error TS2305: Module 'ng' has no exported member 'IDeferred' (or IPromise/IServiceProvider etc) even within other d.ts files (such as restangular).

kenhowardpdx commented 8 years ago

Since TS 1.6 we are now able to exclude folders from the TS compilation. You can now use the exclude property to exclude node_modules and bower_components folders.

This is probably the safest way to manage this since other members of your team won't need to remove the conflicting definition file.

https://github.com/Microsoft/TypeScript/wiki/tsconfig.json