Skip to content

Commit ef8e218

Browse files
sprohaszkademipel8
authored andcommitted
docs: Add prerequisite for typescript configuration (faker-js#539)
1 parent 2d65086 commit ef8e218

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ const randomCard = faker.helpers.createCard(); // random contact card containing
7373

7474
Since version `v6+` there is native TypeScript support.
7575

76+
In order to have faker working properly, you need to check if these `compilerOptions` are set correctly in your `tsconfig` file:
77+
78+
```json
79+
{
80+
"compilerOptions": {
81+
"esModuleInterop": true,
82+
"moduleResolution": "Node"
83+
}
84+
}
85+
```
86+
7687
If you want for whatever reason the versions prior to `v6`,
7788
you can use `@types/faker` and rebind the declarations to the `@faker-js/faker` package with a `faker.d.ts` file in your e.g. src folder.
7889

0 commit comments

Comments
 (0)