godaddy / godaddy/dmd

Function return type missing

Open
#9 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3
Forks
4
PR merge metrics
No merged PRs in 30d

Description

**Input**
File used for generating documentation (same as [here](https://github.com/jsdoc2md/jsdoc-to-markdown)):
```js
/**
* A quite wonderful function.
* @function
* @param {object} - Privacy gown
* @param {object} - Security
* @returns {survival}
*/
function protection (cloak, dagger) {}
```

**Output**
As is, the output generated with the plugin is the following:
```markdown
## protection(cloak, dagger)

A quite wonderful function.

**Kind**: global function

| Param | Type | Description |
| --- | --- | --- |
| cloak | `object` | Privacy gown |
| dagger | `object` | Security |

```

**Expected**
```markdown
## protection(cloak, dagger)

A quite wonderful function.

**Kind**: global function
**Returns**: `survival` <--- *this line was missing before

| Param | Type | Description |
| --- | --- | --- |
| cloak | `object` | Privacy gown |
| dagger | `object` | Security |

```

**Workaround**
To force the `return` type of my function to show up, I can add a description to the `@return` tag:
```js
/* eslint no-unused-vars: off */
/**
* A quite wonderful function.
* @function
* @param {object} - Privacy gown
* @param {object} - Security
* @returns {survival} test
*/
function protection (cloak, dagger) {}
```

Which produces in turn:
```markdown
## protection(cloak, dagger)

A quite wonderful function.

**Kind**: global function
**Returns**: `survival` - test <--- *now we have it

| Param | Type | Description |
| --- | --- | --- |
| cloak | `object` | Privacy gown |
| dagger | `object` | Security |

```

I am not sure if this is intended but I thought it would be nice to show to the user our function return type at any time and not only if we provide a description.

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.