feat(prettier) print TS literals (#1380)

This commit is contained in:
Cameron 2023-11-17 13:23:27 +00:00 committed by GitHub
parent 7e9adeb222
commit 6d0e647c13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -587,7 +587,16 @@ impl<'a> Format<'a> for TSIntersectionType<'a> {
impl<'a> Format<'a> for TSLiteralType<'a> {
fn format(&self, p: &mut Prettier<'a>) -> Doc<'a> {
Doc::Line
match &self.literal {
TSLiteral::BooleanLiteral(v) => v.format(p),
TSLiteral::NullLiteral(v) => v.format(p),
TSLiteral::NumberLiteral(v) => v.format(p),
TSLiteral::BigintLiteral(v) => v.format(p),
TSLiteral::RegExpLiteral(v) => v.format(p),
TSLiteral::StringLiteral(v) => v.format(p),
TSLiteral::TemplateLiteral(v) => v.format(p),
TSLiteral::UnaryExpression(v) => v.format(p),
}
}
}