Skip to content

DefinitelyTyped largely incompatible with ES6 emit due to export syntax #2929

Closed

Description

@alexeagle

DefinitelyTyped is full of the old export = syntax. One random example I ran into:
https://github.com/borisyankov/DefinitelyTyped/blob/master/selenium-webdriver/selenium-webdriver.d.ts#L4847

But when I want to emit ES6, the compiler tells me I need to update that definition file to the new export default syntax. That might be fine for .d.ts files I own, but it's not reasonable to expect all of DefinitelyTyped to be updated by contributors.

I think one of these would be a good fix, in order:

  1. Make a commit across all of DefinitelyTyped to update export = to export default. (assuming there is no legacy config where export default doesn't work.)
  2. Allow export = syntax all the time, emit the right thing anyway
  3. like 2. but using a compiler flag to opt-in

Activity

  1. danquirk commented on Apr 27, 2015

    @danquirk
    Member

    This is definitely something we've talked about a bunch in relation to the ES6 module changes. In an ideal world we don't break what exists but also help pull people forward to ES6 style modules asap.

  2. alexeagle commented on Apr 27, 2015

    @alexeagle
    ContributorAuthor

    For now I think my only choice is to fork DefinitelyTyped and fix this in
    all the typings I use.

    On Mon, Apr 27, 2015 at 11:13 AM Dan Quirk [email protected] wrote:

    This is definitely something we've talked about a bunch in relation to the
    ES6 module changes. In an ideal world we don't break what exists but also
    help pull people forward to ES6 style modules asap.

    —
    Reply to this email directly or view it on GitHub
    #2929 (comment)
    .

  3. added
    Bug
    and removed
    Suggestion
    on Apr 27, 2015
  4. mhegazy commented on Apr 27, 2015

    @mhegazy
    Contributor

    The restriction in the compiler is not needed for ambient modules. we should remove it.

  5. added a commit that references this issue on Apr 27, 2015
    992bbff
  6. mhegazy commented on Apr 27, 2015

    @mhegazy
    Contributor

    handled in #2935

  7. lazdmx commented on Apr 28, 2015

    @lazdmx

    👍

  8. ivogabe commented on Apr 28, 2015

    @ivogabe
    Contributor

    Mohamed Hegazy (@mhegazy) I think you meant #2935, since #2929 is this issue..

  9. mhegazy commented on Apr 28, 2015

    @mhegazy
    Contributor

    Ivo Gabe de Wolff (@ivogabe) yes, you are correct. updating the comment. thanks!

  10. added a commit that references this issue on Apr 30, 2015
    64f3798
  11. added
    Fixed
    on Apr 30, 2015
  12. modified the milestones: , TypeScript 1.6 on Apr 30, 2015
  13. locked and limited conversation to collaborators on Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugFixed

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions