Skip to content

feat(require-jsdoc): add on-by-default skipInterveningOverloadedDeclarations option #1452

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brettz9
Copy link
Collaborator

@brettz9 brettz9 commented Aug 15, 2025

feat(require-jsdoc): add on-by-default skipInterveningOverloadedDeclarations option; fixes #1434

BREAKING CHANGE:

Now requires skipInterveningOverloadedDeclarations: true option to get behavior of checking at the top of overloaded functions from #1369

@brettz9 brettz9 changed the title feat(require-jsdoc): add off-by-default exemptInterveningOverloadedFunctions option feat(require-jsdoc): add on-by-default exemptInterveningOverloadedFunctions option Aug 15, 2025
@brettz9 brettz9 force-pushed the exempt-intervening-overloaded-functions branch from e1ed530 to 353bd57 Compare August 15, 2025 11:35
@brettz9 brettz9 changed the title feat(require-jsdoc): add on-by-default exemptInterveningOverloadedFunctions option feat(require-jsdoc): add on-by-default skipInterveningOverloadedDeclarations option Aug 15, 2025
…clarations` option; fixes gajus#1434

BREAKING CHANGE:

Now requires `skipInterveningOverloadedDeclarations: true` option to get behavior of checking at the top of overloaded functions from gajus#1369
@brettz9 brettz9 force-pushed the exempt-intervening-overloaded-functions branch from 353bd57 to 5a90cf6 Compare August 15, 2025 23:09
@brettz9 brettz9 requested a review from Copilot August 16, 2025 09:57
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new skipInterveningOverloadedDeclarations option to the require-jsdoc rule that controls whether the rule should skip checking overloaded function declarations for JSDoc comments when a comment exists on a preceding overload. The option defaults to true, which is a breaking change from the previous behavior.

  • Adds skipInterveningOverloadedDeclarations boolean option with default value of true
  • Updates the getJSDocComment call to pass the checkOverloads parameter based on this option
  • Updates package dependency @es-joy/jsdoccomment from ~0.53.0 to ~0.54.0

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/rules/requireJsdoc.js Adds the new option schema, parameter handling, and passes checkOverloads to getJSDocComment
test/rules/assertions/requireJsdoc.js Adds test cases for both enabled and disabled skipInterveningOverloadedDeclarations behavior
test/rules/assertions/requireParam.js Adds a test case showing the new default behavior for overloaded functions
docs/rules/require-jsdoc.md Documents the new option with examples and updates the options table
.README/rules/require-jsdoc.md Updates the README template with the new option documentation
docs/rules/require-param.md Adds an example showing the new behavior
package.json Updates the @es-joy/jsdoccomment dependency version
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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

Successfully merging this pull request may close these issues.

[require-param]: false positive to TypeScript overload function when the next function has no jsdoc
1 participant