A constructor declares a field in its parameters
The message
MARKLESS_TYPE_STRIP_PARAMETER_PROPERTY: The constructor of <className> declares the field "<parameterName>" in its parameter list (`<source>`). Markless turns .tsrx code into JavaScript only by removing types, and this form cannot be produced that way: its JavaScript equivalent is a field in the class body plus an assignment in the constructor, which removing types does not write.
A TypeScript parameter property both declares a field and assigns it. With only the types removed it would be an ordinary parameter and the field would be gone, so the type remover refuses it.
Declare the field in the class body and assign it in the constructor: `<parameterName>: Type;` and `constructor(<parameterName>: Type) { this.<parameterName> = <parameterName>; }`.
https://markless.dev/errors/MARKLESS_TYPE_STRIP_PARAMETER_PROPERTYWords in angle brackets change from case to case.
Why
Markless turns .tsrx code into JavaScript only by removing types. A TypeScript parameter property declares a field and assigns it; with only the types removed it would be an ordinary parameter and the field would be gone.
Fix
Declare the field in the class body and assign it in the constructor.
class Item { sku: string; constructor(sku: string) { this.sku = sku; }}Related
Where Markless raises it
Button sounds are from Josh Comeau's Button Sounds library.