From f49c4f567ee183f6d7b6fbfdfc15f3089944c4f0 Mon Sep 17 00:00:00 2001 From: Justinas Delinda <8914032+minht11@users.noreply.github.com> Date: Sun, 28 Apr 2024 23:58:14 +0300 Subject: [PATCH] use token_decorated_with_space --- .../src/lint/style/use_shorthand_array_type.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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())); }