documentationjs / documentationjs/documentation

can the generated `new Foo()` code from class / functions be disabled/overrided by a @example?

Open
#580 7 comments 0 reactions 0 assignees View on GitHub
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

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.