Skip to content

Commit

Permalink
Add cache to format script
Browse files Browse the repository at this point in the history
  • Loading branch information
thetarnav committed Nov 13, 2023
1 parent 66feea6 commit 10d65ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Setup prettier cache
uses: actions/cache@v3
with:
path: node_modules/.cache/prettier
key: prettier-${{ github.sha }}
restore-keys: |
prettier-
- name: Format
run: pnpm run format

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "module",
"scripts": {
"dev": "pnpm -dir site run dev",
"format": "prettier -w {site,packages,scripts,template}/**/*.{js,ts,json,css,tsx,jsx,md,html} --ignore-path .gitignore",
"format": "prettier --cache -w {site,packages,scripts,template}/**/*.{js,ts,json,css,tsx,jsx,md,html} --ignore-path .gitignore",
"lint:packages": "eslint --ignore-path .gitignore --max-warnings 0 packages/*/src/**/*",
"lint:tests": "eslint --ignore-path .gitignore packages/*/test/** --quiet --rule \"no-only-tests/no-only-tests: error\"",
"lint": "concurrently pnpm:lint:*",
Expand Down

0 comments on commit 10d65ce

Please sign in to comment.