Skip to content

Commit

Permalink
ci: format code
Browse files Browse the repository at this point in the history
Uses Prettier (https://prettier.io/) to find style issues in the code.
  • Loading branch information
thewilkybarkid committed Apr 5, 2022
1 parent 5f06f18 commit b12e639
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 2 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Checks

on:
push:
branches:
- '**'
pull_request:

jobs:
format:
runs-on: ubuntu-20.04

steps:
- name: 'Checkout code'
uses: actions/checkout@v2

- name: 'Set up Node.js'
uses: actions/setup-node@v2
with:
node-version: 16
cache: ${{ !env.ACT && 'npm' || '' }}

- name: 'Install dependencies'
run: npm ci

- name: 'Run formatter'
run: npm run format
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.husky/_/
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"arrowParens": "avoid",
"printWidth": 120,
"semi": false,
"singleQuote": true,
"trailingComma": "all"
}
125 changes: 124 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@
"devDependencies": {
"@commitlint/cli": "^16.2.3",
"@commitlint/config-conventional": "^16.2.1",
"husky": "^7.0.4"
"husky": "^7.0.4",
"prettier": "^2.6.2",
"prettier-plugin-sh": "^0.10.0"
},
"scripts": {
"format": "prettier --ignore-unknown --check '**'",
"format:fix": "npm run format -- --write",
"prepare": "which husky && husky install || true"
}
}

0 comments on commit b12e639

Please sign in to comment.