--- source: crates/rome_formatter_test/src/snapshot_builder.rs info: test_file: js/objects/expression.js --- # Input ```js () => ({}``); ({})``; a = () => ({}).x; ({} && a, b); ({}::b, 0); ({}::b()``[''].c++ && 0 ? 0 : 0, 0); ({}(), 0); ({} = 0); (({} = 0), 1); const a1 = { someKey: (shortName, shortName) }; const a2 = { someKey: (longLongLongLongLongLongLongLongLongLongLongLongLongLongName, shortName) }; const a3 = { someKey: (longLongLongLongLongLongLongLongLongLongLongLongLongLongName, longLongLongLongLongLongLongLongLongLongLongLongLongLongName, longLongLongLongLongLongLongLongLongLongLongLongLongLongName) }; ``` # Prettier differences ```diff --- Prettier +++ Rome @@ -1,10 +1,12 @@ -() => ({}``); -({}``); -a = () => ({}.x); -({} && a, b); -({}::b, 0); -({}::b()``[""].c++ && 0 ? 0 : 0, 0); -({}(), 0); +() => ({})``; +({})``; +a = () => ({}).x; +({}) && a, b; +({} +::b, 0) +({} +::b()``[''].c++ && 0 ? 0 : 0, 0) +({})(), 0; ({} = 0); ({} = 0), 1; ``` # Output ```js () => ({})``; ({})``; a = () => ({}).x; ({}) && a, b; ({} ::b, 0) ({} ::b()``[''].c++ && 0 ? 0 : 0, 0) ({})(), 0; ({} = 0); ({} = 0), 1; const a1 = { someKey: (shortName, shortName), }; const a2 = { someKey: (longLongLongLongLongLongLongLongLongLongLongLongLongLongName, shortName), }; const a3 = { someKey: (longLongLongLongLongLongLongLongLongLongLongLongLongLongName, longLongLongLongLongLongLongLongLongLongLongLongLongLongName, longLongLongLongLongLongLongLongLongLongLongLongLongLongName), }; ``` # Errors ``` expression.js:5:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `)` but instead found `:` 3 │ a = () => ({}).x; 4 │ ({} && a, b); > 5 │ ({}::b, 0); │ ^ 6 │ ({}::b()``[''].c++ && 0 ? 0 : 0, 0); 7 │ ({}(), 0); i Remove : expression.js:6:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `)` but instead found `:` 4 │ ({} && a, b); 5 │ ({}::b, 0); > 6 │ ({}::b()``[''].c++ && 0 ? 0 : 0, 0); │ ^ 7 │ ({}(), 0); 8 │ ({} = 0); i Remove : ```