documentationjs / documentationjs/documentation

Class not recognised if declared in module.exports assignment

Open
#1,177 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.8k
Forks
481
PR merge metrics
No merged PRs in 30d

Description

The following code works:
```
/**
* This is an example.
*/
class Example { };
module.exports = Example;
```
The following code does not:
```
/**
* This is an example.
*/
module.exports = class Example { };
```
The second syntax is not recognised as a class declaration, so even using `@name Example` results in the class functions appearing at the root level instead of appearing inside the class. It would be nice if the second syntax was recognised as a class declaration as well!

Using documentation v8.1.2 through the CLI.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.