Conversation
Bumps [peter-evans/create-or-update-comment](https://github.com/peter-evans/create-or-update-comment) from 3 to 5. - [Release notes](https://github.com/peter-evans/create-or-update-comment/releases) - [Commits](peter-evans/create-or-update-comment@v3...v5) --- updated-dependencies: - dependency-name: peter-evans/create-or-update-comment dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4 to 6. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](actions/setup-node@v4...v6) --- updated-dependencies: - dependency-name: actions/setup-node dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 19.2.10 to 19.2.14. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react) --- updated-dependencies: - dependency-name: "@types/react" dependency-version: 19.2.14 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [cypress](https://github.com/cypress-io/cypress) from 15.9.0 to 15.13.0. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md) - [Commits](cypress-io/cypress@v15.9.0...v15.13.0) --- updated-dependencies: - dependency-name: cypress dependency-version: 15.13.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
…e/actions/setup-node-6 Bump actions/setup-node from 4 to 6
- Convert src/validationFunctions.js → src/validationFunctions.ts - Convert src/formUtils.js → src/formUtils.ts - Convert src/useValidation.js → src/useValidation.ts - Convert src/index.js → src/index.ts with type re-exports - Remove manual types/index.d.ts (now auto-generated via vite-plugin-dts) - Add tsconfig.json with strict mode - Update vite.config.js to use .ts entry and dts plugin - Update package.json types field to point to dist/index.d.ts - Add typescript and vite-plugin-dts as dev dependencies - Update cypress test imports to remove .js extensions Agent-Logs-Url: https://github.com/Enterwell/react-form-validation/sessions/024b1f72-0daf-4fca-813d-93f6e09775eb Co-authored-by: AleksandarDev <[email protected]>
…cypress-15.13.0 Bump cypress from 15.9.0 to 15.13.0
…e/peter-evans/create-or-update-comment-5 Bump peter-evans/create-or-update-comment from 3 to 5
…types/react-19.2.14 Bump @types/react from 19.2.10 to 19.2.14
Agent-Logs-Url: https://github.com/Enterwell/react-form-validation/sessions/6aa6fff8-c2de-4be5-b7ef-15aa6fe8d981 Co-authored-by: AleksandarDev <[email protected]>
…ect-to-typescript # Conflicts: # pnpm-lock.yaml
…escript Convert project from JavaScript to TypeScript
|
@jpaladin Version should be bumped! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the library codebase from JavaScript to TypeScript and updates the build/package outputs to publish both ESM and CJS bundles along with generated type declarations.
Changes:
- Added TypeScript sources (
*.ts) andtsconfig.json, removing the hand-writtentypes/index.d.ts. - Updated Vite library build to emit both
index.mjsandindex.cjs, and addedvite-plugin-dtsto generatedist/index.d.ts. - Updated package metadata (
main/module/types/exports) and refreshed related dev dependencies and GitHub Actions versions.
Reviewed changes
Copilot reviewed 11 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
vite.config.js |
Adds vite-plugin-dts and switches library entry to src/index.ts; outputs both ESM and CJS. |
types/index.d.ts |
Removes manually maintained declarations in favor of generated typings. |
tsconfig.json |
Introduces TypeScript compiler configuration for the project. |
src/validationFunctions.ts |
TypeScript port of validation helpers with JSDoc. |
src/validationFunctions.js |
Removes the JavaScript implementation after TS migration. |
src/useValidation.ts |
Adds exported public types (FieldConfig, Field, Fields) and generic hook typing. |
src/index.ts |
Re-exports runtime APIs and newly exported public types. |
src/formUtils.ts |
Adds stronger typings (including ExtractedValues) and TS ports of form utilities. |
package.json |
Updates output entry points and introduces conditional exports; adds TS + dts plugin dev deps. |
pnpm-lock.yaml |
Locks new/updated dependencies (TypeScript, vite-plugin-dts, etc.). |
cypress/components/localRemoteValidation.cy.jsx |
Updates imports to align with TS source paths. |
.github/workflows/version-check.yml |
Updates action version used for PR commenting. |
.github/workflows/npm-publish.yml |
Updates actions/setup-node major version. |
.github/workflows/build.yml |
Updates actions/setup-node major version. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
src/formUtils.ts:127
submitFormcurrently doesn't declare a return type, so TypeScript will infer it asunknown | Promise<unknown>(losing the ability to reflect the actualonSubmitreturn type and theundefinedcase when the form is invalid). Consider adding a generic for the submit return type (e.g.,<TReturn, ...>(..., onSubmit: (...) => TReturn) => TReturn | Promise<TReturn> | undefined) and typing thenew Promiseaccordingly.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Updated isNotNull function documentation to reflect that it checks for non-null values.
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Update package.json
AleksandarDev
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.