From fbe62fa6ace791e304227d2feb403626894403d0 Mon Sep 17 00:00:00 2001 From: xav-ie Date: Sun, 15 Sep 2024 12:30:24 -0400 Subject: [PATCH 1/2] chore(format): use cache Makes formatting faster by using the cache stored in `node_modules` --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e53c193..c4c1d4d 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "scripts": { "build": "remix vite:build", "dev": "remix vite:dev", - "format": "prettier --write .", + "format": "prettier --cache --write .", "lint": "eslint . .*js --max-warnings 0", "lint:knip": "knip", "lint:md": "markdownlint \"**/*.md\" \".github/**/*.md\" --rules sentences-per-line", From 2b66e1b4d9af472adb2b8f0757cd6f7373dc612e Mon Sep 17 00:00:00 2001 From: xav-ie Date: Sun, 15 Sep 2024 12:32:39 -0400 Subject: [PATCH 2/2] refactor(lint:format): rename workflow Treating formatting as a lint step makes it easier to understand the checks necessary to pass PR approval. --- .github/workflows/{prettier.yml => lint-format.yml} | 6 +++--- package.json | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) rename .github/workflows/{prettier.yml => lint-format.yml} (71%) diff --git a/.github/workflows/prettier.yml b/.github/workflows/lint-format.yml similarity index 71% rename from .github/workflows/prettier.yml rename to .github/workflows/lint-format.yml index ae43fc4..93e3b63 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/lint-format.yml @@ -1,12 +1,12 @@ jobs: - prettier: + lint_format: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: ./.github/actions/prepare - - run: pnpm format --list-different + - run: pnpm lint:format -name: Prettier +name: Lint Format on: pull_request: ~ diff --git a/package.json b/package.json index c4c1d4d..df3359a 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "dev": "remix vite:dev", "format": "prettier --cache --write .", "lint": "eslint . .*js --max-warnings 0", + "lint:format": "prettier --cache --check .", "lint:knip": "knip", "lint:md": "markdownlint \"**/*.md\" \".github/**/*.md\" --rules sentences-per-line", "lint:packages": "pnpm dedupe --check",