From 5d35161ae392f17c81563d6bbcd25775c67f1e6e Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Tue, 6 Aug 2024 11:15:45 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7(frontend)=20add=20linting=20and=20?= =?UTF-8?q?formatting=20checks=20for=20frontend?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added CI job to run linting and formatting checks in the frontend codebase. Please note, we should cache frontend dependencies, to avoid re-installing them. Future improvement! --- .github/workflows/meet.yml | 15 +++++++++++++++ src/frontend/package.json | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/meet.yml b/.github/workflows/meet.yml index 4b3b1f25..26e6d3dd 100644 --- a/.github/workflows/meet.yml +++ b/.github/workflows/meet.yml @@ -160,6 +160,21 @@ jobs: - name: Run tests run: ~/.local/bin/pytest -n 2 + lint-front: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install dependencies + run: cd src/frontend/ && npm ci + + - name: Check linting + run: cd src/frontend/ && npm run lint + + - name: Check format + run: cd src/frontend/ && npm run check + i18n-crowdin: runs-on: ubuntu-latest steps: diff --git a/src/frontend/package.json b/src/frontend/package.json index 4721ab7c..6420aa3d 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -9,7 +9,8 @@ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview", "i18n:extract": "npx i18next -c i18next-parser.config.json", - "format": "prettier --write ./src" + "format": "prettier --write ./src", + "check": "prettier --check ./src" }, "dependencies": { "@livekit/components-react": "2.3.3",