codeant-ai-for-open-source[bot] commented on code in PR #36952:
URL: https://github.com/apache/superset/pull/36952#discussion_r2668289240


##########
superset-frontend/src/core/extensions/index.ts:
##########
@@ -19,9 +19,8 @@
 import type { extensions as extensionsType } from '@apache-superset/core';
 import ExtensionsManager from 'src/extensions/ExtensionsManager';
 
-const getExtension: typeof extensionsType.getExtension = id => {
-  throw new Error('Not implemented yet');
-};
+const getExtension: typeof extensionsType.getExtension = id =>

Review Comment:
   **Suggestion:** Invalid use of the `typeof` operator on a type-only import: 
`extensionsType` is imported with `import type` (a type), so `typeof 
extensionsType.getExtension` is not the correct way to refer to the function 
type and can produce a type error; use an indexed access type to refer to the 
property type instead. [type error]
   
   **Severity Level:** Minor ⚠️
   ```suggestion
   const getExtension: extensionsType['getExtension'] = id =>
   ```
   <details>
   <summary><b>Why it matters? ⭐ </b></summary>
   
   Correct — `extensionsType` is a type-only import so `typeof 
extensionsType.getExtension`
   is invalid (type queries require a value). Using an indexed access type 
`extensionsType['getExtension']`
   fixes the type reference and preserves the original function signature. This 
is a real type error visible in the hunk.
   </details>
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/src/core/extensions/index.ts
   **Line:** 22:22
   **Comment:**
        *Type Error: Invalid use of the `typeof` operator on a type-only 
import: `extensionsType` is imported with `import type` (a type), so `typeof 
extensionsType.getExtension` is not the correct way to refer to the function 
type and can produce a type error; use an indexed access type to refer to the 
property type instead.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   ```
   </details>



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