I'm working with VSCode and Prettier and when we have chained functions call with arrow functions inside like a lodash chain:
let total = _(credits).filter(c => c.active).sumBy(c => c.fee);
Prettier breaks into:
discount = _(credits)
.filter(c => c.active)
.sumBy(c => c.fee);
When the we use strings
insteads arrow functions, it does not breaks into several lines, for instance:
let total = _(credits).filter('c => c.active').sumBy('c => c.fee');
I'm working with following .prettierrc
and "prettier": "^2.0.5"
:
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 280,
"tabWidth": 4,
"arrowParens": "avoid",
}
How can I avoid the line breaking with prettier when there is a arrow function inside the functions?