Requirement of allowSyntheticDefaultImports and esModuleInterop for Typescript usage should be documented
I got weird typing errors after adding react-lazy-images to my project and didn't understand them until I read #13. Using the workaround described there works for me. I think, however, it would make this project easier to use for anyone using TypeScript if this requirement were clearly documented in the project's README. Otherwise you have to have the insight to look into the closed GitHub issues here to find #13.
Hi, @karottenreibe!
That sounds frustrating, I imagine getting odd errors like that can be a bad first experience.
The issue of Typescript versioning and their various config options has been gnawing at me for a while.
My assumption has been that Typescript will type-check libraries with their own settings.
That would mean that this codebase using the esModuleInterop would not affect the consumer type-checking.
That seems to not be the case here though, and I would like to figure out why.
Would you be able to share some things about your Typescript + Project set up? I am particularly interested in:
- Your Typescript version
- The
tsconfig.json(I know this might have specific things;compilerOptionsand any reference tonode_modulesmight be a smaller subset) - Were the errors in an IDE, the CLI or both? Sometimes I find those differ :/
Either way, I think this is a good note to add to the docs! If it's confusing for folks, and a note helps get them unblocked, I'm all for it :)