bito-code-review[bot] commented on PR #43806:
URL: https://github.com/apache/superset/pull/43806#issuecomment-5518870789

   <!-- Bito Reply -->
   Adding an explicit return type to `mergeResizableConfig` is a recommended 
practice for exported functions in TypeScript modules. It ensures the public 
API surface remains stable and prevents accidental breaking changes if the 
internal implementation or the return type of `defaultResizableConfig` evolves.
   
   To implement this, you can import the `ResizableProps` or `ModalProps` type 
(depending on your project's type definitions) and use it as the return type 
annotation:
   
   ```typescript
   export function mergeResizableConfig(
     hideFooter: boolean | undefined,
     overrides: ModalProps['resizableConfig'] = {},
   ): ModalProps['resizableConfig'] {
     const defaults = defaultResizableConfig(hideFooter);
     // ... implementation
   }
   ```
   
   
**superset-frontend/packages/superset-ui-core/src/components/Modal/Modal.tsx**
   ```
   export function mergeResizableConfig(
     hideFooter: boolean | undefined,
     overrides: ModalProps['resizableConfig'] = {},
   ): ModalProps['resizableConfig'] {
     const defaults = defaultResizableConfig(hideFooter);
     if (!overrides || Object.keys(overrides).length === 0) {
       return defaults;
     }
     return {
       ...defaults,
       ...overrides,
       enable: {
         ...defaults.enable,
         ...overrides.enable,
       },
     };
   }
   ```


-- 
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]

Reply via email to