Skip to content

#10531 - Refactor: Explicit/implicit Any type clean up from packages\ketcher-core\src\application\render\renderers\utils.ts file#10622

Open
AlexeyGirin with Copilot wants to merge 3 commits into
masterfrom
copilot/refactor-explicit-implicit-any-cleanup-3b7a06b5-250e-4955-931f-93c1b3fbe530
Open

#10531 - Refactor: Explicit/implicit Any type clean up from packages\ketcher-core\src\application\render\renderers\utils.ts file#10622
AlexeyGirin with Copilot wants to merge 3 commits into
masterfrom
copilot/refactor-explicit-implicit-any-cleanup-3b7a06b5-250e-4955-931f-93c1b3fbe530

Conversation

Copilot AI commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

How the feature works? / How did you fix the issue?

getRenderedStructuresBbox in renderers/utils.ts relied on untyped accumulators, which allowed implicit any and unsafe narrowing. This update makes bbox accumulation explicitly typed and initialization-safe without changing behavior.

  • Type safety hardening

    • Replaced untyped bbox accumulators with number | undefined.
    • Switched min/max updates to explicit undefined checks instead of truthy checks.
  • Return-path guarantees

    • Added a pre-return assertion to ensure bbox coordinates are initialized before width/height calculation.
let left: number | undefined;
// ...
left =
  left !== undefined ? Math.min(left, monomerPosition.x) : monomerPosition.x;

Check list

  • unit-tests written
  • e2e-tests written
  • documentation updated
  • PR name follows the pattern #1234 – issue name
  • branch name doesn't contain '#'
  • PR is linked with the issue
  • base branch (master or release/xx) is correct
  • task status changed to "Code review"
  • reviewers are notified about the pull request

Copilot AI changed the title [WIP] Refactor explicit/implicit Any type clean up in utils.ts #10531 – Refactor explicit/implicit any cleanup in renderer utils Jul 18, 2026
Copilot AI requested a review from AlexeyGirin July 18, 2026 21:31
@AlexeyGirin
AlexeyGirin marked this pull request as ready for review July 19, 2026 03:14
@AlexeyGirin AlexeyGirin changed the title #10531 – Refactor explicit/implicit any cleanup in renderer utils #10531 - Refactor: Explicit/implicit Any type clean up from packages\ketcher-core\src\application\render\renderers\utils.ts file Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: Explicit/implicit Any type clean up from packages\ketcher-core\src\application\render\renderers\utils.ts file

2 participants