bito-code-review[bot] commented on code in PR #44559:
URL: https://github.com/apache/superset/pull/44559#discussion_r4079587296
##########
superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx:
##########
@@ -519,4 +519,10 @@ const sharedControls: Record<string,
SharedControlConfig<any>> = {
...matrixifyControls,
};
+type RegisteredControl = (typeof controlConfigs)[keyof typeof controlConfigs];
+
+// Each control retains the option type accepted by its renderer.
+const sharedControls: typeof controlConfigs &
+ Record<string, RegisteredControl> = controlConfigs;
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Redundant no-op type alias</b></div>
<div id="fix">
`RegisteredControl` and the intersection on lines 522-526 are a type-level
no-op: `...matrixifyControls` (line 519, `Record<string,
SharedControlConfig<any>>`) injects an index signature into `controlConfigs`,
so `keyof typeof controlConfigs` is `string` and `RegisteredControl` collapses
to `SharedControlConfig<any>`. The comment's intent ('retains the option type
accepted by its renderer') isn't achieved, and exported
`SharedControls`/`SharedControlAlias` are unchanged. Consider dropping the
redundant alias or restructuring the spread.
</div>
</div>
<small><i>Code Review Run #5ebf77</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]