Skip to content

Conflicting rules 'no-confusing-arrow' and 'arrow-body-style' #752

@robbinjanssen

Description

@robbinjanssen

Currently I'm using eslint with the airbnb config to lint my project. However since the last update (6.0.1) i've found somewhat conflicting rules, the 'no-confusing-arrow' rule and the 'arrow-body-style' rule.

Take this piece of code:

export const conflict = (a) => a > 1 ? 'yes' : 'no';

This triggers the no-confusing-arrow rule.

According to the rule it should be written as following:

export const conflict = (a) => {
  return a > 1 ? 'yes' : 'no';
};

However this triggers the arrow-body-style rule.

Any idea how to solve this while keeping the shorthand if?

Versions used:

"eslint": "^2.2.0",
"eslint-config-airbnb": "^6.0.1",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions