I know I posted this in general when you asked, but to just add context to this support post.
I believe composer format, uses pint, which is a PHP only formatter. So I believe your issue here is that you're trying to use the PHP formatter for the a TS file. Instead use prettier.