Skip to content

Commit

Permalink
Add "types" to "exports"
Browse files Browse the repository at this point in the history
When trying to use `fast-check` with TypeScript where  `moduleResolution` is set to `Node12` or `NodeNext` we get the following error:

> Could not find a declaration file for module 'fast-check'. '/home/makeen/q2web/Dev/openapi-codegen/node_modules/fast-check/lib/esm/fast-check.js' implicitly has an 'any' type.

> Try `npm i --save-dev @types/fast-check` if it exists or add a new declaration (.d.ts) file containing `declare module 'fast-check';`ts(7016)

This change fixes the issue.

I think this might be related: microsoft/TypeScript#46334
  • Loading branch information
makeeno committed Mar 17, 2022
1 parent 675e539 commit 7010277
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"exports": {
".": {
"require": "./lib/fast-check.js",
"types": "./lib/types/fast-check.d.ts",
"default": "./lib/esm/fast-check.js"
}
},
Expand Down

0 comments on commit 7010277

Please sign in to comment.