Open pedrodurek opened 3 years ago
As a workaround, adding both *
and an explicit index.d.ts
seems to work for resolving root and nested entry point types for compilation and VSCode resolution:
"typesVersions": {
">=4.1": {
"*": [
"src/ts4.1/*",
"src/ts4.1/index.d.ts"
]
}
},
Bug Report
If you have a project with embedded type definitions that are not in root path. i.e.:
src/index.d.ts
andsrc/ts4.1/index.d.ts
, TypeScript fails to resolve this module when using the following approach:It works, if we replace
*
toindex.d.ts
, like this:However, when we replace it with the actual file (
src/ts4.1/index.d.ts
), VS Code sometimes imports the module incorrectly, i.e.:Rather than:
Here you can find some context.
š» Code
https://github.com/i18next/react-i18next/blob/master/package.json#L7
š Actual behavior
It fails to compile, and fails to auto-import properly.
š Expected behavior
Resolve the module and import it properly.