0.1.0 • Published 7 years ago

eslint-plugin-fat-arrow-same-line v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

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