Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

allowSyntheticImports should do the emit for synthetic import as well #9562

Copy link
Copy link
@basarat

Description

@basarat
Issue body actions

I just migrated a largish project from Babel to TypeScript. This was the bulk of the changes, i.e. going from import React from "react" to import * as React from "react".

I know that babel definitely did a bad thing by allowing people to use export = as the default import http://stackoverflow.com/a/37152481/390330

however we already support type checking for that with allowSyntheticImports. Why not add the transpile for that as well. Reason being that a lot of JS code is being (even if wrongly) written in import fs from "fs" style (e.g webpack docs : https://gist.github.com/sokra/27b24881210b56bbaff7) and getting to all these people and telling them to stop doing it is no longer a possibility, so if we want a simpler 1-1 JS thats out there to TS migration this would greatly help

🌹

PS : I did a video with allowJs https://www.youtube.com/watch?v=gmKXXI_ck7w Love you guys ❤️

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    In DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.