I need confirmation on the following theory. According to TS docs, there are two options that can be set in tsconfig.json.
--allowSynth
Well, my understanding is that the allowSyntheticDefaultImports
is for being able to load CommonJS libraries in a simpler way if you target es6+ (in dev time) while esModuleInterop
is for simplifying these imports (in runtime) if you target for example AMD (like I do).
According to the docs you shouldn't need to specify allowSyntheticDefaultImports
explicitly if you have esModuleInterop
enabled, but the reason I had to enable also the allowSyntheticDefaultImports
is that Resharper seems to look at that that flag when doing syntax checking in Visual Studio. Sure it built and worked ok anyway with only esModuleInterop
, but I got a lot of red warnings from Resharper until I enabled also the other flag.