mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
feat(prettier) TSInferType, TSIndexAccessType (#1390)
This commit is contained in:
parent
7ed067ec28
commit
ba57544b6e
1 changed files with 13 additions and 2 deletions
|
|
@ -653,13 +653,18 @@ impl<'a> Format<'a> for TSImportType<'a> {
|
|||
|
||||
impl<'a> Format<'a> for TSIndexedAccessType<'a> {
|
||||
fn format(&self, p: &mut Prettier<'a>) -> Doc<'a> {
|
||||
Doc::Line
|
||||
let mut parts = p.vec();
|
||||
parts.push(format!(p, self.object_type));
|
||||
parts.push(ss!("["));
|
||||
parts.push(format!(p, self.index_type));
|
||||
parts.push(ss!("]"));
|
||||
Doc::Array(parts)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Format<'a> for TSInferType<'a> {
|
||||
fn format(&self, p: &mut Prettier<'a>) -> Doc<'a> {
|
||||
Doc::Line
|
||||
array!(p, ss!("infer "), format!(p, self.type_parameter))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -780,6 +785,12 @@ impl<'a> Format<'a> for TSImportEqualsDeclaration<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> Format<'a> for TSTypeParameter<'a> {
|
||||
fn format(&self, p: &mut Prettier<'a>) -> Doc<'a> {
|
||||
Doc::Line
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Format<'a> for TSTypeParameterDeclaration<'a> {
|
||||
fn format(&self, p: &mut Prettier<'a>) -> Doc<'a> {
|
||||
Doc::Line
|
||||
|
|
|
|||
Loading…
Reference in a new issue