Skip to content

ES6 modules broken in 0.10.8 with Salsa #2848

Closed

Description

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:

image

image

Activity

  1. changed the title [-]Salsa with JSX without TypeScript[/-] [+]Salsa in JS with JSX without TypeScript[/+] on Feb 9, 2016
  2. prashaantt commented on Feb 9, 2016

    @prashaantt
    Author

    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.

  3. prashaantt commented on Feb 9, 2016

    @prashaantt
    Author

    @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.

  4. prashaantt commented on Feb 9, 2016

    @prashaantt
    Author

    Ok, so this works:

    export default function () { }

    but this doesn't:

    export default () => { }

    Awesome!

  5. prashaantt commented on Feb 9, 2016

    @prashaantt
    Author

    (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.)

  6. prashaantt commented on Feb 9, 2016

    @prashaantt
    Author

    Another instance that I can't work around:

    import { connect } from 'react-redux';
    
    const mapStateToProps = (state) => { ... };
    
    class App extends React.Component { ... }
    
    export default connect(mapStateToProps)(App); // here be the relentless squiggly

    The export throws the same error as before: 'export=' can only be used in a .ts file.

  7. changed the title [-]Salsa in JS with JSX without TypeScript[/-] [+]ES6 modules broken in 0.10.8 with Salsa[/+] on Feb 10, 2016
  8. egamma commented on Feb 10, 2016

    @egamma
    Member

    Extracted a separate issue for

    I think ideally the module should be es6 but jsconfig.json reports an error for that, which otherwise is acceptable inside a tsconfig.json .

    Moving to Salsa

  9. egamma commented on Feb 10, 2016

    @egamma
    Member

    This issue was moved to microsoft/TypeScript#7006

  10. prashaantt commented on Feb 10, 2016

    @prashaantt
    Author

    Erich Gamma (@egamma) Sorry you needed to do this spring cleaning, I'll try discerning between issues that belong to TypeScript. I hope this is all automated for you to copy over to the right repo :)

    You and your team are doing an amazing job with Code 👍

  11. egamma commented on Feb 10, 2016

    @egamma
    Member

    Prashant Tiwari (@prashaantt) no need to sorry. We need this feedback and the issue mover (https://github-issue-mover.appspot.com/) helps a lot. Also glad you like Code.

  12. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions