Force fat-arrow functions body to start on the same line as the arrow
npm install --save-dev eslint-plugin-fat-arrow-same-line
In your .eslintrc
:
{
"plugins": [
"fat-arrow-same-line"
]
}
[1, 2, 3].map(i => i);
[1, 2, 3].map(i => {
return i;
});
[1, 2, 3].map(i => `
${i}
`);
[1, 2, 3].map(i => (
<span>
${i}
</span>
);
[1, 2, 3].map(i =>
i
);
[1, 2, 3].map(i =>
(
<span>
{i}
</span>
)
);
Original credit to @buildo for creating this plugin