-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
base: main
Are you sure you want to change the base?
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
skipInterveningOverloadedDeclarations
boolean option with default value oftrue
- Updates the
getJSDocComment
call to pass thecheckOverloads
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.
…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
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. |
feat(
require-jsdoc
): add on-by-defaultskipInterveningOverloadedDeclarations
option; fixes #1434BREAKING CHANGE:
Now requires
skipInterveningOverloadedDeclarations: true
option to get behavior of checking at the top of overloaded functions from #1369