Skip to content

fix: replace any[] with FieldValues[] and remove stale eslint-disable in CreateFieldsImportExport#1643

Open
Copilot wants to merge 3 commits intomainfrom
copilot/update-any-type-to-specific-type
Open

fix: replace any[] with FieldValues[] and remove stale eslint-disable in CreateFieldsImportExport#1643
Copilot wants to merge 3 commits intomainfrom
copilot/update-any-type-to-specific-type

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 6, 2026

Two minor code quality issues in CreateFieldsImportExport.tsx: imprecise any[] type on exported state, and a misleading eslint-disable comment on a let binding that is intentionally reassigned.

Changes

  • Type precision: useState<any[]>useState<FieldValues[]>FieldValues was already imported; the state holds the same type as the rows prop.
  • Remove stale lint suppression: Dropped // eslint-disable-next-line prefer-const before let { data, errors }. The let is correct since data is reassigned during key normalization; the comment was incorrectly suggesting otherwise.
Original prompt
Please apply the following diffs and create a pull request.
Once the PR is ready, give it a title based on the messages of the fixes being applied.

[{"message":"The type 'any[]' should be replaced with a more specific type. Consider using 'FieldValues[]' or the appropriate type that matches the structure returned by 'getRowsForExport'.","fixFiles":[{"filePath":"libs/features/create-object-and-fields/src/CreateFieldsImportExport.tsx","diff":"diff --git a/libs/features/create-object-and-fields/src/CreateFieldsImportExport.tsx b/libs/features/create-object-and-fields/src/CreateFieldsImportExport.tsx\n--- a/libs/features/create-object-and-fields/src/CreateFieldsImportExport.tsx\n+++ b/libs/features/create-object-and-fields/src/CreateFieldsImportExport.tsx\n@@ -39,7 +39,7 @@\n   const { google_apiKey, google_appId, google_clientId } = useAtomValue(applicationCookieState);\n   const { hasGoogleDriveAccess, googleShowUpgradeToPro } = useAtomValue(googleDriveAccessState);\n   const popoverRef = useRef<PopoverRef>(null);\n-  const [exportData, setExportData] = useState<any[]>(rows);\n+  const [exportData, setExportData] = useState<FieldValues[]>(rows);\n   const [exportModalOpen, setExportModalOpen] = useState(false);\n \n   function handleCloseModal() {\n"}]},{"message":"The eslint-disable comment suggests 'data' should be const, but it's reassigned on line 85. Either use const and create a new variable for the transformed data, or remove the comment if the mutation is intentional.","fixFiles":[{"filePath":"libs/features/create-object-and-fields/src/CreateFieldsImportExport.tsx","diff":"diff --git a/libs/features/create-object-and-fields/src/CreateFieldsImportExport.tsx b/libs/features/create-object-and-fields/src/CreateFieldsImportExport.tsx\n--- a/libs/features/create-object-and-fields/src/CreateFieldsImportExport.tsx\n+++ b/libs/features/create-object-and-fields/src/CreateFieldsImportExport.tsx\n@@ -53,7 +53,6 @@\n   }\n \n   async function handleImport({ content }: InputReadFileContent) {\n-    // eslint-disable-next-line prefer-const\n     let { data, errors } = await parseFile(content, { onParsedMultipleWorkbooks });\n     trackEvent(ANALYTICS_KEYS.sobj_create_field_import_fields, {\n       numFields: data.length,\n"}]}]

…isable comment in CreateFieldsImportExport

Agent-Logs-Url: https://github.com/jetstreamapp/jetstream/sessions/94e44f6e-a9ea-4ade-b537-2b7be89115a6

Co-authored-by: paustint <5461649+paustint@users.noreply.github.com>
Copilot AI changed the title [WIP] Update any[] type to specific type in CreateFieldsImportExport fix: replace any[] with FieldValues[] and remove stale eslint-disable in CreateFieldsImportExport Apr 6, 2026
Copilot AI requested a review from paustint April 6, 2026 23:27
@paustint paustint marked this pull request as ready for review April 7, 2026 03:24
Copilot AI review requested due to automatic review settings April 7, 2026 03:24
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 targets code quality in CreateFieldsImportExport.tsx by tightening a state type and removing a stale ESLint suppression around an intentionally reassigned let binding.

Changes:

  • Replaced useState<any[]> with useState<FieldValues[]> for exportData
  • Removed // eslint-disable-next-line prefer-const above let { data, errors } = ... in handleImport

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@paustint paustint force-pushed the copilot/update-any-type-to-specific-type branch from 0ef1c57 to 9a2aa09 Compare April 8, 2026 02:48
…tData state and type getRowsForExport accumulator

Agent-Logs-Url: https://github.com/jetstreamapp/jetstream/sessions/55106e57-f28e-450f-9874-1157f6486509

Co-authored-by: paustint <5461649+paustint@users.noreply.github.com>
@paustint paustint force-pushed the copilot/update-any-type-to-specific-type branch from 9a2aa09 to 790ebe3 Compare April 8, 2026 02:49
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