Skip to content

Commit

Permalink
fix(js_formatter): don't insert trailing comma on type import statement
Browse files Browse the repository at this point in the history
  • Loading branch information
fireairforce committed Nov 6, 2024
1 parent 7627ab0 commit c971ac7
Show file tree
Hide file tree
Showing 24 changed files with 1,762 additions and 400 deletions.
82 changes: 80 additions & 2 deletions crates/biome_js_factory/src/generated/node_factory.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

129 changes: 128 additions & 1 deletion crates/biome_js_factory/src/generated/syntax_factory.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

114 changes: 114 additions & 0 deletions crates/biome_js_formatter/src/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7809,6 +7809,120 @@ impl IntoFormat<JsFormatContext> for biome_js_syntax::TsImportType {
)
}
}
impl FormatRule<biome_js_syntax::TsImportTypeArguments>
for crate::ts::expressions::import_type_arguments::FormatTsImportTypeArguments
{
type Context = JsFormatContext;
#[inline(always)]
fn fmt(
&self,
node: &biome_js_syntax::TsImportTypeArguments,
f: &mut JsFormatter,
) -> FormatResult<()> {
FormatNodeRule::<biome_js_syntax::TsImportTypeArguments>::fmt(self, node, f)
}
}
impl AsFormat<JsFormatContext> for biome_js_syntax::TsImportTypeArguments {
type Format<'a> = FormatRefWithRule<
'a,
biome_js_syntax::TsImportTypeArguments,
crate::ts::expressions::import_type_arguments::FormatTsImportTypeArguments,
>;
fn format(&self) -> Self::Format<'_> {
#![allow(clippy::default_constructed_unit_structs)]
FormatRefWithRule::new(
self,
crate::ts::expressions::import_type_arguments::FormatTsImportTypeArguments::default(),
)
}
}
impl IntoFormat<JsFormatContext> for biome_js_syntax::TsImportTypeArguments {
type Format = FormatOwnedWithRule<
biome_js_syntax::TsImportTypeArguments,
crate::ts::expressions::import_type_arguments::FormatTsImportTypeArguments,
>;
fn into_format(self) -> Self::Format {
#![allow(clippy::default_constructed_unit_structs)]
FormatOwnedWithRule::new(
self,
crate::ts::expressions::import_type_arguments::FormatTsImportTypeArguments::default(),
)
}
}
impl FormatRule<biome_js_syntax::TsImportTypeAssertion>
for crate::ts::module::import_type_assertion::FormatTsImportTypeAssertion
{
type Context = JsFormatContext;
#[inline(always)]
fn fmt(
&self,
node: &biome_js_syntax::TsImportTypeAssertion,
f: &mut JsFormatter,
) -> FormatResult<()> {
FormatNodeRule::<biome_js_syntax::TsImportTypeAssertion>::fmt(self, node, f)
}
}
impl AsFormat<JsFormatContext> for biome_js_syntax::TsImportTypeAssertion {
type Format<'a> = FormatRefWithRule<
'a,
biome_js_syntax::TsImportTypeAssertion,
crate::ts::module::import_type_assertion::FormatTsImportTypeAssertion,
>;
fn format(&self) -> Self::Format<'_> {
#![allow(clippy::default_constructed_unit_structs)]
FormatRefWithRule::new(
self,
crate::ts::module::import_type_assertion::FormatTsImportTypeAssertion::default(),
)
}
}
impl IntoFormat<JsFormatContext> for biome_js_syntax::TsImportTypeAssertion {
type Format = FormatOwnedWithRule<
biome_js_syntax::TsImportTypeAssertion,
crate::ts::module::import_type_assertion::FormatTsImportTypeAssertion,
>;
fn into_format(self) -> Self::Format {
#![allow(clippy::default_constructed_unit_structs)]
FormatOwnedWithRule::new(
self,
crate::ts::module::import_type_assertion::FormatTsImportTypeAssertion::default(),
)
}
}
impl FormatRule<biome_js_syntax::TsImportTypeAssertionBlock>
for crate::ts::module::import_type_assertion_block::FormatTsImportTypeAssertionBlock
{
type Context = JsFormatContext;
#[inline(always)]
fn fmt(
&self,
node: &biome_js_syntax::TsImportTypeAssertionBlock,
f: &mut JsFormatter,
) -> FormatResult<()> {
FormatNodeRule::<biome_js_syntax::TsImportTypeAssertionBlock>::fmt(self, node, f)
}
}
impl AsFormat<JsFormatContext> for biome_js_syntax::TsImportTypeAssertionBlock {
type Format<'a> = FormatRefWithRule<
'a,
biome_js_syntax::TsImportTypeAssertionBlock,
crate::ts::module::import_type_assertion_block::FormatTsImportTypeAssertionBlock,
>;
fn format(&self) -> Self::Format<'_> {
#![allow(clippy::default_constructed_unit_structs)]
FormatRefWithRule :: new (self , crate :: ts :: module :: import_type_assertion_block :: FormatTsImportTypeAssertionBlock :: default ())
}
}
impl IntoFormat<JsFormatContext> for biome_js_syntax::TsImportTypeAssertionBlock {
type Format = FormatOwnedWithRule<
biome_js_syntax::TsImportTypeAssertionBlock,
crate::ts::module::import_type_assertion_block::FormatTsImportTypeAssertionBlock,
>;
fn into_format(self) -> Self::Format {
#![allow(clippy::default_constructed_unit_structs)]
FormatOwnedWithRule :: new (self , crate :: ts :: module :: import_type_assertion_block :: FormatTsImportTypeAssertionBlock :: default ())
}
}
impl FormatRule<biome_js_syntax::TsImportTypeQualifier>
for crate::ts::module::import_type_qualifier::FormatTsImportTypeQualifier
{
Expand Down
Loading

0 comments on commit c971ac7

Please sign in to comment.