-
-
Notifications
You must be signed in to change notification settings - Fork 169
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
feat(require-jsdoc): add on-by-default skipInterveningOverloadedDeclarations option
#1452
Conversation
require-jsdoc): add off-by-default exemptInterveningOverloadedFunctions optionrequire-jsdoc): add on-by-default exemptInterveningOverloadedFunctions option
e1ed530 to
353bd57
Compare
require-jsdoc): add on-by-default exemptInterveningOverloadedFunctions optionrequire-jsdoc): add on-by-default skipInterveningOverloadedDeclarations option
353bd57 to
5a90cf6
Compare
There was a problem hiding this 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
skipInterveningOverloadedDeclarationsboolean option with default value oftrue - Updates the
getJSDocCommentcall to pass thecheckOverloadsparameter based on this option - Updates package dependency
@es-joy/jsdoccommentfrom~0.53.0to~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.
5a90cf6 to
bfa90a6
Compare
|
I tested it and it almost suitable for my use cases. It would be fine if there is an additional option My current rule is to document every overload declarations, but not the implementation. This is also how VSCode displays documentation when you hover the pointer over a variable: it only shows the documentation for the overloads, not the implementation. Even if you hover the pointer over the implementation function itself, it will still show the documentation of the first overload. Of course, you can also ignore it if it's difficult to implement, because it already suitable for my use cases now. |
e337cf0 to
b011cb5
Compare
…e overload skipping except conditionally for require-jsdoc with new on-by-default `skipInterveningOverloadedDeclarations` option; fixes gajus#1434 Now requires default `skipInterveningOverloadedDeclarations: true` option to get behavior of checking at the top of overloaded functions from gajus#1369
…ds) for templates; fixes gajus#1462
b011cb5 to
2bfcc2e
Compare
|
🎉 This PR is included in version 54.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
feat(
require-jsdoc,require-param): update jsdoccomment to disable overload skipping except conditionally for require-jsdoc with new on-by-defaultskipInterveningOverloadedDeclarationsoption; fixes #1434Now requires default
skipInterveningOverloadedDeclarations: trueoption to get behavior of checking at the top of overloaded functions from #1369Also fixes #758 .