Last active
March 26, 2022 10:41
-
-
Save armand1m/75972070ce98e3169b3d2917f60f0a5b to your computer and use it in GitHub Desktop.
Add prettier to a node project in one script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yarn add -D prettier | |
cat > ./.prettierrc <<EOL | |
{ | |
"printWidth": 70, | |
"singleQuote": true, | |
"trailingComma": "es5" | |
} | |
EOL | |
npx add-project-script -n "lint" -v "prettier --check './src/**/*.{tsx,ts,js,json}'" | |
npx add-project-script -n "lint:fix" -v "prettier --write './src/**/*.{tsx,ts,js,json}'" |
this gist raw endpoint is also added in my URL shortener, so it enables you to use it like this:
curl -SLsf https://go.d1m.dev/installprettier | sh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
make sure you're running this on the project working directory