Could not find a declaration file for module '@meo-albu/lib'. code example
Example 1: could not find a declaration file for module in react project
npm install @types/module-name
Inside the project create a folder called @types and added it to
tsconfig.json for find all required types from it . So it looks somewhat
like this -
"typeRoots": [
"../node_modules/@types",
"../@types"
]
And inside @types folder create a file called alltypes.d.ts .To find the unknown
types from it . so for me these were the unknown types and I added it over there.
declare module 'react';
declate module 'react-dom' ;
So now the typescript didn't complain about the types not found anymore .
Example 2: Could not find a declaration file for module 'react'
yarn add eslint-import-resolver-typescript -D
"settings": {
"import/resolver": {
"typescript": {}
}
}