--- source: crates/rome_formatter_test/src/snapshot_builder.rs info: test_file: js/arrows/arrow_function_expression.js --- # Input ```js (a => {}).length typeof (() => {}); export default (() => {})(); (() => {})()``; (() => {})``; new (() => {}); if ((() => {}) ? 1 : 0) {} let f = () => ({}()) let a = () => ({} instanceof a); a = () => ({} && a); a = () => ({}() && a); a = () => ({} && a && b); a = () => ({} + a); a = () => ({}()() && a); a = () => ({}.b && a); a = () => ({}[b] && a); a = () => ({}`` && a); a = () => ({} = 0); a = () => ({}, a); a => a instanceof {}; a => ({}().b && 0) a => ({}().c = 0) x => ({}()()) x => ({}()``) x => ({}().b); a = b => c; x => (y = z); x => (y += z); f(a => ({})) + 1; (a => ({})) || 0; a = b => c; a = b => { return c }; ``` # Prettier differences ```diff --- Prettier +++ Rome @@ -6,24 +6,24 @@ new (() => {})(); if ((() => {}) ? 1 : 0) { } -let f = () => ({}()); -let a = () => ({} instanceof a); -a = () => ({} && a); -a = () => ({}() && a); -a = () => ({} && a && b); -a = () => ({} + a); -a = () => ({}()() && a); -a = () => ({}.b && a); -a = () => ({}[b] && a); -a = () => ({}`` && a); +let f = () => ({})(); +let a = () => ({}) instanceof a; +a = () => ({}) && a; +a = () => ({})() && a; +a = () => ({}) && a && b; +a = () => ({}) + a; +a = () => ({})()() && a; +a = () => ({}).b && a; +a = () => ({})[b] && a; +a = () => ({})`` && a; a = () => ({} = 0); -a = () => ({}, a); +a = () => (({}), a); (a) => a instanceof {}; -(a) => ({}().b && 0); -(a) => ({}().c = 0); -(x) => ({}()()); -(x) => ({}()``); -(x) => ({}().b); +(a) => ({})().b && 0; +(a) => (({})().c = 0); +(x) => ({})()(); +(x) => ({})()``; +(x) => ({})().b; a = (b) => c; (x) => (y = z); (x) => (y += z); ``` # Output ```js ((a) => {}).length; typeof (() => {}); export default (() => {})(); (() => {})()``; (() => {})``; new (() => {})(); if ((() => {}) ? 1 : 0) { } let f = () => ({})(); let a = () => ({}) instanceof a; a = () => ({}) && a; a = () => ({})() && a; a = () => ({}) && a && b; a = () => ({}) + a; a = () => ({})()() && a; a = () => ({}).b && a; a = () => ({})[b] && a; a = () => ({})`` && a; a = () => ({} = 0); a = () => (({}), a); (a) => a instanceof {}; (a) => ({})().b && 0; (a) => (({})().c = 0); (x) => ({})()(); (x) => ({})()``; (x) => ({})().b; a = (b) => c; (x) => (y = z); (x) => (y += z); f((a) => ({})) + 1; ((a) => ({})) || 0; a = (b) => c; a = (b) => { return c; }; ```