Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions crates/oxc_formatter/src/detect_code_removal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,12 @@ impl StatsCollector {
}

let count_key = match kind {
// `TemplateLiteral` content may change when formatted as embedded template (html, css, etc.).
// The number of quasis is already tracked via `TemplateElement` nodes,
// so we only need to count `TemplateLiteral` instances without content.
AstKind::TemplateLiteral(t) => {
format!("TEMPLATE_LITERAL({},{})", t.quasis.len(), t.expressions.len())
}
// `JSXText` may contain redundant whitespaces.
// e.g. `<p>World </p>` -> `<p>World </p>`
// Redundant whitespaces can be truncated even if they are inside.
Expand Down
Loading