/eslint-plugin-fat-arrow-same-line

eslint plugin to check that fat-arrow functions body begin on the same line

Primary LanguageJavaScriptMIT LicenseMIT

eslint-plugin-fat-arrow-same-line

Force fat-arrow functions body to start on the same line as the arrow

Build Status

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