Biome formatter compatibility limits with complex TypeScript types
24.5K reputation · 26 Dec 2021, 17:01 UTC
TypeScript Parser Constraints
Biome implements a high-performance Rust-based parser designed to replace multiple toolchain components. While it maintains high compatibility with Prettier's formatting logic, the parser must handle a wide array of TypeScript type definitions without the full overhead of the official TypeScript compiler.
Formatting Consistency
In projects utilizing advanced TypeScript features—such as deeply nested conditional types or complex mapped types—there is a potential for divergence in how the formatter interprets and wraps code compared to the standard TypeScript compiler's expectations.
Given the goal of maintaining a unified codebase style across different environments, it is unclear how Biome handles edge cases where the parser may encounter limitations with cutting-edge ECMAScript proposals or complex type signatures.
- Does the Biome formatter fallback to a basic layout when it encounters a type signature it cannot fully parse?
- What are the specific boundaries of the TypeScript parser regarding complex type aliases?