From d0cc7ba88f75bb9cc4d3732808cecbb8ebd4747f Mon Sep 17 00:00:00 2001 From: Ulrich Eckhardt Date: Mon, 15 Jul 2024 12:01:13 +0200 Subject: [PATCH] GitHub Actions: Runs `eslint` on changes --- .github/workflows/eslint.yaml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/eslint.yaml diff --git a/.github/workflows/eslint.yaml b/.github/workflows/eslint.yaml new file mode 100644 index 0000000..cfc8c55 --- /dev/null +++ b/.github/workflows/eslint.yaml @@ -0,0 +1,41 @@ +name: Linter + +on: + pull_request: + branches: + - main + push: + branches: + - main + +permissions: + contents: read + +jobs: + # `eslint` static analyzer + # + # The package.json also has a format script built on `prettier`, + # but that is already integrated into `eslint` and not invoked + # separately here. + run-eslint: + name: Run eslint TypeScript Linter + runs-on: ubuntu-latest + + steps: + - name: Checkout + id: checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + id: setup-node + uses: actions/setup-node@v4 + with: + cache: npm + + - name: Install Dependencies + id: npm-ci + run: npm ci + + - name: Run Lint Script + id: npm-lint + run: npm run lint