I have this function:
// before and after prettier
const foo = (a: number) => (b: number) => {
return a + b
}
If I run prettier it will leave everything as is (which is desired behaviour for me).
When I add type of returned function though it breaks a like for some reason.
// before prettier
type NestedFuncType = (b: number) => number
const foo = (a: number): NestedFuncType => b => {
return a + b
}
// after prettier
type NestedFuncType = (b: number) => number
const foo =
(a: number): NestedFuncType =>
(b) => {
return a + b
}
Is there anything I can do to prevent line breaks? My .prettierc:
{
"printWidth": 120,
"semi": false,
"singleQuote": true,
"trailingComma": "es5"
}
Thanks.