Skip to content

refactor(typescript): fix SonarQube issues on extensible string types#1009

Merged
tbouffard merged 1 commit intomainfrom
refactor/improve_string_type_unions
Feb 23, 2026
Merged

refactor(typescript): fix SonarQube issues on extensible string types#1009
tbouffard merged 1 commit intomainfrom
refactor/improve_string_type_unions

Conversation

@tbouffard
Copy link
Copy Markdown
Member

@tbouffard tbouffard commented Feb 22, 2026

Replace all occurrences of string & {} with string & Record<never, never>
to avoid SonarQube warnings while preserving the loose autocomplete behavior
for string literal union types.

Summary by CodeRabbit

  • Refactor
    • Updated internal type definitions for improved type precision. No user-facing changes or behavioral impact.

Replace all occurrences of `string & {}` with `string & Record<never, never>`
to avoid SonarQube warnings while preserving the loose autocomplete behavior
for string literal union types.
@tbouffard tbouffard added the refactor Code refactoring label Feb 22, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 22, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

Type definitions in packages/core/src/types.ts are updated to replace (string & {}) with (string & Record<never, never>) across five exported type unions. This change refines the syntax for expressing branded string type constraints without altering any runtime behavior.

Changes

Cohort / File(s) Summary
Type String-Brand Constraint Updates
packages/core/src/types.ts
Replaced (string & {}) with (string & Record<never, never>) in five type declarations: CellStateStyle.perimeter, SpecialStyleColorValue, StyleArrowValue, StyleShapeValue, and StyleEdgeStyleValue. Type-only refactoring with no runtime changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is minimal but incomplete compared to the template requirements. It lacks required sections like PR checklist, issue references, testing information, documentation details, and expanded overview. Complete the PR description by filling out the required template sections including issue reference, checklist items, testing approach, and whether documentation changes are needed.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: replacing string type intersections to fix SonarQube issues, which is the core purpose of this refactoring PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

@tbouffard tbouffard merged commit 66c1d02 into main Feb 23, 2026
14 checks passed
@tbouffard tbouffard deleted the refactor/improve_string_type_unions branch February 23, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant