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

Scoring on all exported symbols is overly punishing #975

Open
panva opened this issue Feb 22, 2025 · 2 comments
Open

Scoring on all exported symbols is overly punishing #975

panva opened this issue Feb 22, 2025 · 2 comments

Comments

@panva
Copy link

panva commented Feb 22, 2025

Consider the following module

export interface FooOptions {
  /**
   * Foo ...
   */
  foo: string
  /**
   * Bar ...
   */
  bar: string
}

/**
 * Foo Class Docs ...
 */
export class Foo {
  constructor(options: FooOptions) {
   // ...
  }

  // ...
}

Despite the class itself and every option being well documented and intellisense kicking in for new Foo({ ... }) this only yields 50% of documented exported symbols.

I would like to suggest that interfaces and type aliases be not considered in the scoring when it comes to exported symbols, or at the very least, have a much lower weight.

The alternative is that authors need to add rather pointless documentation such as

/**
 * Options for the {@link Foo} constructor
 */
export interface FooOptions {
  // ...
}
@crowlKats
Copy link
Collaborator

I would like to suggest that interfaces and type aliases be not considered in the scoring when it comes to exported symbols, or at the very least, have a much lower weight.

I dont agree with this; a lot of APIs relying mainly on having options available via an interface, or functions returning complex objects.

I think having to specify a comment in this scenario would be correct. It makes navigation much easier especially with a comment like you pointed out, since it would let you easily jump to the symbol that the options interface is for.

@crowlKats crowlKats removed the status in JSR Mar 11, 2025
@panva
Copy link
Author

panva commented Mar 11, 2025

I'm not in full disagreement with you, but, do you think the example above should be at 50% over the lack of a useless comment, which frankly, most of them will be because interfaces like these will always have a self-descriptive name?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants