0

So I've been seeing many javascript and typescript tutorials recommending to install prettier. I know prettier is a must nowadays but since we can get it directly from a extension on your IDE or text editor, why would you install the package itself from npm, yarn, etc..., instead of just using the extension?

Thanks for stopping by.

HappyDev
  • 380
  • 1
  • 9

1 Answers1

1

For continuous integration or for those times when you don't have an editor installed. Editor prettiers (and their configs) vary from IDE to IDE as well. Your "pretty" might be different from mine. If we both use the exact same tool, the results are idempotent meaning less git diff noise.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
zero298
  • 25,467
  • 10
  • 75
  • 100
  • I understand now, but we can also sync up our prettier configs on all the IDEs on a team, can't we (since we'd be setting up the prettier package anyway) ? Or is it easier when using the prettier package? – HappyDev Nov 04 '21 at 22:28
  • @HappyDev I have a lot of custom settings that let me work very quickly in Atom. I also use Vim for quick edits. Several of my teammates use VSCode for the same reasons. Getting either of us to switch would start a religious war and would reduce the one who had to switch productivity. If I just have a pre-commit hook that prettifies and lints automatically, there is no issue. No one gets mad, no one has to switch. – zero298 Nov 04 '21 at 22:35