Skip to content

Commit

Permalink
PRE-COMMIT: improve pre-commit checks
Browse files Browse the repository at this point in the history
  • Loading branch information
sahsisunny committed Sep 7, 2023
1 parent 3d36296 commit 67ecb7b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/pre-commit-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Pre-commit checks

on:
pull_request:
branches: ['*']

jobs:
check:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 14

- name: Cache Node.js dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: yarn

- name: Lint check
run: yarn lint:check

- name: Prettier check
run: yarn format:check
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"lint:check": "eslint . --ext .js,.jsx,.ts,.tsx, src/",
"lint:fix": "eslint . --fix --ext js,jsx,ts,tsx, src/",
"check:all": "yarn format:check && yarn lint:check",
"fix:all": "yarn format:fix && yarn lint:fix",
"prepare": "husky install"
},
"dependencies": {
Expand Down

0 comments on commit 67ecb7b

Please sign in to comment.