codeant-ai-for-open-source[bot] commented on code in PR #34629:
URL: https://github.com/apache/superset/pull/34629#discussion_r3479690721
##########
superset-frontend/packages/superset-core/src/theme/types.ts:
##########
@@ -24,6 +24,7 @@ import { theme as antdThemeImport } from 'antd';
* Get AntdThemeConfig type from the theme object
*/
import type { ThemeConfig } from 'antd';
+import type { DirectionType } from 'antd/es/config-provider';
Review Comment:
**Suggestion:** Remove the direct `antd` type import and use a local
direction union type or an existing exported type from approved Superset
wrappers so this file does not depend on `antd/es/*` directly. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
This file is frontend TypeScript code and imports a type directly from
`antd/es/config-provider`, which matches the rule against direct Ant Design
imports in UI code. The suggestion accurately identifies that the import should
come from a Superset-approved wrapper or another non-direct source.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=89a1f1bcfc264aa5a744006bef19fccd&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=89a1f1bcfc264aa5a744006bef19fccd&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/packages/superset-core/src/theme/types.ts
**Line:** 27:27
**Comment:**
*Custom Rule: Remove the direct `antd` type import and use a local
direction union type or an existing exported type from approved Superset
wrappers so this file does not depend on `antd/es/*` directly.
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.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F34629&comment_hash=1b4797626f88ade6d0ff8f86fde2ff58a3d180989bc3d1b5e96b56353d5d9b3c&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F34629&comment_hash=1b4797626f88ade6d0ff8f86fde2ff58a3d180989bc3d1b5e96b56353d5d9b3c&reaction=dislike'>👎</a>
##########
superset-frontend/packages/superset-core/src/theme/Theme.tsx:
##########
@@ -20,12 +20,14 @@
// eslint-disable-next-line no-restricted-syntax
import React from 'react';
import { theme as antdThemeImport, ConfigProvider } from 'antd';
+import stylisRTLPlugin from 'stylis-plugin-rtl';
import {
ThemeProvider,
CacheProvider as EmotionCacheProvider,
} from '@emotion/react';
import createCache from '@emotion/cache';
import { noop, mergeWith } from 'lodash';
+import { DirectionType } from 'antd/es/config-provider';
Review Comment:
**Suggestion:** Remove the direct `antd/es/config-provider` import and use
an approved shared type source (or a local narrowed union type) for direction
to keep UI code decoupled from raw Ant Design imports. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
This is a direct import from Ant Design in frontend UI code, which matches
the provided rule. Even though it is type-only usage, the rule explicitly flags
direct Ant Design imports and prefers approved wrappers or shared types instead.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=6694b37669674bcdb4d0d1f701fac155&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=6694b37669674bcdb4d0d1f701fac155&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/packages/superset-core/src/theme/Theme.tsx
**Line:** 30:30
**Comment:**
*Custom Rule: Remove the direct `antd/es/config-provider` import and
use an approved shared type source (or a local narrowed union type) for
direction to keep UI code decoupled from raw Ant Design imports.
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.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F34629&comment_hash=443d5d61dd764777293f9f8e4e2bdcc4eedcc8d985f46a451b6f470d8d8f1710&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F34629&comment_hash=443d5d61dd764777293f9f8e4e2bdcc4eedcc8d985f46a451b6f470d8d8f1710&reaction=dislike'>👎</a>
--
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]