Skip to content

Typescript Definitions Not Working Properly (Tested on TS 5.9.3) #4

@lbineau

Description

@lbineau

Hi! First of all, thank you for this library — it’s looks very helpful and lightweight, and I appreciate the work that has gone into it 🙏
I usually don't do the "hey, it doesn't with TS" guy, since it is stated in the library 📝 Type Safe - Full TypeScript support with comprehensive type definitions, I'd expect the code samples to work with it out of the box.

While trying it with a fresh Vite install with TypeScript 5.9.3, I encountered several issues with the .d.ts definitions that prevent correct type checking. Below are a few examples when I'm using the demo example:

Sample code found on markdown

1. Property 'success' does not exist on type 'Object'.

// Error:
// Property 'success' does not exist on type 'Object'.ts-plugin(2339)

2. Incorrect method signature for RuleHelpers.gte()

// Error:
// Expected at least 3 arguments, but got 2.ts-plugin(2555)
// RuleHelpers.d.ts(47, 32): An argument for 'options' was not provided.

3. rules.validation possibly undefined

// Error:
// 'rules.validation' is possibly 'undefined'.ts-plugin(18048)

Summary

The TypeScript definitions may need updates to reflect the actual structure and usage patterns of the library.
Thanks again for maintaining this project!

Best regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions