diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4d4503e7..ec6d9e5e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,13 +48,34 @@ jobs: run: | yarn install --force --non-interactive + eslint: + name: "eslint" + runs-on: ubuntu-latest + needs: install-cache + steps: + - name: Checkout Commit + uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v3 + - name: Restore yarn dependencies + uses: actions/cache@v3 + id: cache-dependencies + with: + path: node_modules + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Run linter + run: | + yarn lint + unit-test: name: "Unit Testing" runs-on: ubuntu-latest strategy: matrix: node: [18.x, 20.x, 21.x] - needs: install-cache + needs: eslint steps: - name: Checkout Commit uses: actions/checkout@v3 diff --git a/src/hooks/pagination.ts b/src/hooks/pagination.ts index 396de747..59ddf8bf 100644 --- a/src/hooks/pagination.ts +++ b/src/hooks/pagination.ts @@ -3,7 +3,7 @@ import { useEffect, useState } from "react"; export function usePagination( maxPages: number, - onComplete?: Function, + onComplete?: () => void, displayLength: number = SCREEN_DEFAULT_DISPLAY_LENGTH ) { const [page, setPage] = useState(1); diff --git a/src/lib/season/routeHandler.ts b/src/lib/season/routeHandler.ts index 81813270..92565701 100644 --- a/src/lib/season/routeHandler.ts +++ b/src/lib/season/routeHandler.ts @@ -6,8 +6,6 @@ const historicalData = initializeHistoricalTempPrecip(); const climateNormals = initializeClimateNormals(); export function getSeasonData(req: Request, res: Response) { - const { season, ...seasonPrecipData } = historicalData.seasonPrecipData(); - res.json({ season: { windchill: isWindchillSeason(), @@ -15,7 +13,7 @@ export function getSeasonData(req: Request, res: Response) { winter: getIsWinterSeason(), }, seasonPrecip: { - ...seasonPrecipData, + ...historicalData.seasonPrecipData(), normal: climateNormals.getNormalPrecipForCurrentSeason()?.amount, }, }); diff --git a/src/types/screen.types.ts b/src/types/screen.types.ts index 796d5cf8..2e3f3ce7 100644 --- a/src/types/screen.types.ts +++ b/src/types/screen.types.ts @@ -1,3 +1,3 @@ export type AutomaticScreenProps = { - onComplete: Function; + onComplete: () => void; };