0.1.0 • Published 8 years ago
eslint-plugin-fat-arrow-same-line v0.1.0
eslint-plugin-fat-arrow-same-line
Force fat-arrow functions body to start on the same line as the arrow
Installation
npm install --save-dev eslint-plugin-fat-arrow-same-lineUsage
In your .eslintrc:
{
"plugins": [
"fat-arrow-same-line"
]
}Rule
Good cases
[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>
);Bad cases
[1, 2, 3].map(i =>
i
);[1, 2, 3].map(i =>
(
<span>
{i}
</span>
)
);Credits
Original credit to @buildo for creating this plugin
0.1.0
8 years ago