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

Destructured parameter in interface causes "not used" warning #2483

Closed
pvditto opened this issue Jan 15, 2024 · 3 comments
Closed

Destructured parameter in interface causes "not used" warning #2483

pvditto opened this issue Jan 15, 2024 · 3 comments
Labels
bug Functionality does not match expectation no bug This is expected behavior

Comments

@pvditto
Copy link

pvditto commented Jan 15, 2024

Search terms

interface @param destructured not used

Expected Behavior

When I define an interface that has a method using a destructured parameter and individual fields are documented using @param, I expect no warning about the parameter not being used as long as it is used in implementations of the interface.

Actual Behavior

Typedoc emits a warning [warning] The signature TestInterface.method has an @param with name "options.field", which was not used.

Steps to reproduce the bug

  • create index.ts with content below
  • run npx typedoc@0.25.7 index.ts
type Options = {
    field: string
}

interface TestInterface {
    /**
     * @param options.field test field
     */
    method(options: Options): void
}

class TestClass implements TestInterface {
    method(options: Options) {
        console.log(options.field)
    }
}

Environment

  • Typedoc version: 0.25.7
  • TypeScript version: -
  • Node.js version: 20.10.0
  • OS: -
@pvditto pvditto added the bug Functionality does not match expectation label Jan 15, 2024
@pvditto
Copy link
Author

pvditto commented Jan 15, 2024

0.25.4 seems to be the latest version not affected

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 19, 2024

This is working as expected -- that description isn't used and won't be present in your documentation. There's an open issue, #2147, for changing that, but it needs design work.

@Gerrit0 Gerrit0 added the no bug This is expected behavior label Jan 19, 2024
@pvditto
Copy link
Author

pvditto commented Jan 19, 2024

Oh, thank you for the clarification Gerrit. I'll close this and follow the linked issue instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation no bug This is expected behavior
Projects
None yet
Development

No branches or pull requests

2 participants