diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index ee2c8bae8..8a2412f06 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -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 diff --git a/package.json b/package.json index 67f53eba1..0c45d0e5d 100644 --- a/package.json +++ b/package.json @@ -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:*",