Skip to content

fix(comments): prevent scoped package names from corrupting wrapped prose - #562

Merged
aversini merged 1 commit into
mainfrom
fix_comments_prevent_scoped_package_names_from_corrupting_wrapped_prose
May 30, 2026
Merged

aversini merged 1 commit into
mainfrom
fix_comments_prevent_scoped_package_names_from_corrupting_wrapped_prose

Conversation

@aversini

Copy link
Copy Markdown
Collaborator

Summary

isTagLine() classified any line starting with @ as a JSDoc tag. When reflowed prose placed a scoped npm package name (e.g. @auth0/auth0-react, @versini/ui-main) at the start of a wrapped line, the engine treated it as a paragraph boundary, flushed the in-progress sentence early, and injected a spurious period mid-clause — silently corrupting comments in a format-only diff.

Fix

Narrow the tag match with a negative lookahead so a scoped specifier (@scope/...) is no longer detected as a tag, while genuine @param, @returns, etc. still are:

/^@[A-Za-z][\w-]*(?![\w/-])/

Tests

Adds two regression tests:

  • a scoped package name is not treated as a tag (no injected period, sentence joined)
  • real @param/@returns tags still detected

All 50 tests pass; lint and typecheck clean.

🤖 Generated with Claude Code

…rose

isTagLine() classified any line starting with `@` as a JSDoc tag. When
reflowed prose placed a scoped npm package name (e.g. `@auth0/auth0-react`,
`@versini/ui-main`) at the start of a wrapped line, the engine treated it as
a paragraph boundary, flushed the in-progress sentence early, and injected a
spurious period mid-clause — silently corrupting comments in a format-only
diff.

Narrow the tag match with a negative lookahead so a scoped specifier
(`@scope/...`) is no longer detected as a tag, while genuine `@param`,
`@returns`, etc. still are. Adds regression tests covering both cases.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@aversini
aversini merged commit 52ba9d9 into main May 30, 2026
4 checks passed
@aversini
aversini deleted the fix_comments_prevent_scoped_package_names_from_corrupting_wrapped_prose branch May 30, 2026 15:23
@aversini aversini mentioned this pull request May 30, 2026
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.

1 participant