From 5420bb55ecbf17d57f4f154e3a7014da4af4043f Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Fri, 21 Apr 2023 18:52:58 +0200 Subject: [PATCH] add more explanation to the types FAQ --- README.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f34e94..6dc3f85 100644 --- a/README.md +++ b/README.md @@ -17,4 +17,31 @@ For instance, if you have a yarn project, hoisting happens automatically. Howeve public-hoist-pattern[]=@types* ``` -Otherwise, installing `@types/testing-library__jest-dom` as a direct dependency should have the same effect and fix your issue. \ No newline at end of file +Otherwise, installing `@types/testing-library__jest-dom` as a direct dependency should have the same effect and fix your issue. + +If you are still experiencing issues after making these changes, it's very likely that your `tsconfig.json` file contains specific type overrides, which means that it will ignore automatic types, for instance: + +```json +{ + "compilerOptions": { + "types": [ + "node", + "mocha", + ] + } +} +``` + +In that case, make sure to add `testing-library__jest-dom` to the `types` array: + +```json +{ + "compilerOptions": { + "types": [ + "node", + "mocha", + "testing-library__jest-dom" + ] + } +} +``` \ No newline at end of file