nrwl / precise-commits

:sparkles: Painlessly apply Prettier by only formatting lines you have modified anyway!
MIT License
471 stars 20 forks source link

Extra indentation is not removed #70

Open protoEvangelion opened 3 years ago

protoEvangelion commented 3 years ago

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:

image

I would expect the leading spaces before const to be removed.

djcsdy commented 2 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.