From 8d89ec1f690992e0f5cdd378aed29585549418d8 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Fri, 29 Mar 2024 10:50:14 -0400 Subject: [PATCH 1/5] Rename npm run to type-check from tsc --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 48b6530..e401fd8 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "private": true, "scripts": { "format": "run-s format:code format:mermaid format:tocs", - "tsc": "npx tsc --noEmit", + "type-check": "npx tsc --noEmit", "build": "run-s dev:clean dev:build dev:assets dev:manifest", "build-prod": "run-s prod:clean prod:build prod:assets prod:manifest", "clean": "npm run dev:clean", From 5d26ce8d3ff99625ea4b12caae1ad2cfd1db640d Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Fri, 29 Mar 2024 10:50:22 -0400 Subject: [PATCH 2/5] Add typecheck CI workflow --- .github/check_types.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/check_types.yml diff --git a/.github/check_types.yml b/.github/check_types.yml new file mode 100644 index 0000000..1980feb --- /dev/null +++ b/.github/check_types.yml @@ -0,0 +1,27 @@ +name: check-types + +on: + pull_request: + branches: + - main + +jobs: + format: + name: Typecheck Codebase + runs-on: ubuntu-latest + + steps: + - name: Check out repo + uses: actions/checkout@v4 + + - name: Set up Node w/caching + uses: actions/setup-node@v4 + with: + cache: 'npm' + cache-dependency-path: 'package-lock.json' + + - name: Install deps + run: npm install + + - name: Run formatting check + run: npm run type-check From 10a39eadc16673668572251d38129c17b6795551 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Fri, 29 Mar 2024 10:50:53 -0400 Subject: [PATCH 3/5] Add type error --- src/helpers/state.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/state.ts b/src/helpers/state.ts index b4709c7..d08235e 100644 --- a/src/helpers/state.ts +++ b/src/helpers/state.ts @@ -3,7 +3,7 @@ import type { TRoundTurnInfo } from '@/types/types-score-scrape' import { BONUS_TURN_ID } from '@/consts' -export const calcRoundTurn = (raw_turn: TRawTurnId): TRoundTurnInfo => { +export const calcRoundTurn = (raw_turn: TRawTurnIdx): TRoundTurnInfo => { // raw_turn is zero-indexed // The output round and in-round turn are one-indexed if (raw_turn <= 7) { From 88456441ea0593fd83175ab08468abc2e70c32c4 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Fri, 29 Mar 2024 10:53:09 -0400 Subject: [PATCH 4/5] Trivial still-broken change to run CI again --- src/helpers/state.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/state.ts b/src/helpers/state.ts index d08235e..3423fd9 100644 --- a/src/helpers/state.ts +++ b/src/helpers/state.ts @@ -3,7 +3,7 @@ import type { TRoundTurnInfo } from '@/types/types-score-scrape' import { BONUS_TURN_ID } from '@/consts' -export const calcRoundTurn = (raw_turn: TRawTurnIdx): TRoundTurnInfo => { +export const calcRoundTurn = (raw_turn: TRawTurnIdxx): TRoundTurnInfo => { // raw_turn is zero-indexed // The output round and in-round turn are one-indexed if (raw_turn <= 7) { From 39e8ceb47a2c3d99538bba517baf5c9e9c36d19e Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Fri, 29 Mar 2024 10:54:48 -0400 Subject: [PATCH 5/5] Fix YML formatting, I guess --- .github/check_types.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/check_types.yml b/.github/check_types.yml index 1980feb..1fbf021 100644 --- a/.github/check_types.yml +++ b/.github/check_types.yml @@ -11,17 +11,17 @@ jobs: runs-on: ubuntu-latest steps: - - name: Check out repo - uses: actions/checkout@v4 + - name: Check out repo + uses: actions/checkout@v4 - - name: Set up Node w/caching - uses: actions/setup-node@v4 - with: - cache: 'npm' - cache-dependency-path: 'package-lock.json' + - name: Set up Node w/caching + uses: actions/setup-node@v4 + with: + cache: 'npm' + cache-dependency-path: 'package-lock.json' - - name: Install deps - run: npm install + - name: Install deps + run: npm install - - name: Run formatting check - run: npm run type-check + - name: Run formatting check + run: npm run type-check