From c60506136b6576e7c342265db30b76dae0f27f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Palma?= Date: Mon, 16 Sep 2024 13:39:34 +0100 Subject: [PATCH] ci: added workflow to run linter --- .github/workflows/codeanalysis.yaml | 44 +++++++++++++++++++ package.json | 1 + .../ClassSelectorDropdownController.tsx | 3 -- 3 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/codeanalysis.yaml diff --git a/.github/workflows/codeanalysis.yaml b/.github/workflows/codeanalysis.yaml new file mode 100644 index 00000000..86ff3126 --- /dev/null +++ b/.github/workflows/codeanalysis.yaml @@ -0,0 +1,44 @@ +name: Code analysis + +on: + push: + branches: + - develop + - main + pull_request: + branches: + - develop + - main + +jobs: + lint: + runs-on: ubuntu-latest + name: Lint + + strategy: + matrix: + node-version: [21.x] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: | + **/node_modules + key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} + + - name: Install dependencies + run: npm install + + - name: Build site + run: npm run build + + - name: Lint Code + run: npm run lint + diff --git a/package.json b/package.json index 322143dd..39607613 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "scripts": { "dev": "vite --host", "build": "tsc && vite build", + "lint": "eslint .", "preview": "vite preview", "check": "npx prettier --check .", "format": "npx prettier --write ." diff --git a/src/components/planner/sidebar/CoursesController/ClassSelectorDropdownController.tsx b/src/components/planner/sidebar/CoursesController/ClassSelectorDropdownController.tsx index 46502852..bd86c79b 100644 --- a/src/components/planner/sidebar/CoursesController/ClassSelectorDropdownController.tsx +++ b/src/components/planner/sidebar/CoursesController/ClassSelectorDropdownController.tsx @@ -224,9 +224,6 @@ const ClassSelectorDropdownController = ({ key={`schedule-${classInfo.name}`} course_id={course.id} classInfo={classInfo} - displayed={display === classInfo.id} - checked={selectedOption === classInfo.id} - preview={preview} conflict={timesCollideWithSelected(classInfo)} onSelect={() => { setSelectedClassId(classInfo.id)