Skip to content

Commit

Permalink
docs: Add prerequisite for typescript configuration (#539)
Browse files Browse the repository at this point in the history
  • Loading branch information
sprohaszka committed Feb 22, 2022
1 parent 92dc641 commit 03c3d11
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ const randomCard = faker.helpers.createCard(); // random contact card containing

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

In order to have faker working properly, you need to check if these `compilerOptions` are set correctly in your `tsconfig` file:

```json
{
"compilerOptions": {
"esModuleInterop": true,
"moduleResolution": "Node"
}
}
```

If you want for whatever reason the versions prior to `v6`,
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.

Expand Down

0 comments on commit 03c3d11

Please sign in to comment.