Skip to content

Commit

Permalink
docs: Add prerequisite for typescript configuration (faker-js#539)
Browse files Browse the repository at this point in the history
  • Loading branch information
sprohaszka authored and demipel8 committed Mar 11, 2022
1 parent 2d65086 commit ef8e218
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 ef8e218

Please sign in to comment.