Skip to content

Fix no-case-declarations ESLint error in plugin-aggrid#276

Merged
hotlong merged 2 commits intomainfrom
copilot/update-action-job-steps
Jan 30, 2026
Merged

Fix no-case-declarations ESLint error in plugin-aggrid#276
hotlong merged 2 commits intomainfrom
copilot/update-action-job-steps

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 30, 2026

CI failing on ESLint rule no-case-declarations in ObjectAgGridImpl.tsx:553.

Changes

Wrapped case 'number': block in braces to properly scope const precision declaration.

-    case 'number':
+    case 'number': {
       const precision = (field as any).precision;
       if (precision !== undefined) {
         colDef.valueFormatter = (params: any) => {
           if (params.value == null) return '';
           return Number(params.value).toFixed(precision);
         };
       }
       break;
+    }

Lexical declarations in case blocks require braces per ESLint rules to prevent scope leakage across cases.

Original prompt

引用: https://github.com/objectstack-ai/objectui/actions/runs/21507273920/job/61965996234#step:8:1


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectui Ready Ready Preview, Comment Jan 30, 2026 7:44am
objectui-components Ready Ready Preview, Comment Jan 30, 2026 7:44am
objectui-crm-app Error Error Jan 30, 2026 7:44am

Request Review

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Update action job steps for improved execution Fix no-case-declarations ESLint error in plugin-aggrid Jan 30, 2026
Copilot AI requested a review from hotlong January 30, 2026 07:33
@hotlong hotlong marked this pull request as ready for review January 30, 2026 09:37
Copilot AI review requested due to automatic review settings January 30, 2026 09:37
@hotlong hotlong merged commit 53dcd32 into main Jan 30, 2026
6 of 7 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a CI failure caused by an ESLint no-case-declarations rule violation in the ObjectAgGridImpl.tsx file. The issue occurs when a lexical declaration (const, let, or class) is used directly within a case block without braces, which can lead to unexpected scope behavior across different cases.

Changes:

  • Added braces to the case 'number': block to properly scope the const precision declaration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants