1// Solution: All you have to do is edit your TypeScript Config file
2// (tsconfig.json) and add a new key value pair as
3"noImplicitAny": false
1//First try ( works for most of the cases)
2npm install @types/module-name
3
4//if that does not solve your problem than . (will surely solve your problem)
5
6Inside the project create a folder called @types and added it to
7tsconfig.json for find all required types from it . So it looks somewhat
8like this -
9
10 "typeRoots": [
11 "../node_modules/@types",
12 "../@types"
13 ]
14
15And inside @types folder create a file called alltypes.d.ts .To find the unknown
16types from it . so for me these were the unknown types and I added it over there.
17
18declare module 'react';
19declate module 'react-dom' ;
20
21So now the typescript didn't complain about the types not found anymore .
1yarn add eslint-import-resolver-typescript -D
2
3// Add in .eslintrc
4"settings": {
5 "import/resolver": {
6 "typescript": {}
7 }
8 }
1When a module is not yours - try to install types from @types:
2
3npm install -D @types/module-name