Closed benlesh closed 2 years ago
I usually specify a fix and a suggestion using the same fix implementation. For example, this fix:
gets used as a fix:
and as a suggestion:
And in the test, the specified output
tests the fix:
and the suggestion in the suggestions
array (in conjunction with the suggest
annotation in the fromFixture
call) tests the suggestion:
And - note to self - I'll need to remember to bump the major version of this when we merge this, as some folks might be surprised by the fixer.
Okay, I've added both fixes and suggestions and appropriate tests.
However, please notice that the output isn't "perfectly" formatted. I wasn't entirely sure what to do there, and I was unable to find any best practices. Presumably people will have their own autoformatters (Pretter, clangformat, etc) that they'll want to use regardless if eslint is outputting code.
I've (attempted at least) to add a rudimentary fix for instances where users are using the deprecated signatures of
tap
andsubscribe
.