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

JSDoc optional #242

Closed
5 tasks done
holtwick opened this issue Sep 13, 2023 · 2 comments
Closed
5 tasks done

JSDoc optional #242

holtwick opened this issue Sep 13, 2023 · 2 comments

Comments

@holtwick
Copy link
Contributor

Describe the bug

This is not really a bug, more a request.

With the latest changes @parm and @returns are automatically added on lint:fix. This causes my source code to bloat up. I usually use comments like this in one line to quickly annotate the use case of a functionality and be able to see it then in VSCode as a tooltip. Example:

/** Calculates the sum of `a` and `b` */
function sum(a: number, b: number): number {
  return a + b
}

This now becomes:

/**
 * Calculates the sum of `a` and `b`
 * @param a
 * @param b
 */
function sum(a: number, b: number): number {
  return a + b
}

4 additional lines ;)

Tooltip in VSCode:

20230913-115502-capture-holtwick@2x

Reproduction

See description.

System Info

System:
    OS: macOS 13.5.2
    CPU: (8) arm64 Apple M1
    Memory: 321.00 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.8.1 - ~/.nvm/versions/node/v18.12.1/bin/npm
    pnpm: 7.17.0 - /opt/homebrew/bin/pnpm
  Browsers:
    Edge: 116.0.1938.76
    Safari: 16.6

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@antfu
Copy link
Owner

antfu commented Sep 13, 2023

I am actually fine to disable that rule. The introduction of jsdoc plugin is more for formatting and enforcing such params is not intended. If you can find which rule causing it, feel free to send a pr to turn it off

holtwick added a commit to holtwick/eslint-config that referenced this issue Sep 13, 2023
Avoid adding undesired @param and @returns lines.
@holtwick
Copy link
Contributor Author

I think I have found the culprits ;) See PR. Thanks for fixing it.

@antfu antfu closed this as completed in ca91ad1 Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants