From 98e97ba508ec29a1d0b0b72daef945b0d0d19f3f Mon Sep 17 00:00:00 2001 From: bracesproul Date: Tue, 11 Mar 2025 13:31:41 -0700 Subject: [PATCH 1/7] feat: Add CI --- .github/workflows/ci.yml | 70 ++++++++++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 71 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c5b53ff --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,70 @@ +# Run formatting on all PRs + +name: CI + +on: + push: + branches: ["main"] + pull_request: + workflow_dispatch: # Allows triggering the workflow manually in GitHub UI + +# If another push to the same PR or branch happens while this workflow is still running, +# cancel the earlier run in favor of the next run. +# +# There's no point in testing an outdated version of the code. GitHub only allows +# a limited number of job runners to be active at the same time, so it's better to cancel +# pointless jobs early so that more useful jobs can run sooner. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + format: + name: Check formatting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js 18.x + uses: actions/setup-node@v3 + with: + node-version: 18.x + cache: "pnpm" + - name: Install dependencies + run: pnpm install + - name: Check formatting + run: pnpm format:check + + lint: + name: Check linting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js 18.x + uses: actions/setup-node@v3 + with: + node-version: 18.x + cache: "pnpm" + - name: Install dependencies + run: pnpm install + - name: Check linting + run: pnpm lint + + readme-spelling: + name: Check README spelling + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: codespell-project/actions-codespell@v2 + with: + ignore_words_file: .codespellignore + path: README.md + + check-spelling: + name: Check code spelling + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: codespell-project/actions-codespell@v2 + with: + ignore_words_file: .codespellignore + path: src diff --git a/package.json b/package.json index aaf2e3a..a65eec3 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "build": "tsc -b && vite build", "lint": "eslint .", "format": "prettier --write .", + "format:check": "prettier --check .", "preview": "vite preview" }, "dependencies": { From 759d58c0b0a3d720c878f8eef90e968bf4f0e976 Mon Sep 17 00:00:00 2001 From: bracesproul Date: Tue, 11 Mar 2025 13:35:29 -0700 Subject: [PATCH 2/7] cr --- .github/workflows/ci.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5b53ff..5ed4d9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,11 +24,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Use Node.js 18.x - uses: actions/setup-node@v3 + - uses: pnpm/action-setup@v4 with: - node-version: 18.x - cache: "pnpm" + version: 6.32.9 + - uses: actions/setup-node@v4 + with: + node-version: '18.x' + cache: 'pnpm' - name: Install dependencies run: pnpm install - name: Check formatting @@ -39,11 +41,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Use Node.js 18.x - uses: actions/setup-node@v3 + - uses: pnpm/action-setup@v4 with: - node-version: 18.x - cache: "pnpm" + version: 6.32.9 + - uses: actions/setup-node@v4 + with: + node-version: '18.x' + cache: 'pnpm' - name: Install dependencies run: pnpm install - name: Check linting From 8cbfe6aae2cbe8be8254acea1f15b37b109f5fb2 Mon Sep 17 00:00:00 2001 From: bracesproul Date: Tue, 11 Mar 2025 13:36:05 -0700 Subject: [PATCH 3/7] cr --- .codespellignore | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .codespellignore diff --git a/.codespellignore b/.codespellignore new file mode 100644 index 0000000..e69de29 From c853047cba0918828eb0208caa96012881bf2dfe Mon Sep 17 00:00:00 2001 From: bracesproul Date: Tue, 11 Mar 2025 13:36:56 -0700 Subject: [PATCH 4/7] cr --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ed4d9a..c048257 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 with: - version: 6.32.9 + version: 10.5.1+sha512.c424c076bd25c1a5b188c37bb1ca56cc1e136fbf530d98bcb3289982a08fd25527b8c9c4ec113be5e3393c39af04521dd647bcf1d0801eaf8ac6a7b14da313af - uses: actions/setup-node@v4 with: node-version: '18.x' @@ -43,7 +43,7 @@ jobs: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 with: - version: 6.32.9 + version: 10.5.1+sha512.c424c076bd25c1a5b188c37bb1ca56cc1e136fbf530d98bcb3289982a08fd25527b8c9c4ec113be5e3393c39af04521dd647bcf1d0801eaf8ac6a7b14da313af - uses: actions/setup-node@v4 with: node-version: '18.x' From 76a4ffed202d693f201d2a61428ef4857163931d Mon Sep 17 00:00:00 2001 From: bracesproul Date: Tue, 11 Mar 2025 13:38:25 -0700 Subject: [PATCH 5/7] cr --- eslint.config.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eslint.config.js b/eslint.config.js index 79a552e..c7d5751 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -19,6 +19,8 @@ export default tseslint.config( }, rules: { ...reactHooks.configs.recommended.rules, + "@typescript-eslint/no-explicit-any": 0, + "@typescript-eslint/no-unused-vars": ["warn", { args: "none" }], "react-refresh/only-export-components": [ "warn", { allowConstantExport: true }, From 2b849577bd41723e6e346edf06136eb33e290a59 Mon Sep 17 00:00:00 2001 From: bracesproul Date: Tue, 11 Mar 2025 13:39:06 -0700 Subject: [PATCH 6/7] cr --- eslint.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint.config.js b/eslint.config.js index c7d5751..cea0409 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -20,7 +20,7 @@ export default tseslint.config( rules: { ...reactHooks.configs.recommended.rules, "@typescript-eslint/no-explicit-any": 0, - "@typescript-eslint/no-unused-vars": ["warn", { args: "none" }], + "@typescript-eslint/no-unused-vars": ["warn", { args: "none", argsIgnorePattern: "^_", varsIgnorePattern: "^_" }], "react-refresh/only-export-components": [ "warn", { allowConstantExport: true }, From 4c7280954390dcaef8ec100be0f1682afe589292 Mon Sep 17 00:00:00 2001 From: bracesproul Date: Tue, 11 Mar 2025 13:39:28 -0700 Subject: [PATCH 7/7] cr --- .github/workflows/ci.yml | 8 ++++---- eslint.config.js | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c048257..2d87374 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,8 +29,8 @@ jobs: version: 10.5.1+sha512.c424c076bd25c1a5b188c37bb1ca56cc1e136fbf530d98bcb3289982a08fd25527b8c9c4ec113be5e3393c39af04521dd647bcf1d0801eaf8ac6a7b14da313af - uses: actions/setup-node@v4 with: - node-version: '18.x' - cache: 'pnpm' + node-version: "18.x" + cache: "pnpm" - name: Install dependencies run: pnpm install - name: Check formatting @@ -46,8 +46,8 @@ jobs: version: 10.5.1+sha512.c424c076bd25c1a5b188c37bb1ca56cc1e136fbf530d98bcb3289982a08fd25527b8c9c4ec113be5e3393c39af04521dd647bcf1d0801eaf8ac6a7b14da313af - uses: actions/setup-node@v4 with: - node-version: '18.x' - cache: 'pnpm' + node-version: "18.x" + cache: "pnpm" - name: Install dependencies run: pnpm install - name: Check linting diff --git a/eslint.config.js b/eslint.config.js index cea0409..af6a2b5 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -20,7 +20,10 @@ export default tseslint.config( rules: { ...reactHooks.configs.recommended.rules, "@typescript-eslint/no-explicit-any": 0, - "@typescript-eslint/no-unused-vars": ["warn", { args: "none", argsIgnorePattern: "^_", varsIgnorePattern: "^_" }], + "@typescript-eslint/no-unused-vars": [ + "warn", + { args: "none", argsIgnorePattern: "^_", varsIgnorePattern: "^_" }, + ], "react-refresh/only-export-components": [ "warn", { allowConstantExport: true },