@voltiso/transform
v4.2.1
Published
A set of TS transformers to be applied using `ts-patch`.
Readme
@voltiso/transform
A set of TS transformers to be applied using ts-patch.
@voltiso/transform/inline
Type-alias-inlining using either:
@inlineJSDoc - to inline the type alias everywhere it's used (in.d.tsfiles)@inlinecomment before usage of any alias to attempt inlining it (in.d.tsfiles)
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/strip
Strip symbols such as asserts from production code.
Config:
modules: string[]- comment-out import declarations with given prefixessymbols: string[]- comment-out instructions containingtokens(function calls, etc.)
@voltiso/transform/compat
Numeric separators
Removes numeric separators from the compiled code.
Import extensions
Pitfalls
- Please use the
@typescript-eslint/explicit-module-boundary-typesrule. 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.
