fix(prettier): remove redundant newline and semicolons from the Program (#1284)

This commit is contained in:
Dunqing 2023-11-14 09:36:37 +08:00 committed by GitHub
parent 3942256af4
commit 0297cf7cc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -10,7 +10,7 @@ use oxc_allocator::{Box, Vec};
use oxc_ast::ast::*;
use oxc_syntax::operator::{BinaryOperator, UnaryOperator};
use crate::{array, doc::Doc, format, group, hardline, indent, softline, string, Prettier};
use crate::{array, doc::Doc, format, group, indent, softline, string, Prettier};
pub trait Format<'a> {
#[must_use]
@ -30,8 +30,6 @@ impl<'a> Format<'a> for Program<'a> {
fn format(&self, p: &mut Prettier<'a>) -> Doc<'a> {
let mut parts = p.vec();
parts.extend(self.body.iter().map(|stmt| stmt.format(p)));
parts.push(string!(p, ";"));
parts.push(hardline!());
Doc::Array(parts)
}
}

View file

@ -1,4 +1,4 @@
Compatibility: 1/173 (0.01%)
Compatibility: 0/173 (0.00%)
# Failed
@ -11,6 +11,7 @@ Compatibility: 1/173 (0.01%)
* arrows-bind
* assignment
* assignment-comments
* assignment-expression
* async
* async-do-expressions
* babel-plugins