From ac629e699a60c19d30b003ae59d61ffd99c8b1c2 Mon Sep 17 00:00:00 2001 From: TaylorFries <78506153+TaylorFries@users.noreply.github.com> Date: Fri, 5 Jan 2024 14:48:44 -0800 Subject: [PATCH] Add workflow to lint react-app (#2013) Co-authored-by: Dylan Barkowsky <37922247+dbarkowsky@users.noreply.github.com> Co-authored-by: dbarkowsky --- .github/workflows/react-app-lint.yml | 32 ++++++++++++++++++++++++++++ react-app/.eslintrc.cjs | 1 + 2 files changed, 33 insertions(+) create mode 100644 .github/workflows/react-app-lint.yml diff --git a/.github/workflows/react-app-lint.yml b/.github/workflows/react-app-lint.yml new file mode 100644 index 000000000..a884b550e --- /dev/null +++ b/.github/workflows/react-app-lint.yml @@ -0,0 +1,32 @@ +name: React App Linting Check + +on: + pull_request: + types: [opened, synchronize] + branches: [main] + paths: + - 'react-app/**' + - '.github/workflows/react-app-lint.yml' + workflow_dispatch: + +jobs: + lint-api: + name: Lint React App + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + # Could optimize this by only installing necessary dependencies + - name: Install Dependencies + working-directory: ./react-app + run: npm i --only=dev + + - name: Run ESLint + working-directory: ./react-app + run: npm run lint + + - name: Run Prettier + working-directory: ./react-app + run: npm run check diff --git a/react-app/.eslintrc.cjs b/react-app/.eslintrc.cjs index b95421853..b340830c9 100644 --- a/react-app/.eslintrc.cjs +++ b/react-app/.eslintrc.cjs @@ -42,6 +42,7 @@ module.exports = { '@typescript-eslint/no-empty-function': 'off', // ie. {} '@typescript-eslint/no-non-null-assertion': 'off', // Allow use of non-null assertion operator (!). '@typescript-eslint/no-explicit-any': 'off', // Warn if 'any' type is used. + '@typescript-eslint/no-duplicate-enum-values': 'error', '@typescript-eslint/ban-types': [ 'error', {