Skip to content

Instantly share code, notes, and snippets.

@kasir-barati
Last active September 20, 2022 10:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kasir-barati/fb8263d5f546de1503847928ad4c6025 to your computer and use it in GitHub Desktop.
Save kasir-barati/fb8263d5f546de1503847928ad4c6025 to your computer and use it in GitHub Desktop.
My customized create react app
#!/bin/bash
pnpx create-react-app "$@"
cd "$1"
rm -rf node_modules package-lock.json
pnpm i
# Add prettier and its script
pnpm add -D prettier
wget https://gist.githubusercontent.com/kasir-barati/2bcdeea964f88712eca171adb3fbd979/raw/.prettierrc
wget https://gist.githubusercontent.com/kasir-barati/8b32cf62e69e6f87a6bed899eefe1cb5/raw/.prettierignore
node -e "const { readFileSync, writeFileSync } = require('fs'); const packageJson = JSON.parse(readFileSync('package.json', 'utf-8')); packageJson.scripts = { ...packageJson.scripts, \"format\": \"prettier -w . -u\" }; writeFileSync('package.json', JSON.stringify(packageJson))"
# Add License
wget https://gist.githubusercontent.com/kasir-barati/7574fdf252e2648ebeb119264bcd442d/raw/LICENCE
node -e "const { readFileSync, writeFileSync } = require('fs'); const packageJson = JSON.parse(readFileSync('package.json', 'utf-8')); packageJson.license = 'GPL-3.0'; writeFileSync('package.json', JSON.stringify(packageJson))"
# Later works
pnpm format
git init
git add .
git commit -m "cleanup: prettified"
git branch -m main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment