Closed tombell closed 5 years ago
@tombell, seems like you found a solution. Would you mind if I leave it here? This issue is easily googled by "nano-css typescript" so having solution right here can save someone's time.
Adding path mappings in tsconfig.json
helps:
"baseUrl": ".",
"paths": {
"nano-css/*": ["./node_modules/nano-css/"]
}
Please read @tombell's post for detailed example: https://tomb.io/post/typescript-and-preact/#typescript
@44px I don't mind, I wrote the post in case others encountered similar issues, it's worth noting that some of the add-ons in nano-css
don't have type definitions currently.
Seems like some types are missing 😢 This issue should be opened till it is fixed.
I'm trying to use
nano-css
with a new preact project using TypeScript and it's not finding/working with the type definitions in the package.tsconfig.json
:src/nano.ts
:The error I am getting is:
I can disable the error by turning off
noImplicitAny
, but I would rather not disable that for my actual project.