Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions crates/oxc_formatter/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,7 @@ impl FromStr for ArrowParentheses {

fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
// Prettier calls it `avoid`, but Biome calls it `AsNeeded`
"avoid" => Ok(Self::AsNeeded),
"as-needed" => Ok(Self::AsNeeded),
"always" => Ok(Self::Always),
_ => Err(
"Value not supported for Arrow parentheses. Supported values are 'as-needed' and 'always'.",
Expand Down
7 changes: 5 additions & 2 deletions tasks/prettier_conformance/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,11 @@ impl VisitMut<'_> for SpecParser {
}
"arrowParens" => {
// TODO: change `unwrap_or_default` to `unwrap`
options.arrow_parentheses =
ArrowParentheses::from_str(s).unwrap_or_default();
options.arrow_parentheses = ArrowParentheses::from_str(
// Prettier uses "avoid", but we use "as-needed"
if s == "avoid" { "as-needed" } else { s },
)
.unwrap_or_default();
}
"experimentalOperatorPosition" => {
// TODO: change `unwrap_or_default` to `unwrap`
Expand Down
Loading