codeant-ai-for-open-source[bot] commented on code in PR #41079:
URL: https://github.com/apache/superset/pull/41079#discussion_r3534359797
##########
superset-frontend/plugins/preset-chart-deckgl/src/layers/Polygon/controlPanel.ts:
##########
@@ -223,5 +223,6 @@ const config: ControlPanelConfig = {
metric: getStandardizedControls().shiftMetric(),
}),
};
+1;
Review Comment:
**Suggestion:** The standalone numeric expression is accidental dead code
and should be removed. Leaving it in can fail linting (`no-unused-expressions`)
and unnecessarily executes a meaningless statement every time the module is
loaded. [code quality]
<details>
<summary><b>Severity Level:</b> Critical 🚨</summary>
```mdx
- ❌ `npm run lint` fails on stray expression.
- ❌ `lint:full` CI checks fail for frontend.
- ⚠️ DeckGL plugins package cannot pass quality gates.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. From the Superset frontend root at
`superset-frontend/package.json:39-61`, run the
configured linter via `npm run lint`, which executes `npx oxlint --config
oxlint.json
--quiet`.
2. During linting, Oxlint analyzes the DeckGL polygon layer control panel
module at
`superset-frontend/plugins/preset-chart-deckgl/src/layers/Polygon/controlPanel.ts`,
where
the stray top-level expression `1;` appears after the `config` object and
before the
export (`lines 16-29` in the file excerpt, specifically line 27).
3. The codebase already treats bare expressions as suspect and uses explicit
`//
eslint-disable-next-line no-unused-expressions` comments where intentional
(see
`superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx:258,262,272,276,293,297,301`
found via Grep), implying that unused expressions are normally flagged by
lint rules.
4. Because the `1;` expression is not guarded by a disable comment and has
no side
effects, the linter flags it as an unused/no-op expression in
`controlPanel.ts`, causing
`npm run lint` (and any CI job that invokes it or `lint:full`) to fail until
the line is
removed.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=3cf880a6c15b41f8b07ab52e8b5e9486&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=3cf880a6c15b41f8b07ab52e8b5e9486&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/plugins/preset-chart-deckgl/src/layers/Polygon/controlPanel.ts
**Line:** 226:226
**Comment:**
*Code Quality: The standalone numeric expression is accidental dead
code and should be removed. Leaving it in can fail linting
(`no-unused-expressions`) and unnecessarily executes a meaningless statement
every time the module is loaded.
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%2F41079&comment_hash=97dfe0e80ccfaee01c5951dcc6554038f49f3633e62f7e058f46ebf698f9c678&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41079&comment_hash=97dfe0e80ccfaee01c5951dcc6554038f49f3633e62f7e058f46ebf698f9c678&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]