Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

customOptions is not typed, so TypeScript is giving errors #97

Closed
2 tasks done
dietergeerts opened this issue Nov 29, 2021 · 2 comments · Fixed by #102
Closed
2 tasks done

customOptions is not typed, so TypeScript is giving errors #97

dietergeerts opened this issue Nov 29, 2021 · 2 comments · Fixed by #102

Comments

@dietergeerts
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

N/A

Plugin version

"env-schema": "^3.5",

Node.js version

14

Operating system

Windows

Operating system version (i.e. 20.04, 11.3, 10)

N/A

Description

Following error when using customOptions:

TS2322: Type '{ customOptions(ajvInstance: any): any; }' is not assignable to type 'Ajv'.   Object literal may only specify known properties, and 'customOptions' does not exist in type 'Ajv'

Because it's not in the types.

Steps to Reproduce

Just use customOptions in a TS file

Expected Behavior

Typings know about this extra feature, so there are no TS errors

@Eomm
Copy link
Member

Eomm commented Nov 29, 2021

Would you like to send a Pull Request to address this issue? Remember to add unit tests.

@dietergeerts
Copy link
Author

@Eomm , I can take a look yes, but I never have written unit tests that specifically are testing types, but I assume I will find some in here to compare how to do that.

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 a pull request may close this issue.

2 participants