Skip to content

ES6 export default class has wrong name and longname #13

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
Sjeiti opened this issue May 14, 2018 · 2 comments
Closed

ES6 export default class has wrong name and longname #13

Sjeiti opened this issue May 14, 2018 · 2 comments

Comments

@Sjeiti
Copy link

Sjeiti commented May 14, 2018

When using source export default class MyClassName {} the extracted name and longname are not correct ('exports' and 'module.exports' respectively).
This does not seem to happen when using export default after the class declaration or non-default exports.

Check the code here https://runkit.com/embed/5008rb12y6pr

var jsdocApi = require("jsdoc-api")
jsdocApi.explain({ source: `/**
 * Lorem ipsum
 * @summary Foo bar baz
 */
export default class LoremIpsum {}

/**
 * Dolor sit
 * @summary Qux baz click
 */
class DolorSit {}

export {DolorSit};

/**
 * Foo Bar
 * @summary Lorem lorem lorem
 */
export class FooBar {}` }).then(console.log.bind(console));
@75lb
Copy link
Member

75lb commented May 15, 2018

does the same input source code produce the correct, expected output in jsdoc?

@Sjeiti
Copy link
Author

Sjeiti commented May 15, 2018

Ah you're right: I hadn't realised it was JSDoc itself under the hood.
I tested it and JSDoc indeed generates Class: exports.
It's seems to be this issue: jsdoc/jsdoc#1464

@Sjeiti Sjeiti closed this as completed May 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants