0

I just started using Airbnb's eslint config - and it seems really good.

I am however getting the below error, and I'm unsure of what the fix is - I guess it's due to the function only existing to return a val.

I've played around with it - but I can't seem to make it 'correct'.

const getAccountInfo = ((e) => {
  return new Promise((resolve, reject) => {
   ...
  });
});

[eslint] Unexpected block statement surrounding arrow body (arrow-body-style)

Thanks

Ollie

Ollie
  • 1,104
  • 7
  • 24
  • 45

1 Answers1

1

The reason you are having this error is, that airbnb's eslint config prefers implicit return with arrow function, you can fix it like this:

const getAccountInfo = e => new Promise((resolve, reject) => ...)
Paulooze
  • 1,147
  • 10
  • 13
  • That's sorted it - thank you so much :) Not sure how I feel about it, but that's a whole other issue :) – Ollie Oct 28 '17 at 15:55