documentation
documentation copied to clipboard
@file is applied to following element instead of the file itself
If you use the @file statement to provide a description for your file in a header, it gets applied as a duplicate block to whichever element comes first in the file.
Example code:
/**
* @file Example file.
*/
/**
* Example class.
*/
class Example {
/**
* Example function.
*/
a() {
}
};
Here, the @file block should effectively be ignored, however documentation currently applies it to the following item, so in this case the Example class is duplicated.
I think if a docblock contains @file it should be ignored, or at least attached to the file and not to whatever element follows the block.
Here is the output of the above code, with the duplicate Example class:
### Table of Contents
- [Example][1]
- [a][2]
- [Example][3]
- [a][4]
## Example
Example file.
### a
Example function.
## Example
Example class.
### a
Example function.
[1]: #example
[2]: #a
[3]: #example-1
[4]: #a-1
Running 8.1.2 via CLI.
Same issue. (Although I prefer the alias @fileOverview, for anyone reading this and starting a fix. ☻)