documentationjs / documentationjs/documentation

Are argument names strictly required to match @param names?

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

Description

* What version of documentation.js are you using?: 5.3.1
* How are you running documentation.js: CLI

I'm doing a little upgrade from (blast from the past) documentation@2.1.0-alpha1 to 5.3.1. Things are looking okay so far except I'm noticing that documentation is now grabbing the names of the arguments as they're written in my code and using those in the generated docs. If my `@param` name doesn't match, my docs don't build correctly.

Is there any way to disable this and revert to the old functionality? Now, it could be that I'm an awful programmer and I'm inviting destruction upon myself with this anti-pattern, but the reason I find it helpful to show one thing in the docs and another in the code is for some functions where I'm overloading arguments (possibly also a sin), I have a more general argument name before I do some type checking and get into specifics. For example, something like:

```js
function (fileName, options) {
var fn
if (typeof options === 'function') {
fn = options
}
}
```

Before I went through and renamed everything, figured I'd see if there's a way to override this so this project can continue to enable my terrible habits.

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.