no-unnecessary-else
auto-fixer interacts badly with prettier
#106
Labels
no-unnecessary-else
auto-fixer interacts badly with prettier
#106
We have a pre-commit hook that runs
tslint --fix
, but with a recent update of this plugin that does auto-fixing forno-unnecessary-else
, it generates really strange code, most likely because it interacts in a bad way withprettier
.Some examples:
It just removes the
else
keyword, but it does not move the remainingif
to a new line, instead it now has two spaces between}
andif
.Here, it also just removes the
else
keyword, but leaves the whole block there, also with the mentioned whitespace issues like before.This case is admittedly more complex, since you could have block-scoped let/const bindings that could lead to breakage when you just remove the whole block, so in this case developer intervention is still required.
The text was updated successfully, but these errors were encountered: