You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm loving the JSX support in the latest Code update, courtesy Salsa — thanks a ton for that! The thing is, I'm not ready to go all out on TS yet. Is it possible to just get the JSX auto-complete/IntelliSense support without running into issues like these:
I have been experimenting a bit and dropping a jsconfig.json in my project seems to do the trick and no longer shows these errors. Is that the way to achieve this?
I jumped too early. A jsconfig.json fixes the first error with the import but not the second one with the export.
To the second problem, It doesn't show an error for me, maybe it's because I have this in my jsconfig.json: { "compilerOptions": { "target": "ES6" }, "exclude": [ "node_modules" ] }
@tmkbry I have a similar config as yours, plus the "module": "commonjs" inside compilerOptions, but I can't get rid of the squigglies on the export either way.
EDIT: I think ideally the module should be es6 but jsconfig.json reports an error for that, which otherwise is acceptable inside a tsconfig.json.
import{connect}from'react-redux';constmapStateToProps=(state)=>{ ... };classAppextendsReact.Component{ ... }exportdefaultconnect(mapStateToProps)(App);// here be the relentless squiggly
The export throws the same error as before: 'export=' can only be used in a .ts file.
There seems to be a few issues above. What is the specific problem here? Is it that ES6 should be the default module type? (which would be incompatible with the other request for CommonJS to be the default modules type)? Or is that export default doesn't work for arrow functions?
I just tried all the things above which state they don't work, using the latest release-1.8 build, and they all look fine for me with no errors (including the React/Redux pattern above). Can you try with the latest bits and see if this is still an issue? Else looks like we've addressed the above patterns.
Per your request, I tried moving to the latest 1.8 release version on npm 1.8.0 and still see these errors. I then switched to typescript@next which currently gives me 1.9.0-dev.20160212 where all these errors indeed don't show up, so all looks good there.
But since you specifically asked me to check on 1.8 I'm wondering if its latest version is up on npm at all, because the currently 1.8.0 tagged version (2016-01-28T19:54:42.196Z) didn't fix these issues for me.
Prashant Tiwari (@prashaantt) typescript@next is whatever is currently in the master branch, so glad to see it's fixed there too! Thanks for checking.
release-1.8 is the release we're about to ship. Once it forks from master, then it only gets a new release on NPM when we push it, so it can be a little behind (as it is currently). There should be a new (hopefully final 1.8) up there shortly though.
Activity
egamma commentedon Feb 10, 2016
From Prashant Tiwari (@prashaantt) on February 9, 2016 16:1
I have been experimenting a bit and dropping ajsconfig.jsonin my project seems to do the trick and no longer shows these errors. Is that the way to achieve this?I jumped too early. A
jsconfig.jsonfixes the first error with the import but not the second one with the export.egamma commentedon Feb 10, 2016
From @tmkbry on February 9, 2016 16:20
Prashant Tiwari (@prashaantt) I had the same problem, the jsconfig.json fixed it for me, thanks.
To the second problem, It doesn't show an error for me, maybe it's because I have this in my jsconfig.json:
{ "compilerOptions": { "target": "ES6" }, "exclude": [ "node_modules" ] }egamma commentedon Feb 10, 2016
From Prashant Tiwari (@prashaantt) on February 9, 2016 16:29
@tmkbry I have a similar config as yours, plus the
"module": "commonjs"insidecompilerOptions, but I can't get rid of the squigglies on the export either way.EDIT: I think ideally the module should be
es6butjsconfig.jsonreports an error for that, which otherwise is acceptable inside atsconfig.json.egamma commentedon Feb 10, 2016
From Prashant Tiwari (@prashaantt) on February 9, 2016 18:35
Ok, so this works:
but this doesn't:
Awesome!
egamma commentedon Feb 10, 2016
From Prashant Tiwari (@prashaantt) on February 9, 2016 18:37
(Perhaps I should leave this issue open, just in case there's anything the Code team can do to make this alt syntax work too.)
egamma commentedon Feb 10, 2016
From Prashant Tiwari (@prashaantt) on February 9, 2016 19:26
Another instance that I can't work around:
The
exportthrows the same error as before:'export=' can only be used in a .ts file.egamma commentedon Feb 10, 2016
Extracted a separate issue for
Moving to Salsa
billti commentedon Feb 10, 2016
There seems to be a few issues above. What is the specific problem here? Is it that ES6 should be the default module type? (which would be incompatible with the other request for CommonJS to be the default modules type)? Or is that
export defaultdoesn't work for arrow functions?prashaantt commentedon Feb 10, 2016
It's more like
export defaultdoesn't work for some cases.Here are a few things that don't work:
These do work:
billti commentedon Feb 12, 2016
I just tried all the things above which state they don't work, using the latest
release-1.8build, and they all look fine for me with no errors (including the React/Redux pattern above). Can you try with the latest bits and see if this is still an issue? Else looks like we've addressed the above patterns.Thanks!
prashaantt commentedon Feb 12, 2016
Bill Ticehurst (@billti) Thanks for looking into this.
As recommended in the release notes for VS Code, my error report was based on
[email protected].Per your request, I tried moving to the latest 1.8 release version on npm
1.8.0and still see these errors. I then switched totypescript@nextwhich currently gives me1.9.0-dev.20160212where all these errors indeed don't show up, so all looks good there.But since you specifically asked me to check on 1.8 I'm wondering if its latest version is up on npm at all, because the currently
1.8.0tagged version (2016-01-28T19:54:42.196Z) didn't fix these issues for me.billti commentedon Feb 12, 2016
Prashant Tiwari (@prashaantt) typescript@next is whatever is currently in the
masterbranch, so glad to see it's fixed there too! Thanks for checking.release-1.8is the release we're about to ship. Once it forks frommaster, then it only gets a new release on NPM when we push it, so it can be a little behind (as it is currently). There should be a new (hopefully final 1.8) up there shortly though.prashaantt commentedon Feb 12, 2016
Awesome, thanks!