diff --git a/crates/biome_js_analyze/src/lint/style/use_shorthand_array_type.rs b/crates/biome_js_analyze/src/lint/style/use_shorthand_array_type.rs index a6ffd95e7594..654aff2e3e81 100644 --- a/crates/biome_js_analyze/src/lint/style/use_shorthand_array_type.rs +++ b/crates/biome_js_analyze/src/lint/style/use_shorthand_array_type.rs @@ -5,7 +5,7 @@ use biome_console::markup; use biome_diagnostics::Applicability; use biome_js_factory::make; use biome_js_syntax::{ - AnyTsType, JsSyntaxKind, JsSyntaxToken, TriviaPieceKind, TsReferenceType, TsTypeArguments, T, + AnyTsType, JsSyntaxKind, JsSyntaxToken, TsReferenceType, TsTypeArguments, T, }; use biome_rowan::{AstNode, AstSeparatedList, BatchMutationExt, TriviaPiece}; @@ -236,11 +236,7 @@ fn convert_to_array_type( length => { let ts_union_type_builder = make::ts_union_type(make::ts_union_type_variant_list( types_array, - (0..length - 1).map(|_| { - make::token(T![|]) - .with_leading_trivia([(TriviaPieceKind::Whitespace, " ")]) - .with_trailing_trivia([(TriviaPieceKind::Whitespace, " ")]) - }), + (0..length - 1).map(|_| make::token_decorated_with_space(T![|])), )); return Some(AnyTsType::TsUnionType(ts_union_type_builder.build())); }