From 52ff61635b1cbd4b024ae882b606cfb64d6cc897 Mon Sep 17 00:00:00 2001 From: Ben Woodward Date: Sun, 4 Jul 2021 16:48:10 -0700 Subject: Prettier formatting (#33) * Add prettier * Format code --- .github/workflows/master_push.yml | 12 +++----- .github/workflows/pull_request.yml | 9 ++---- .prettierrc.json | 5 ++++ Dockerfile | 1 + README.md | 2 +- package.json | 5 +++- public/index.html | 10 +++---- src/App.js | 20 ++++++++------ src/components/Card.js | 56 ++++++++++++++++++++++++++------------ src/components/style.css | 5 ++-- yarn.lock | 5 ++++ 11 files changed, 81 insertions(+), 49 deletions(-) create mode 100644 .prettierrc.json diff --git a/.github/workflows/master_push.yml b/.github/workflows/master_push.yml index 7c56fec..b1ad41b 100644 --- a/.github/workflows/master_push.yml +++ b/.github/workflows/master_push.yml @@ -6,18 +6,14 @@ jobs: build-and-publish: runs-on: ubuntu-latest steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v2 - - - name: Set up Docker + - name: Set up Docker uses: docker/setup-buildx-action@v1 - - - name: Login to DockerHub + - name: Login to DockerHub uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and publish + - name: Build and publish run: make build publish diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 5a2ee16..65cffee 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -4,12 +4,9 @@ jobs: build: runs-on: ubuntu-latest steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v2 - - - name: Set up Docker + - name: Set up Docker uses: docker/setup-buildx-action@v1 - - - name: Build + - name: Build run: make build diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..0dbf448 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,5 @@ +{ + "trailingComma": "es5", + "semi": true, + "singleQuote": true +} diff --git a/Dockerfile b/Dockerfile index 5a5f92f..7d640ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ FROM mhart/alpine-node:14 as builder WORKDIR /tmp COPY . . +RUN npx prettier --check . '!**/*.min.{css,js}' RUN yarn && yarn build ### diff --git a/README.md b/README.md index 0df9331..40120d8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![ci](https://github.com/bndw/wifi-card/workflows/ci/badge.svg) -# πŸ“Ά WiFi Card +# πŸ“Ά WiFi Card Print a simple card with your WiFi login details. Tape it to the fridge, keep it in your wallet, etc. diff --git a/package.json b/package.json index 27a0c47..af43a10 100644 --- a/package.json +++ b/package.json @@ -35,5 +35,8 @@ "main": "index.js", "repository": "git@github.com:bndw/wifi-card.git", "author": "bndw ", - "license": "MIT" + "license": "MIT", + "devDependencies": { + "prettier": "2.3.2" + } } diff --git a/public/index.html b/public/index.html index 6685a59..52cbc44 100644 --- a/public/index.html +++ b/public/index.html @@ -4,10 +4,7 @@ - +