Skip to content

fix(jsdoc): parse tags after interval notation in descriptions#20046

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/03-05-fix_jsdoc_parse_tags_after_interval_notation_in_descriptions
Mar 23, 2026
Merged

fix(jsdoc): parse tags after interval notation in descriptions#20046
graphite-app[bot] merged 1 commit intomainfrom
c/03-05-fix_jsdoc_parse_tags_after_interval_notation_in_descriptions

Conversation

@camc314
Copy link
Copy Markdown
Contributor

@camc314 camc314 commented Mar 5, 2026

No description provided.

@camc314 camc314 marked this pull request as ready for review March 5, 2026 21:53
Copilot AI review requested due to automatic review settings March 5, 2026 21:53
Copy link
Copy Markdown
Contributor Author

camc314 commented Mar 5, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of 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.

@github-actions github-actions bot added A-linter Area - Linter C-bug Category - Bug labels Mar 5, 2026
Copy link
Copy Markdown
Contributor

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

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_jsdoc verifying tags are still parsed after interval notation in descriptions.
  • Add linter rule test cases ensuring require_param / require_returns behave 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.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 5, 2026

Merging this PR will not alter performance

✅ 4 untouched benchmarks
⏩ 52 skipped benchmarks1


Comparing c/03-05-fix_jsdoc_parse_tags_after_interval_notation_in_descriptions (db35376) with main (6173e53)

Open in CodSpeed

Footnotes

  1. 52 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@leaysgur leaysgur added the 0-merge Merge with Graphite Merge Queue label Mar 23, 2026
Copy link
Copy Markdown
Member

leaysgur commented Mar 23, 2026

Merge activity

@graphite-app graphite-app bot force-pushed the c/03-05-fix_jsdoc_parse_tags_after_interval_notation_in_descriptions branch from 8b1202a to 5e893d7 Compare March 23, 2026 00:53
@graphite-app graphite-app bot merged commit 5e893d7 into main Mar 23, 2026
26 checks passed
@graphite-app graphite-app bot deleted the c/03-05-fix_jsdoc_parse_tags_after_interval_notation_in_descriptions branch March 23, 2026 00:56
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants