eslint-plugin-fat-arrow-same-line

0.1.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i eslint-plugin-fat-arrow-same-line

Weekly Downloads

3

Version

0.1.0

License

MIT

Last publish

Collaborators

  • pzuraq