Skip to content

Studio: fix Sonar tsx issues + remove stale studio build files#3048

Merged
dpfaffenbauer merged 4 commits into
coreshop:5.1from
dpfaffenbauer:sonar-tsx-cleanup-5.1
May 26, 2026
Merged

Studio: fix Sonar tsx issues + remove stale studio build files#3048
dpfaffenbauer merged 4 commits into
coreshop:5.1from
dpfaffenbauer:sonar-tsx-cleanup-5.1

Conversation

@dpfaffenbauer

Copy link
Copy Markdown
Member

Summary

Cleanup pass on Pimcore Studio bundles addressing ~325 SonarCloud findings across .tsx files, plus removal of stale studio build artifacts.

Code fixes (111 .tsx files)

Rule Description Count
S3735 void operator removed (fire-and-forget promises) ~184
S6440 React Hook bugs — 5 conditional hooks moved before early returns, 1 rename (newUseDataQueryHelperuseNewDataQueryHelper) 6
S1128 Unused imports 15
S3863 Duplicate imports merged 10
S4325 Redundant ! non-null assertions / as any casts 19
S2933 Field readonly 7
S6481 Context Provider value wrapped in useMemo 3
S6759 Component props wrapped in Readonly<> 8
S7763 export from re-export pattern 9
S7764 windowglobalThis 2
S7773 parseInt/isNaNNumber.parseInt/Number.isNaN 5
S7744 ...(X ?? {})...X 10
S1082 A11y: onKeyDown + role/tabIndex on click handlers 4
S1854 Dead t import in EntityDetail 1
S1874 Deprecated SaleTabProps removed from tab signatures, substrsubstring 20
S6479 Stable list key in MessengerChart 1
S2486 Unused catch variable → anonymous catch 19
Real fix: error handling for floating customerCompanyApi.getEntityDetails(...) promises 2

Build artifacts

Removed 820 stale files in */Resources/public/studio/... that were no longer referenced.

Still open (not part of this PR)

~70 Sonar issues remain in tsx that need per-case domain review:

  • S3358 (9) nested ternaries
  • S6479 (10) array-index keys — need stable IDs
  • S7735 (8) negated conditions — many idiomatic
  • S6767 (13) unused PropType — interface design decision
  • S4325 (4) as any with TS strict-mode risk
  • Various S1854 (3), S6848 (4), S4144 (3), S3776 (3), misc S77xx/S6xxx

Test plan

  • Build all bundle frontends and confirm no TS / lint errors
  • Smoke-test:
    • Sale tabs (Invoice/Payment/Shipment/Detail/Correspondence) — state-change badges still trigger transitions, keyboard support works
    • Order/Cart/Quote detail widgets — loading + save still surface errors
    • Customer-to-Company assign flows — error toast appears when entity details fail
    • Exchange rates / voucher codes manager — error toasts on save/delete failure
    • Variant generator — error path
  • Messenger chart bars are still clickable + tabbable
  • No regressions in dynamic-types (Country/State/Currency/Carrier/Tax/Store re-exports)

@sonarqubecloud

Copy link
Copy Markdown

@dpfaffenbauer dpfaffenbauer merged commit 810872b into coreshop:5.1 May 26, 2026
129 checks passed
@dpfaffenbauer dpfaffenbauer deleted the sonar-tsx-cleanup-5.1 branch May 26, 2026 17:54
@github-actions github-actions Bot locked and limited conversation to collaborators May 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant