-
Notifications
You must be signed in to change notification settings - Fork 12.8k
import statements are transpiled even if output is set to ES6 #5110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What version did the latest update give you? I tried the following code with 1.6.2:
With a file named tab_control.ts:
And using your tsconfig, I got the below output:
|
The version from master two days ago. Tracked from atom-typescript package.json to this version The bug was not in this version : git tag and not in 1.6 either (which is even older). |
refs microsoft/TypeScript#5110 closes #643 This reverts commit 8f752a6.
@basarat do you have a reproduction of this issue that you can share? |
Original issue report TypeStrong/atom-typescript#643 But I'll test more ... see below:
Quick test with I'll investigate further the next time I upgrade and comment. Sorry about a possibly invalid issue 🌹 |
@tomitrescak can you share a sample ... Would save me some time as another user had the same issue 🌹 |
Hello I got the same problem.
Previously it worked with an older version of atom-typescript on my laptop. On my pc i'm still using 7.4.3 and everything works fine. I also tried ntypescript(1.8.0) and it also transpiled correctly. |
Note: @Chocoloper tried with the command line (same version of ntypescript) and it works fine :-/ @Chocoloper can you share some simple files for my testing |
I made a small example. Take a look at the readme too see which versions I used and what the output was: |
@Chocoloper Cheers. I have a repro I suspect its because of a recent change where ES6 module compilation and ES6 general compilation were split (I think I saw an issue or PR regarding this but search is failing me). In any case the sample project : https://github.com/TypeStrong/atom-typescript-examples/tree/master/bugs/643 if save in atom-ts a.js comes out with |
I see |
closes #643 closes #692 refs microsoft/TypeScript#5110
Found it : #4811
@weswigham thanks for spotting that 🌹 I'll fix it. @Chocoloper Use {
"transpiler": "typescript",
"compileOnSave": true,
"compilerOptions": {
"target": "es6",
"module": "es6",
"declaration": false,
"noImplicitAny": false,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noLib": false,
"outDir": "build"
}
}
|
From @tomitrescak's original comment
would still be a bug if one does want to target ES6 but transpile modules to commonjs (perhaps others also) 🌹 |
I think that bug is specific to the JSXClosingTag, by the looks of it. The rest of the example is correct for commonjs emit. Possibly a kind of regression of what #4096 fixed? |
@basarat is this still an issue? |
@mhegazy nope, thanks! 🌹 |
thanks! |
Hi
Up until latest update my es6 imports were left the way they was when transpilig to es6.
From the latest update now they are transpiled to the module representation.
For example:
is transpiled to
The worst part is, that it breaks the TSX transpilation as for example
is transpiled to:
Note how the closing tag is not transpiled.
This is probably bug in transpilation, but can the transpilation of import statements be disabled? Up until today all was working well ... now none of my TS project runs ;((
For completeness, here is my tsconfig
The text was updated successfully, but these errors were encountered: