TristonJ / eslint-plugin-prefer-arrow

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

Support --fix for singleReturnOnly mode #2

Closed keithkml closed 7 years ago

keithkml commented 7 years ago

Allow autofixing using eslint --fix for singleReturnOnly mode.

I ran this on one of our codebases here at Uber with 35 kloc and it successfully converted 450+ functions into arrow functions.

The code is unfortunately pretty confusing because eslint has a bad API for AST manipulation :) So I had to roll something myself and it's a little messy

keithkml commented 7 years ago

Please review again!

keithkml commented 7 years ago

Thanks! :)