Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ci: add eslint build step #603

Merged
merged 2 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/pagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 1 addition & 3 deletions src/lib/season/routeHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ const historicalData = initializeHistoricalTempPrecip();
const climateNormals = initializeClimateNormals();

export function getSeasonData(req: Request, res: Response) {
const { season, ...seasonPrecipData } = historicalData.seasonPrecipData();

res.json({
season: {
windchill: isWindchillSeason(),
sunspot: isSunSpotSeason(),
winter: getIsWinterSeason(),
},
seasonPrecip: {
...seasonPrecipData,
...historicalData.seasonPrecipData(),
normal: climateNormals.getNormalPrecipForCurrentSeason()?.amount,
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/types/screen.types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export type AutomaticScreenProps = {
onComplete: Function;
onComplete: () => void;
};