[ ] esModuleInterop should be true and allowSyntheticDefaultImports shouldn't be set. This property helps avoid issues when the generated code is going to be used by another tool like Babel that might require the code differently.
[ ] Look into https://github.com/RyanCavanaugh/tsbuild, it's still early in the development but will be useful for monorepo projects and will have its own configuration file
One thing that came up during the conversation is to have a rule that will check that your bundle is the smallest one. This could actually be a mix of several checks, like importHelpers and no-comments and maybe other ones.
@sonarwhal/core I'm opening this issue so we can start the discussion, see if there's anything we can do initially, etc.
@bterlson if you know of someone else that could be interested in this kind of rules for TS please add them to the conversation.
@bterlson
/cc @danielrosenwasser @bowdenk7 @ryancavanaugh may have some feedback
@danielrosenwasser
I'd say that if you're targeting Webpack or Rollup, you should be using module: esnext. This is the easiest win for users by far.
Use --isolatedModules to help ensure TypeScript can support single-file emit (which Babel is limited to).
To address some of the above:
esModuleInterop should be true and allowSyntheticDefaultImports shouldn't be set.
Actually it depends.
allowSyntheticDefaultImports should be used when targeting module: esnext, which is most ideal when handing output to Webpack.
esModuleInterop is really only useful for AMD or CommonJS.
decorators should be false
Maybe. It's sort of a tough call given existing code.
Originally reporte by @molant in https://github.com/webhintio/hint/issues/972
@molant
@bterlson
@danielrosenwasser