749 B
749 B
Add parentheses to AssignmentExpression in class property keys (#17145 by @fisker)
Previously we only add parentheses to AssignmentExpression in object keys, but not in class property keys. Thanks for Biome to bring our attention on this inconsistent.
// Input
a = {
[(x = "key")]: 1,
}
class A {
[(x = "property")] = 1;
[(x = "method")]() {}
}
// Prettier stable
a = {
[(x = "key")]: 1,
};
class A {
[x = "property"] = 1;
[(x = "method")]() {}
}
// Prettier main
a = {
[(x = "key")]: 1,
};
class A {
[(x = "property")] = 1;
[(x = "method")]() {}
}