From 658605088aeaeca5374e5e0af90e5899b3412d3b Mon Sep 17 00:00:00 2001 From: leaysgur <6259812+leaysgur@users.noreply.github.com> Date: Thu, 29 Oct 2026 07:51:18 +0000 Subject: [PATCH] docs(formatter_core): document tab width in text width policy (#28393) --- crates/oxc_formatter_core/FORMATTER_POLICY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/oxc_formatter_core/FORMATTER_POLICY.md b/crates/oxc_formatter_core/FORMATTER_POLICY.md index d9b1c28f2b..dc76a352e0 100644 --- a/crates/oxc_formatter_core/FORMATTER_POLICY.md +++ b/crates/oxc_formatter_core/FORMATTER_POLICY.md @@ -119,6 +119,7 @@ Printed text is measured by its display width (`TextWidth` / `text_width`, via ` - East Asian wide and fullwidth characters, and emoji presentation sequences count as 2 - Zero-width characters count as 0: nonspacing and enclosing marks (`Mn` / `Me`), and format characters (`U+200B..U+200F`, `U+FEFF`, ...) +- A tab counts as `tabWidth` wherever it sits, not up to the next tab stop (Prettier counts it as 0, prettier/prettier#20381) - Everything else counts as 1, ambiguous width included This holds for the printer's line width and for every heuristic comparing text with a column budget (`tabWidth`, a share of `printWidth`, a short object key, ...),