My plate is unfortunately too full to take on this myself, so this is just a throwaway suggestion (and feel free to close), but you might wish to consider reviewing eslint-plugin-unicorn for its utils (and possibly ast and fix) folders. A very robust set of utilities which are only available within that plugin...