Skip to content

refactor(types): replace 'any' types with explicit types in formUtils.ts - #1646

Open
Ranjeet2063 wants to merge 1 commit into
rinafcode:mainfrom
Ranjeet2063:fix-types-form-utils
Open

Ranjeet2063 wants to merge 1 commit into
rinafcode:mainfrom
Ranjeet2063:fix-types-form-utils

Conversation

@Ranjeet2063

Copy link
Copy Markdown

Summary

This PR replaces any type annotations with concrete types, generics, and unknown in src/utils/formUtils.ts.

Changes Made

  • custom: Updated validator signature to accept value: unknown.
  • getFormValues: Added generic parameter <T extends Record<string, unknown> = Record<string, unknown>> returning T instead of Record<string, any>.
  • formatFieldValue: Replaced value: any with value: unknown, safely converting to string/date/number.
  • parseFieldValue: Replaced any return type with explicit union string | number | boolean | Date.
  • sanitizeFormValues: Typed as generic <T extends Record<string, unknown>>(values: T): Partial<T>.
  • createFormData: Replaced Record<string, any> with Record<string, unknown>.
  • formDataToObject: Replaced Record<string, any> with Record<string, unknown>.

Closes #1359

Copilot AI balanced review requested due to automatic review settings October 2, 2026 19:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

Replace 'any' types with explicit types in src/utils/formUtils.ts

2 participants