$ pip3 install js-beautify
Now we define a diff configuration with name minjs, which tells Git to prettify files with js-beautify:
$ git config --global diff.minjs.textconv js-beautify
If you have got enough space on disk, enable caching of the beautified files:
# takes extra space, but makes it faster: $ git config --global diff.minjs.cachetextconv true
git show does not unless you use the --ext-diff option.