unstale

npm / comment-json

comment-json

What changed in comment-json 4 to 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-25.

2 breaking4 new APIs and options1 tooling

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.8 on npm

comment-json 56 changes

Breaking changes 2

  • CommentToken is now a union that can include BlankLine tokens, so value and loc are no longer guaranteed on every token.

    5.0.0release notes

  • stringify() renders blank lines only from explicit BlankLine tokens, rather than inferring them from loc or historical line-break logic.

    5.0.0release notes

New APIs and options 4

  • Blank lines are represented by explicit BlankLine comment tokens used during parse() and stringify().

    5.0.0release notes

  • Parsing with no_blank_lines: true explicitly drops blank lines; default parsing preserves them as first-class tokens.

    5.0.0release notes

  • parse() accepts the no_comments option.

    5.0.0release notes

  • Removes blank lines globally or at a specific comment location.

    5.0.0release notes

comment-json 41 changes

Tooling 1

  • Improves TypeScript definitions for developers using the package.

    4.5.0release notes