documentationjs / documentationjs/documentation
can the generated `new Foo()` code from class / functions be disabled/overrided by a @example?
Open
enhancement
- Dominant language
- JavaScript
- Stars
- 5.8k
- Forks
- 481
- PR merge metrics
- No merged PRs in 30d
Description
```
/**
*/
class Foo {..}
```
will generate doc with a code block:
```
new Foo()
```
Similarly, functions will generate an automatic block.
I have 2 usecases where I want to disable this behavior... I also don't understand the idea behind this. Why is it not disabled when you provide a `@example` ?
2 usecases are:
- React class component. You never want to say `new MyComponent()` for a react component, because it's not how you will ever instanciate it.
- string template. They are functions, but they aren't used as functions! ``` foo`...` ```
Contributor guide
Assessment
This issue has not been assessed yet.