eslint-plugin-fat-arrow-same-line
v0.1.0
Published
Enforce same line arrow functions with implicit returns
Downloads
8
Readme
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-line
Usage
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