Skip to content
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

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

Closed
alexeagle opened this issue Apr 27, 2015 · 7 comments
Closed
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@alexeagle
Copy link
Contributor

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
@danquirk danquirk added the Suggestion An idea for TypeScript label Apr 27, 2015
@danquirk
Copy link
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.

@alexeagle
Copy link
Contributor Author

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

@mhegazy mhegazy added Bug A bug in TypeScript and removed Suggestion An idea for TypeScript labels Apr 27, 2015
@mhegazy
Copy link
Contributor

mhegazy commented Apr 27, 2015

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

@mhegazy mhegazy self-assigned this Apr 27, 2015
@mhegazy mhegazy added this to the TypeScript 1.6 milestone Apr 27, 2015
@mhegazy
Copy link
Contributor

mhegazy commented Apr 27, 2015

handled in #2935

@lazdmx
Copy link

lazdmx commented Apr 28, 2015

👍

@ivogabe
Copy link
Contributor

ivogabe commented Apr 28, 2015

@mhegazy I think you meant #2935, since #2929 is this issue..

@mhegazy
Copy link
Contributor

mhegazy commented Apr 28, 2015

@ivogabe yes, you are correct. updating the comment. thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

5 participants