Skip to content

fix(deps): update dependency comment-json to v5#596

Open
renovate[bot] wants to merge 1 commit intomainfrom
renovate/comment-json-5.x
Open

fix(deps): update dependency comment-json to v5#596
renovate[bot] wants to merge 1 commit intomainfrom
renovate/comment-json-5.x

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate bot commented Apr 12, 2026

This PR contains the following updates:

Package Change Age Confidence
comment-json 4.6.25.0.0 age confidence

Release Notes

kaelzhang/node-comment-json (comment-json)

v5.0.0

Compare Source

MAJOR: blank lines are now modeled explicitly instead of being inferred from loc and historical line-break logic.

  • Introduce explicit BlankLine comment tokens and use them during parse() / stringify().
  • Add parse(code, reviver, { no_comments, no_blank_lines }).
  • Add removeBlankLines() for removing blank lines globally or at a specific comment location.
  • Improve round-trip behavior for JSON files that rely on preserved blank lines, including a Bun-derived regression fixture.
  • Update TypeScript definitions and documentation for the new blank-line model.
Potential breaking changes

This release may introduce breaking changes for consumers who directly inspect or mutate comment tokens:

  • CommentToken is now a union type. A token may be { type: 'BlankLine', inline: false }, so value and loc are no longer guaranteed on every token.
  • stringify() no longer uses loc or the old internal blank-line history to infer empty lines. Blank lines are rendered only from explicit BlankLine tokens.
  • Custom logic that manually creates or rewrites comment token arrays may need to be updated to preserve blank lines correctly.
Behavior differences

If your existing usage includes business logic related to blank lines, you may notice behavior differences:

  • Code that previously relied on loc-based blank-line rendering may now produce different output unless it preserves BlankLine tokens explicitly.
  • Code that assumed every comment token was a line/block comment may need an extra type check for BlankLine.
  • Parsing with { no_blank_lines: true } now provides an explicit way to drop blank lines, while default parsing preserves them as first-class tokens.

An upgrade review is recommended for dependents that have custom comment-token processing or formatting logic around blank lines.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • "after 6am and before 6pm"
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@sonarqubecloud
Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants