From fbda8c8286f41f062ae776febb903e8f9b2a4af5 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 8 May 2024 10:17:48 +0100 Subject: [PATCH] Run ESLint on CI Run the ESLint static analysis tool on any code that is submitted, to find possible bugs such as undefined functions and variables. We may want to adjust the ESLint settings over time, but this seems like a good start. This is merged into the previous check-translations.yml action, because that's also a form of linting. Possibly that could be reimplemented as an ESLint plugin. --- .../{check-translations.yml => lint.yml} | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) rename .github/workflows/{check-translations.yml => lint.yml} (65%) diff --git a/.github/workflows/check-translations.yml b/.github/workflows/lint.yml similarity index 65% rename from .github/workflows/check-translations.yml rename to .github/workflows/lint.yml index 364328e90..c0976139a 100644 --- a/.github/workflows/check-translations.yml +++ b/.github/workflows/lint.yml @@ -1,6 +1,6 @@ -# This workflow runs the tools/check-translations.js script to make sure that the translation data is valid. +# Lint PRs and pushes to the main branch -name: Check Translations +name: Lint env: NODE_VERSION: 21.x @@ -13,7 +13,7 @@ on: branches: [ "main" ] jobs: - test: + build: runs-on: ubuntu-latest steps: @@ -24,5 +24,10 @@ jobs: node-version: ${{ env.NODE_VERSION }} cache: 'npm' cache-dependency-path: ./package-lock.json - - run: npm ci - - run: npm run check-translations \ No newline at end of file + - name: Install dependencies + run: npm ci + - name: Run ESLint + run: npx eslint + - name: Check translations + if: '!cancelled()' + run: npm run check-translations