TypeScript
- Files
.ts.mts.cts.tsx- Formats as
- Prettier
- Lints
- Every rule that reads its code
- In
ur.toml [format.typescript]
Formatted
cart.ts, as written// What a cart costs.
interface Item {name:string,price:number,quantity:number}
export function subtotal(items:Item[]):number{return items.reduce((sum,item)=>sum+item.price*item.quantity,0)}
ur format --style prettier cart.ts// What a cart costs.
interface Item {
name: string;
price: number;
quantity: number;
}
export function subtotal(items: Item[]): number {
return items.reduce((sum, item) => sum + item.price * item.quantity, 0);
}
Versions
Ur reads TypeScript as the profiles below name it. Name the versions a project targets in target; without it, Ur reads typescript-5.9.
| Profile | Dialect |
|---|---|
typescript-5.9 | TypeScript |
typescript-5.9-experimental-decorators | TypeScript |
typescript-5.9-jsx | TypeScript |
typescript-5.9-experimental-decorators-jsx | TypeScript |