Skip to content

Instantly share code, notes, and snippets.

@airtoxin
Last active May 30, 2020 00:47
Show Gist options
  • Save airtoxin/37d7e7419535fed0e3cf8d80a958e18f to your computer and use it in GitHub Desktop.
Save airtoxin/37d7e7419535fed0e3cf8d80a958e18f to your computer and use it in GitHub Desktop.
curl https:/GISTURL | bash -s NAME_OF_APP
npx create-react-app $1 --template typescript
cd $1
yarn add -DE prettier typescript
SCRIPTS=$(cat package.json | jq -c $'.scripts + {"fmt":"prettier --write \'**/*.{js,jsx,ts,tsx,json,md}\' --ignore-path .gitignore"}')
cat package.json | jq ". + {"scripts": $SCRIPTS}" > package.json.tmp
mv package.json{.tmp,}
COMPILER_OPTIONS=$(cat tsconfig.json | jq -c $'.compilerOptions + {"noImplicitAny": true}')
cat tsconfig.json | jq ". + {"compilerOptions": $COMPILER_OPTIONS}" > tsconfig.json.tmp
mv tsconfig.json{.tmp,}
git add .
git commit -m "Add package"
yarn fmt
git add .
git commit -m "fmt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment