Skip to content

fix(coding-conventions): Address no-capitalized-function-calls in viewHierarchy utils - #121921

Open
sentry[bot] wants to merge 2 commits into
masterfrom
seer/fix/rect-empty-lint
Open

fix(coding-conventions): Address no-capitalized-function-calls in viewHierarchy utils#121921
sentry[bot] wants to merge 2 commits into
masterfrom
seer/fix/rect-empty-lint

Conversation

@sentry

@sentry sentry Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

The no-capitalized-function-calls lint rule, part of the React Compiler's lint suite, flagged the call to Rect.Empty() in static/app/components/events/viewHierarchy/utils.tsx.

This rule prohibits calling capitalized functions that are not React components, as the compiler uses capitalization to distinguish components. Rect.Empty() is a static factory method, not a React component, and thus violated this convention.

This change replaces Rect.Empty() with new Rect(0, 0, 0, 0) at the flagged call site within the useResizeCanvasObserver hook. Other usages of Rect.Empty() in the codebase were not affected as they occur in contexts (e.g., class property initializers) where this specific lint rule does not apply.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Fixes CODING-CONVENTIONS-1P3

@sentry
sentry Bot requested a review from a team as a code owner August 13, 2026 01:42
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Aug 13, 2026
@ryan953 ryan953 added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Aug 13, 2026
The no-capitalized-function-calls rule flags capitalized function calls because they read as React component invocations. Rect.Empty() tripped it in viewHierarchy utils.

Rename the static method itself rather than avoiding the call, matching the convention fix applied elsewhere. All 16 call sites are updated. FlamegraphChart.Empty and Flamegraph.Empty are separate symbols and are left untouched.
@ryan953
ryan953 requested a review from a team as a code owner August 13, 2026 05:10
@github-actions github-actions Bot removed the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant