wikibase-sdk icon indicating copy to clipboard operation
wikibase-sdk copied to clipboard

Improve tsconfig

Open EdJoPaTo opened this issue 1 year ago • 0 comments

Enable verbatimModuleSyntax and erasableSyntaxOnly

TLDR:

  • verbatimModuleSyntax removes type only imports from the output resulting in less superfluous imports at runtime.
  • erasableSyntaxOnly ensures that no TypeScript specific syntax is used and only JavaScript compatible syntax with types is used. This ensures that simple type stripping works which allows Node.js 23.6 to run the typescript files directly. So in the future tsx can be replaced by native node calls. While this is a stricter check than before, the code is already compatible so no need for a code change. It mainly prevents future code from using TypeScript only syntax so it stays compatible with type stripping.

EdJoPaTo avatar Apr 01 '25 08:04 EdJoPaTo