Skip to content

prefer-arrow-callback fix conflicting with prettier fix #65

Open
@ismail-syed

Description

@ismail-syed

Edit by @lydell: TL;DR We recommend turning off these rules for the time being:

{
  "rules": {
    "arrow-body-style": "off",
    "prefer-arrow-callback": "off"
  }
}

What version of eslint are you using?
v4.9.0

What version of prettier are you using?
v1.7.4

What version of eslint-plugin-prettier are you using?
v2.3.1

Please paste any applicable config files that you're using (e.g. .prettierrc or .eslintrc files)
https://github.com/ismail-syed/prettier-eslint-config-invalid-code

What source code are you linting?

function foo() {
  return isTrue && [0,1,2].map(function(num) {
    return num * 2;
  });
}

What did you expect to happen?
The code above should be formatted as per prettiers config and also should adhere to that prefer-arrow-callback fix

What actually happened?
Invalid code was generated, closing parenthesis is missing on the return statement.

function foo() {
  return (
    isTrue &&
    [0, 1, 2].map((num) => {
    return num * 2;
  });
}

Is the underlying issue from the prefer-arrow-callback fixer or the prettier plugin fixer?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions