ts-macros
ts-macros copied to clipboard
A typescript transformer / plugin that allows you to write macros for typescript!
The macro here seems to crash the playground site, and is not working on my project: https://googlefeud.github.io/ts-macros/playground?code=FAMwrgdgxgLglgewgAgCQjhAJgIQJ4CSWAPACoB8AFAJTIDewwyzaUATgKYCGMHAYpix9IsRBACEZKqlQw8ABw6kEAZRhtMAc0kUaAGhlwsHCDHGUA5BmwXkAahlzFytRojapNe8gv4iF6mpgAF9GcGh4JFZOHn5BYQixTycOADkuAFsOAC5kAGd1LT0AOlKITJzkAEE2Ni48YgK3TXJaBhZ7AG0vAF5yeiYWLjy8aGRw0SjyrORKTgBHXIAlDnmwDgK9ZE485Y35JDyOLYgOAA8YXKatNsGO5nU8AfuX+6hDhAAbDmLPhE1KIZjKZzCl0llqMVwkFXshgsgoDwoAALWYcWoINi3WEdAD0uNOF0o6LYmJhr1CHVCwQAuiFgFBPsM8sgAMLIrgQU6fZ4sAo8OBQcaQbLXdzIHo+XgFCz04DoQR+LCSdmc7lUILAfEAARgeQAtHBNBBMRxQIJVVyOJ8lZYAIwWLYWABMjp8AGYAkA I am trying to call the static method on a class, but using...
**Describe the bug** Does not work inside classes **Code to reproduce** ``` function $property() { property = 0 } $property!() export class ArduPilotSub extends Vehicle.Abstract { $property!() constructor() { super(Vehicle.Firmware.ArduPilot,...
**Describe the bug** When using postfix macros (in playground at least), they do not pass the type checker and get underlined with an error "Property does not exist on type"....
**Describe the bug** When adding `Save` around an argument type, return type changes for some reason. **Code to reproduce** ```typescript abstract class _Result { public value: T | E; }...
- If the transformation is not possible, `$$text` expands to `"null"`, not `undefined`. Corrected doc accordingly. --- - You should be able to write this: ```ts function $$textSafe(exp: unknown): string...
You have a screen capture of a live transformation in the readme, that could be perfectly vanilla javascript with: ```javascript console.log(["a", "b"].includes(searchItem)) ``` as someone knowing their languages, I usually...
**Describe the bug** Macro and the invoking need to be in separate file ```ts // def.ts export function $macro(a: number, b: number) { return a + b; } ``` ```ts...
Updated github actions to run lint and test on CI
Ast traversing is buggy. I fix some errors and mark with "todo" some suspicious places for which I didn't come up with test cases. All places with `return node;` and...