Skip to content

Document default export #387

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

Closed
SimenB opened this issue Mar 20, 2016 · 3 comments
Closed

Document default export #387

SimenB opened this issue Mar 20, 2016 · 3 comments

Comments

@SimenB
Copy link

SimenB commented Mar 20, 2016

The generated documentation for a default, unnamed export, gets the header of the first argument.

I'm not familiar with JSDoc, so might just be me doing something weird.

Also, any way to properly document that it's the default, as it's not named?

And another thing while I'm here, why does parameters with default values get a = added? And why do I have to document the default value, when it's in the code? From #305 I think it should work, but it doesn't...

Sample: https://github.com/SimenB/wait-until-promise/blob/doc/API.md

@gajus
Copy link

gajus commented May 20, 2016

Is there any workaround this?

// ./index.js
import replaceFirst from './replaceFirst';

export {
    replaceFirst
};
// ./replaceFirst.js

/**
 * @public
 */
export default (test) => {};

Now the function exported from replaceFirst gets name "test" (first parameter name). Default export ought to be used name of the file (or in case if function is exported from ./src/replaceFirst/index.js - name of the folder).

@gajus
Copy link

gajus commented May 20, 2016

A simple workaround is to add @name JSDoc attribute.

@tmcw
Copy link
Member

tmcw commented May 27, 2016

This is now resolved with the changes in #435 - if a default export is unnamed, it is named after the file it is declared in. Going to lock this down with a test in es6.input.js

@tmcw tmcw closed this as completed in 661f5ce May 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants