Skip to content

Commit 955e7f3

Browse files
committed
chore(release): 0.61.0
Upgrades swc.
1 parent f4afafe commit 955e7f3

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dprint-plugin-typescript"
3-
version = "0.60.0"
3+
version = "0.61.0"
44
authors = ["David Sherret <[email protected]>"]
55
edition = "2021"
66
homepage = "https://github.com/dprint/dprint-plugin-typescript"
@@ -26,7 +26,7 @@ tracing = ["dprint-core/tracing"]
2626

2727
[dependencies]
2828
anyhow = "1.0.51"
29-
deno_ast = { version = "0.7.0", features = ["view"] }
29+
deno_ast = { version = "0.8.0", features = ["view"] }
3030
dprint-core = { version = "0.49.0", features = ["formatting"] }
3131
rustc-hash = "1.1.0"
3232
serde = { version = "1.0.118", features = ["derive"] }
@@ -37,5 +37,5 @@ parking_lot_core = "=0.8.0" # https://github.com/Amanieu/parking_lot/issues/269
3737

3838
[dev-dependencies]
3939
debug-here = "0.2"
40-
dprint-development = "0.5.0"
40+
dprint-development = "0.6.0"
4141
serde_json = { version = "1.0" }

src/generation/parser.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ fn gen_class_prop<'a>(node: &'a ClassProp, context: &mut Context<'a>) -> PrintIt
474474
type_ann: &node.type_ann,
475475
is_static: node.is_static(),
476476
decorators: &node.decorators,
477-
computed: node.computed(),
477+
computed: node.key.kind() == NodeKind::ComputedPropName,
478478
is_declare: node.declare(),
479479
accessibility: node.accessibility(),
480480
is_abstract: node.is_abstract(),
@@ -599,11 +599,16 @@ fn gen_class_prop_common<'a>(node: GenClassPropCommon<'a>, context: &mut Context
599599
if node.readonly {
600600
items.push_str("readonly ");
601601
}
602-
let key_span = node.key.span();
603602
items.extend(if node.computed {
603+
let inner_key_node = match node.key {
604+
Node::ComputedPropName(prop) => prop.expr.as_node(),
605+
_ => node.key,
606+
};
604607
gen_computed_prop_like(
605-
|context| gen_node(node.key, context),
606-
GenComputedPropLikeOptions { inner_node_span: key_span },
608+
|context| gen_node(inner_key_node, context),
609+
GenComputedPropLikeOptions {
610+
inner_node_span: inner_key_node.span(),
611+
},
607612
context,
608613
)
609614
} else {

0 commit comments

Comments
 (0)