Skip to content

Commit

Permalink
feat: ts constructor type
Browse files Browse the repository at this point in the history
  • Loading branch information
LIMPIX31 committed Mar 19, 2024
1 parent 8755ddc commit 5396cb7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 8 additions & 1 deletion crates/oxc_prettier/src/format/mod.rs
Expand Up @@ -784,7 +784,14 @@ impl<'a> Format<'a> for TSConditionalType<'a> {

impl<'a> Format<'a> for TSConstructorType<'a> {
fn format(&self, p: &mut Prettier<'a>) -> Doc<'a> {
line!()
let mut parts = p.vec();
if self.r#abstract {
parts.push(ss!("abstract "));
}
parts.push(ss!("new "));
parts.push(self.params.format(p));
parts.push(array![p, ss!(" => "), self.return_type.type_annotation.format(p)]);
Doc::Array(parts)
}
}

Expand Down
8 changes: 1 addition & 7 deletions tasks/prettier_conformance/prettier.ts.snap.md
@@ -1,10 +1,7 @@
ts compatibility: 39/527 (7.40%)
ts compatibility: 41/527 (7.78%)

# Failed

### abstract-construct-types
* abstract-construct-types/abstract-construct-types.ts

### abstract-property
* abstract-property/semicolon.ts

Expand Down Expand Up @@ -249,9 +246,6 @@ ts compatibility: 39/527 (7.40%)
### conformance/types/constKeyword
* conformance/types/constKeyword/constKeyword.ts

### conformance/types/constructorType
* conformance/types/constructorType/cunstructorType.ts

### conformance/types/enumDeclaration
* conformance/types/enumDeclaration/enumDeclaration.ts

Expand Down

0 comments on commit 5396cb7

Please sign in to comment.