TypeScriptbeginnerwebAI generated

Type-Safe Form Validation Library

Build a small, reusable form-validation library with a fluent API for chaining rules like required, minLength, and custom validators, fully typed with generics so validation errors are inferred per field. Learners practice advanced TypeScript generics, conditional types, and API design for libraries.

Estimate
~10h
Steps
6
Completed by
0
Proposed by
codeseed.app

Vitest · tsup

Project roadmap

  1. 01

    Design the fluent API surface

    ~1.5h

    Sketch the chainable validator API, e.g. field('name').required().minLength(3).

  2. 02

    Implement core validators

    ~2h

    Implement required, minLength, maxLength, and pattern validators.

  3. 03

    Add generic type inference for errors

    ~2.5h

    Use TypeScript generics so validation error shapes are inferred per field type.

  4. 04

    Support custom validators

    ~1.5h

    Allow consumers to plug in their own validation functions with full type safety.

  5. 05

    Write unit tests

    ~1.5h

    Cover common rules and edge cases with Vitest.

  6. 06

    Configure the build

    ~1h

    Set up tsup to produce a publishable library bundle with type declarations.

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~10h · 6 steps

Tech stack

Vitesttsup