Skip to content

Instantly share code, notes, and snippets.

@johnpolacek
Created August 15, 2020 02:25
Show Gist options
  • Save johnpolacek/066a853bf2a60b621e075a8fc34171d3 to your computer and use it in GitHub Desktop.
Save johnpolacek/066a853bf2a60b621e075a8fc34171d3 to your computer and use it in GitHub Desktop.
NPM prettier format and format-watch script
{
"scripts": {
"format": "prettier --write \"**/*.{js,jsx,json,md}\"",
"format-watch": "npm run format && onchange \"**/*.{js,jsx,json,md}\" -- prettier --write {{changed}}",
},
"devDependencies": {
"onchange": "^7.0.2",
"prettier": "^2.0.5"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment