martonlederer / esbuild-plugin-postcss2

Use postcss with esbuild
MIT License
33 stars 19 forks source link

"git add" and "prettier --write" in pre-commit are dangerous #33

Open gsouf opened 2 years ago

gsouf commented 2 years ago

Hi,

I think you should remove this from package.json

    "pre-commit": "prettier --write . && git add -A"

It is a dangerous option, that can silently delete changes made by the developer and will also screw git softwares using changelists, as well as a simple selective commit in git cli.

It can safely be replaced with an integration of prettier in your IDE that would fix cs on save.

With that said I leave it up to you the decision to remove it or not.