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

Handle ES6 module exports, with class reference (Feature Request) #19

Closed
mmoss opened this issue Jun 29, 2015 · 3 comments
Closed

Handle ES6 module exports, with class reference (Feature Request) #19

mmoss opened this issue Jun 29, 2015 · 3 comments

Comments

@mmoss
Copy link

@mmoss mmoss commented Jun 29, 2015

I was hoping to be able to encapsulate modules which are made up of a file which only export a single instance of a class (without the class being exported). Any chance of adding @module support for better ES6 module export handling? JSDoc handles it this way or this way. I'd love to chip in, just let me know if you'd be willing to accept a pull request if I added a test case for the new tag (and if I'd also need to file a PR for updating the documentation/website). ありがとう!

Example use case:

class Foo {}

/**
 * @type Foo
 * @module fooSingletonInstance
 */
export const fooSingletonInstance = new Foo();
@h13i32maru
Copy link
Member

@h13i32maru h13i32maru commented Jun 30, 2015

ESDoc head revision supports the following pattern.

// default export
class Foo {}
export default new Foo();

// named export
class Bar{}
let bar = new Bar();
export {bar};

And I plan to support the following pattern without any tag.

class Foo {}
export const foo = new Foo();

Documentation of this pattern shows Foo class and caution

@mmoss
Copy link
Author

@mmoss mmoss commented Jun 30, 2015

Awesome! Looks great.

@mmoss mmoss closed this Jun 30, 2015
h13i32maru added a commit that referenced this issue Jul 4, 2015
h13i32maru added a commit that referenced this issue Jul 4, 2015
#19
@h13i32maru
Copy link
Member

@h13i32maru h13i32maru commented Jul 4, 2015

@mmoss ESDoc supports instance exporting. I will release it in next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants