Open protoEvangelion opened 3 years ago
This project hasn't been maintained for some time.
I'm maintaining an unofficial fork at @softwareventures/precise-commits.
Compared to this project, it fixes a bunch of bugs, and adds support for Windows and CRLF line breaks. It may also fix the problem you're having. If it doesn't, feel free to raise an issue.
I've been using it for a couple of months on my projects and it works well. There are still some pathological cases where it does something weird, but I've never seen it break my code. If you use it on a project where the existing indentation is consistently different to the indentation you configure for prettier, then you are going to have a bad time, but otherwise it is suitable for general use.
You can install it from npm @softwareventures/precise-commits.
The red is before where I added extra indentation & extra spaces to see how the formatter handled it. The green is what precise-commits did:
I would expect the leading spaces before
const
to be removed.