Skip to content

Instantly share code, notes, and snippets.

@guilhermelimak
Forked from armand1m/install-prettier.sh
Last active July 23, 2021 01:21
Show Gist options
  • Save guilhermelimak/742312595931f4b0dc53f34da2051cc3 to your computer and use it in GitHub Desktop.
Save guilhermelimak/742312595931f4b0dc53f34da2051cc3 to your computer and use it in GitHub Desktop.
Add prettier to a node project in one script
yarn add -D prettier
cat > ./.prettierrc <<EOL
{
"printWidth": 80,
"singleQuote": true,
"trailingComma": "es5"
}
EOL
npx add-project-script -n "format:check" -v "prettier --check './src/**/*.{tsx,ts}'"
npx add-project-script -n "format" -v "prettier --write './src/**/*.{tsx,ts}'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment