Open Maxim-Filimonov opened 9 years ago
Disable semantic checks. It's an option.
I'm looking at https://github.com/Microsoft/TypeScript/blob/v1.4/bin/typescriptServices.d.ts#L1086 Not sure which option
@Maxim-Filimonov sample : https://github.com/basarat/typescript-simple/commit/7503d1447606d13c8103d268ecc9242874ff750f#diff-c1129c8b045390789fa8ff62f2c6b4a9R81
doSemanticChecks
: https://github.com/basarat/typescript-simple/commit/7503d1447606d13c8103d268ecc9242874ff750f#diff-ed009b6b86b017532ef0489c77de5100R30
@Maxim-Filimonov I've added about doSemanticChecks
to README!
Resolving reference path in typescript-simple is not simple. Because typescript-simple doesn't know the path of source code, it cannot resolve the relative reference path. It requires another option.
Yeah I'm not an expert but maybe this can be adopted somehow: https://github.com/ivogabe/gulp-typescript/blob/3422fbff06532ccc57368f3b4c8801de8f72ef27/lib/project.ts#L263 I feel like I am using typescript-simple for the case it's not supposed to be used:
I'm using jest test framework to test react components written in typescript. I'm trying to use typescript-simple to compile *.ts files into .js so that jest can require them. Is that a valid use case or not?
Is that a valid use case or not
Valid use case. Its used by atom to allow it to require
.ts
files https://github.com/atom/atom/pull/5898
gulp / grunt etc are great for complete validation of your code. Jest doesn't care.
@Maxim-Filimonov
I'm trying to use typescript-simple to compile *.ts files into .js
typescript-simple doesn't compile multiple file structure, because of the simplicity. I think official tsc or other full-featured tool is better for your case.
@teppeis @basarat I appear to be having the same issue. I just discovered that atom uses this module to transpile TypeScript (https://github.com/atom/atom/blob/a70be30ee7017b86114592800d9d4bdccff88aa8/src/typescript.coffee#L60-L62) but I get At L1: File '../../typings/tsd.d.ts' not found.
@blakeembrey can you share the src code that atom is trying to compile? You shouldn't be getting this error because we have semantic checks switched of new TypeScriptSimple(options, false)
i.e. false
in the second option
@blakeembrey I just did a quick test : this package works fine : https://github.com/basarat/atom-typescript-test/blob/master/index.ts#L1
Ok, I'm trying to update now just in case (turns out I'm using Atom 0.190.0
but I didn't see any commits in between that changed things).
Hmm sorry. I just hit it
@basarat That looks like it :+1: What did you do different? On that note, updating didn't change anything for me either.
What did you do different?
I did reload atom with ctrl+alt+r
somehow that didn't capture it. Quiting and reopening atom triggered it
@teppeis Issue is that reference
imports are considered a syntactic error.
@teppeis added failing test : https://github.com/teppeis/typescript-simple/pull/18
@blakeembrey note that the current workaround is not to use reference imports.
NOTE: reference imports should not be used and are not needed if you are using external modules with tsconfig.json
: https://github.com/TypeStrong/atom-typescript/blob/master/docs/tsconfig.md
@teppeis We have a passing build + fix with TypeScript 1.5 : https://github.com/teppeis/typescript-simple/pull/19
@basarat thanks! @blakeembrey sorry, please wait for TypeScript 1.5.
This change broke the getScriptSnapshot
behavior which lead to this issue https://github.com/power-assert-js/espower-typescript/issues/35
Is it possible to use this module to compile source code which is using external modules? I can't figure out how to make this simple file to work
Keep getting