Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn when documenting non-existing @param #2368

Closed
verhoevenv opened this issue Aug 22, 2023 · 1 comment
Closed

Warn when documenting non-existing @param #2368

verhoevenv opened this issue Aug 22, 2023 · 1 comment
Labels
enhancement Improved functionality

Comments

@verhoevenv
Copy link

Search Terms

warning, parameter, optional

Problem

When a typo or mistake is made in naming a parameter, the documentation string after it will be silently dropped.

The original case I found this for was when erroneously adding a question mark to the name of an optional parameter:

/**
 * This is a function.
 * 
 * @param mandatory Some parameter documentation
 * @param optional? Parameter documentation missing
 */
function withOptional(mandatory: string, optional?: string) {
}

Next to this case it's probably also useful with typos, or after renaming a parameter and forgetting to change the documention.

--validation.notDocumented also doesn't produce warning for this case, but that is probably expected.

Suggested Solution

Log a validation warning for parameters that couldn't be matched with the function signature.

If an option for this already exists in typedoc, I couldn't find it.

Linting tools can probably do this already. IntelliJ finds this and marks this as warning.

@verhoevenv verhoevenv added the enhancement Improved functionality label Aug 22, 2023
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Aug 23, 2023

This should happen even without any validation enabled, since it's obviously broken in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improved functionality
Projects
None yet
Development

No branches or pull requests

2 participants