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

Consistent Enum Default Export Syntax #18989

Closed
drguildo opened this issue Oct 6, 2017 · 4 comments
Closed

Consistent Enum Default Export Syntax #18989

drguildo opened this issue Oct 6, 2017 · 4 comments
Labels
Duplicate An existing issue was already created

Comments

@drguildo
Copy link

drguildo commented Oct 6, 2017

It would be nice to have support for more consistent default export syntax when it comes to enums. I'm new to TypeScript so apologies if I'm missing something obvious but I can't see why

enum Foo {
  Bar, Baz
}
export default Foo;

should be fine when

default export Foo {
  Bar, Baz
}

isn't, when the latter syntax is allowed for things like classes and interfaces.

Like I say, I'm the opposite of a TypeScript expert but I can't see how adding support for the latter syntax would cause any problems and it would add a little bit more consistency and predictability which, all things being equal, are things that I, and I'm sure a lot of other people, value.

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Oct 6, 2017
@RyanCavanaugh
Copy link
Member

Duplicate of #3320

@RyanCavanaugh RyanCavanaugh marked this as a duplicate of #3320 Oct 6, 2017
@drguildo
Copy link
Author

drguildo commented Oct 6, 2017

In #3320 (comment) @DanielRosenwasser states

If you find yourself sorely missing this, you can suggest that we allow enums to be declared as default exports as part of a separate issue

which is what I'm doing.

@mhegazy
Copy link
Contributor

mhegazy commented Oct 6, 2017

I thought we are using #3792 to track all of these missing patterns, see #3792 (comment)

@drguildo
Copy link
Author

drguildo commented Oct 7, 2017

I wasn't aware of that bug. Sorry about the noise.

@drguildo drguildo closed this as completed Oct 7, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants