fix(jsdoc): parse tags after interval notation in descriptions#20046
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Pull request overview
Fixes an edge case in the JSDoc parser where math interval notation like [min, max) in free-form descriptions could prevent subsequent @tag lines from being recognized, which in turn impacted jsdoc-related linter rules.
Changes:
- Reset square-bracket and parenthesis nesting state on newline during JSDoc parsing to avoid prose like
[min, max)blocking later tag detection. - Add a focused unit test in
oxc_jsdocverifying tags are still parsed after interval notation in descriptions. - Add linter rule test cases ensuring
require_param/require_returnsbehave correctly with that JSDoc shape.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/oxc_jsdoc/src/parser/parse.rs | Resets brace_depth / square_brace_depth per line so interval/prose brackets don’t suppress later @tag parsing. |
| crates/oxc_jsdoc/src/parser/jsdoc.rs | Adds a unit test asserting tags parse correctly after [min, max) appears in description text. |
| crates/oxc_linter/src/rules/jsdoc/require_returns.rs | Adds a regression test ensuring @returns is still recognized when interval notation appears in description. |
| crates/oxc_linter/src/rules/jsdoc/require_param.rs | Adds a regression test ensuring @param tags are still recognized when interval notation appears in description. |
You can also share your feedback on Copilot code review. Take the survey.
Merging this PR will not alter performance
Comparing Footnotes
|
Merge activity
|
8b1202a to
5e893d7
Compare

No description provided.