TristonJ / eslint-plugin-prefer-arrow

ESLint plugin to prefer arrow functions
MIT License
54 stars 10 forks source link

autofix async function broken #12

Closed omegalink12 closed 5 years ago

omegalink12 commented 5 years ago

Trying to autofix an async function doesn't pick up the async modifier.

async function x(){
  return 1
}

gets autofixed to

async const x = ()=> 1;
TristonJ commented 5 years ago

Thank you for the report! This has been fixed in 304160a and published to npm. If you are using the singleReturnOnly option, your example should get autofixed to

const x = async () => 1;