codeant-ai-for-open-source[bot] commented on code in PR #42157:
URL: https://github.com/apache/superset/pull/42157#discussion_r3627194271
##########
superset-frontend/src/middleware/asyncEvent.test.ts:
##########
@@ -18,7 +18,11 @@
*/
import fetchMock from 'fetch-mock';
import WS from 'jest-websocket-mock';
-import { parseErrorJson, isFeatureEnabled } from '@superset-ui/core';
+import {
+ parseErrorJson,
Review Comment:
**Suggestion:** `parseErrorJson` is imported but never used in this file,
which will fail CI in setups that enforce `noUnusedLocals`/lint rules and can
block test builds; remove the unused symbol from the import list. [possible bug]
<details>
<summary><b>Severity Level:</b> Minor ๐งน</summary>
```mdx
- โ ๏ธ Async event middleware test file has unused core import.
- โ ๏ธ Lint/build may fail if unused imports disallowed.
```
</details>
<details>
<summary><b>Steps of Reproduction โ
</b></summary>
```mdx
1. Open `superset-frontend/src/middleware/asyncEvent.test.ts` and locate the
import block
at lines 21-25 where `parseErrorJson` is imported from `@superset-ui/core`.
2. Scan the rest of the file (all tests in this file) and verify that
`parseErrorJson` is
never referenced, unlike `isFeatureEnabled` and `SupersetClient` which are
used later.
3. Run the project's lint or TypeScript build (e.g., `npm run lint` or `npm
run test` if
configured with `noUnusedLocals`/`no-unused-vars`); the tool will report an
unused import
error at line 22 for `parseErrorJson`.
4. Observe that, in CI environments where lint warnings are treated as
errors or
`noUnusedLocals` is enabled, this unused import will cause the asyncEvent
test file's
build/lint step to fail, potentially blocking the PR.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=a92b70e1ff104d74a874245e3169d9af&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=a92b70e1ff104d74a874245e3169d9af&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/src/middleware/asyncEvent.test.ts
**Line:** 22:22
**Comment:**
*Possible Bug: `parseErrorJson` is imported but never used in this
file, which will fail CI in setups that enforce `noUnusedLocals`/lint rules and
can block test builds; remove the unused symbol from the import list.
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%2F42157&comment_hash=3f4ae049f4009bc60120a42fd458ddf8e0a2ea04cb2e2fa0a19e493cbf3dd769&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42157&comment_hash=3f4ae049f4009bc60120a42fd458ddf8e0a2ea04cb2e2fa0a19e493cbf3dd769&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]