Skip to content

Convert to TypeScript#495

Merged
erikras merged 2 commits intomainfrom
modernize
May 25, 2025
Merged

Convert to TypeScript#495
erikras merged 2 commits intomainfrom
modernize

Conversation

@erikras
Copy link
Member

@erikras erikras commented May 25, 2025

Long overdue. Adiós, Flow!

@erikras erikras requested a review from Copilot May 25, 2025 06:34
Copy link
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 migrates the codebase from Flow to TypeScript, updating imports, build/test configurations, and snapshots accordingly

  • Removes Flow annotations, plugins, and config files
  • Introduces TypeScript support in Rollup, Babel, ESLint, Jest, and npm scripts
  • Updates imports/extensions, inline snapshots, and adds new TS constants

Reviewed Changes

Copilot reviewed 52 out of 52 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/filterFieldState.test.ts Adjusts import to drop “.js” extension for TS resolution
src/fieldSubscriptionItems.ts Removes // @flow and adds as const assertion to the array
src/constants.ts Adds new TypeScript constants file
src/constants.js Deletes legacy Flow-based constants file
src/FinalForm.submission.test.ts Refreshes Jest inline snapshots for TS syntax
rollup.config.mjs Replaces Flow plugin with TypeScript plugin, updates input to TS
package.json Bumps dependencies, adds TS presets, updates test/coverage scripts
package-scripts.js Refactors npm script definitions, placeholders for TS declarations
.flowconfig Removes obsolete Flow configuration
.eslintrc Adds @typescript-eslint parser and plugin
.babelrc Switches from Flow to TypeScript preset

@erikras erikras force-pushed the modernize branch 2 times, most recently from 2842946 to 52c4b4f Compare May 25, 2025 06:52
Copy link
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 converts the codebase from Flow to TypeScript, removing Flow-specific configurations and dependencies while updating build, test, and lint setups accordingly.

  • Removed Flow annotations and configuration files
  • Added TypeScript configurations and updated relevant build/lint/test settings
  • Updated dependency versions and project scripts to support TypeScript

Reviewed Changes

Copilot reviewed 55 out of 55 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/fieldSubscriptionItems.ts Removed Flow annotation and added an "as const" assertion
src/constants.ts Introduced TypeScript constants
src/constants.js Removed now-obsolete Flow-based constants
src/FinalForm.submission.test.ts Updated inline snapshots to reflect TS conversion changes
rollup.config.mjs Removed Flow plugin and added TypeScript plugin configuration
package.json Updated dependency versions and removed Flow-related packages
package-scripts.js Updated scripts to eliminate Flow tasks and type copying
.github/workflows/ci.yml Updated Node.js version to 22
.flowconfig Removed Flow configuration file
.eslintrc Configured ESLint for TypeScript, including overrides
.babelrc Replaced Flow preset with TypeScript preset

@erikras erikras merged commit 3a80f58 into main May 25, 2025
3 checks passed
@erikras erikras deleted the modernize branch May 25, 2025 06:55
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.

2 participants