Skip to content

Instantly share code, notes, and snippets.

@mnutt mnutt/
Created Jun 6, 2019

What would you like to do?
Prettier project wrapper
# This wrapper prefers your project's prettier version, and only runs prettier if your project has configured it.
# Save this file as `prettier` in your $PATH, or set your editor's prettier plugin to use it as the prettier binary
# find the file prettier is trying to prettify
# optionally set where the real prettier command can be found
prettier=`which prettier`
node_modules=`/usr/local/bin/npm root`
if [ -f "${node_modules}/.bin/prettier" ]; then
if $prettier --find-config-path ${file} > /dev/null; then
exec $prettier "$@"
exec cat <&0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.