--- source: crates/rome_formatter_test/src/snapshot_builder.rs info: test_file: js/destructuring/destructuring.js --- # Input ```js const [one, two = null, three = null] = arr; a = ([s=1,]) => 1 const { children, ...props } = this.props const { user: { firstName, lastName } } = this.props; const { name: { first, last }, organisation: { address: { street: orgStreetAddress, postcode: orgPostcode } } } = user; function f({ data: { name } }) {} const UserComponent = function({ name: { first, last }, organisation: { address: { street: orgStreetAddress, postcode: orgPostcode } }, }) { return }; const { a, b, c, d: { e } } = someObject; try { // code } catch ({ data: { message }}) { // code } try { // code } catch ({ data: { message: { errors }}}) { // code } const obj = { func(id, { blog: { title } }) { return id + title; }, }; class A { func(id, { blog: { title } }) { return id + title; } } ``` # Prettier differences ```diff --- Prettier +++ Rome @@ -39,11 +39,7 @@ try { // code -} catch ({ - data: { - message: { errors }, - }, -}) { +} catch ({ data: { message: { errors } } }) { // code } ``` # Output ```js const [one, two = null, three = null] = arr; a = ([s = 1]) => 1; const { children, ...props } = this.props; const { user: { firstName, lastName }, } = this.props; const { name: { first, last }, organisation: { address: { street: orgStreetAddress, postcode: orgPostcode }, }, } = user; function f({ data: { name } }) {} const UserComponent = function ({ name: { first, last }, organisation: { address: { street: orgStreetAddress, postcode: orgPostcode }, }, }) { return; }; const { a, b, c, d: { e }, } = someObject; try { // code } catch ({ data: { message } }) { // code } try { // code } catch ({ data: { message: { errors } } }) { // code } const obj = { func(id, { blog: { title } }) { return id + title; }, }; class A { func(id, { blog: { title } }) { return id + title; } } ```