A set of TS transformers to be applied using `ts-patch`.
npm install @voltiso/transform@voltiso/transformA set of TS transformers to be applied using ts-patch.
@voltiso/transform/inlineType-alias-inlining using either:
1. @inline _JSDoc_ - to inline the type alias everywhere it's used (in .d.ts
files)
2. @inline comment before usage of any alias to attempt inlining it (in
.d.ts files)
Config:
- onInlineError: 'fail' - causes compiler to crash if type-inlining fails
(usually symbols out of scope) - this applies only to the _JSDoc_ inlining
method (1.)
⚠️ Currently only checks if type names are in scope - but does not check if the
types are equal!
@voltiso/transform/stripStrip symbols such as asserts from production code.
Config:
- modules: string[] - comment-out import declarations with given prefixes
- symbols: string[] - comment-out instructions containing tokens (function
calls, etc.)
@voltiso/transform/compatRemoves numeric separators from the compiled code.
#### Pitfalls
- Please use the @typescript-eslint/explicit-module-boundary-types rule.
Otherwise the transformer might fail for some fringe cases. This is not a big
issue, as exporting types explicitly might speed up type-checking anyway.