--- source: crates/biome_formatter_test/src/snapshot_builder.rs info: js/module/arrow/currying.js --- # Input ```js const fn = b => c => d => { return 3; }; const foo = (a, b) => c => d => { return 3; }; const bar = a => b => c => a + b + c const mw = store => next => action => { return next(action) } const middleware = options => (req, res, next) => { // ... }; // Ensure tail bodies only indent a single level when necessary somePromise.then(({default: ComponentName}) => (props) => [longerSingleElement]); somePromise.then((reallyLongArguments) => (makeTheChainFullyBreak) => (moreThanItWould) => [longerSingleElement]); somePromise.then(({ reallyLongArguments }) => (makeTheChainFullyBreak) => [ dontIndentTwice, ]); somePromise.then(({ reallyLongArguments }) => (makeTheChainFullyBreak) => { dontIndentTwice(); }); somePromise.then(({ reallyLongArguments }) => (makeTheChainFullyBreak) => (andNowAllLines) => (keepGoing) => dontIndentTwice()); somePromise.then( ({ reallyLongArguments }) => (makeTheChainFullyBreak) => () => { dontIndentTwice(); }, ); function foo() { // Unmount clean up React.useLayoutEffect(() => () => { callSomeLongNamedFunction(); }); } function foo() { // Unmount clean up React.useLayoutEffect(() => () => [hello, what, is, this, going, too, doehwharht]); } ``` ============================= # Outputs ## Output 1 ----- Indent style: Tab Indent width: 2 Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes Quote properties: As needed Trailing comma: All Semicolons: Always Arrow parentheses: Always Bracket spacing: true Bracket same line: false Attribute Position: Auto ----- ```js const fn = (b) => (c) => (d) => { return 3; }; const foo = (a, b) => (c) => (d) => { return 3; }; const bar = (a) => (b) => (c) => a + b + c; const mw = (store) => (next) => (action) => { return next(action); }; const middleware = (options) => (req, res, next) => { // ... }; // Ensure tail bodies only indent a single level when necessary somePromise.then(({ default: ComponentName }) => (props) => [ longerSingleElement, ]); somePromise.then( (reallyLongArguments) => (makeTheChainFullyBreak) => (moreThanItWould) => [ longerSingleElement, ], ); somePromise.then(({ reallyLongArguments }) => (makeTheChainFullyBreak) => [ dontIndentTwice, ]); somePromise.then(({ reallyLongArguments }) => (makeTheChainFullyBreak) => { dontIndentTwice(); }); somePromise.then( ({ reallyLongArguments }) => (makeTheChainFullyBreak) => (andNowAllLines) => (keepGoing) => dontIndentTwice(), ); somePromise.then( ({ reallyLongArguments }) => (makeTheChainFullyBreak) => () => { dontIndentTwice(); }, ); function foo() { // Unmount clean up React.useLayoutEffect(() => () => { callSomeLongNamedFunction(); }); } function foo() { // Unmount clean up React.useLayoutEffect(() => () => [ hello, what, is, this, going, too, doehwharht, ]); } ``` ## Output 2 ----- Indent style: Tab Indent width: 2 Line ending: LF Line width: 80 Quote style: Double Quotes JSX quote style: Double Quotes Quote properties: As needed Trailing comma: All Semicolons: Always Arrow parentheses: As needed Bracket spacing: true Bracket same line: false Attribute Position: Auto ----- ```js const fn = b => c => d => { return 3; }; const foo = (a, b) => c => d => { return 3; }; const bar = a => b => c => a + b + c; const mw = store => next => action => { return next(action); }; const middleware = options => (req, res, next) => { // ... }; // Ensure tail bodies only indent a single level when necessary somePromise.then(({ default: ComponentName }) => props => [ longerSingleElement, ]); somePromise.then( reallyLongArguments => makeTheChainFullyBreak => moreThanItWould => [ longerSingleElement, ], ); somePromise.then(({ reallyLongArguments }) => makeTheChainFullyBreak => [ dontIndentTwice, ]); somePromise.then(({ reallyLongArguments }) => makeTheChainFullyBreak => { dontIndentTwice(); }); somePromise.then( ({ reallyLongArguments }) => makeTheChainFullyBreak => andNowAllLines => keepGoing => dontIndentTwice(), ); somePromise.then(({ reallyLongArguments }) => makeTheChainFullyBreak => () => { dontIndentTwice(); }); function foo() { // Unmount clean up React.useLayoutEffect(() => () => { callSomeLongNamedFunction(); }); } function foo() { // Unmount clean up React.useLayoutEffect(() => () => [ hello, what, is, this, going, too, doehwharht, ]); } ```