Skip to main content

format_typescript

Function format_typescript 

Source
pub fn format_typescript(input: &str) -> String
Expand description

Formats TypeScript (.ts, .mts, .cts) matching VS Code Prettier 3.7.4 (singleQuote: true, semi: true, tabWidth: 2).

§Arguments

  • &str - Raw TypeScript source text.

§Returns

  • String - Formatted TypeScript text, or unchanged input if syntax errors occur.