From bd1722f49b1bc460a9bc030e985b84eeff34afd3 Mon Sep 17 00:00:00 2001 From: taylorfries Date: Wed, 3 Jan 2024 15:23:32 -0800 Subject: [PATCH 1/5] Add workflow to lint react-app --- .github/workflows/react-app-lint.yml | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 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..4242c7700 --- /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.yaml" + 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 \ No newline at end of file From 13c4a81ac8299ee1b9b309fef410646151ff9dfd Mon Sep 17 00:00:00 2001 From: taylorfries Date: Wed, 3 Jan 2024 15:49:13 -0800 Subject: [PATCH 2/5] match file names --- .github/workflows/react-app-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/react-app-lint.yml b/.github/workflows/react-app-lint.yml index 4242c7700..cc1137cbd 100644 --- a/.github/workflows/react-app-lint.yml +++ b/.github/workflows/react-app-lint.yml @@ -6,7 +6,7 @@ on: branches: [main] paths: - "react-app/**" - - ".github/workflows/react-app-lint.yaml" + - ".github/workflows/react-app-lint.yml" workflow_dispatch: jobs: From 5dcf58ffa2eabc3138973908f132183710f16a1b Mon Sep 17 00:00:00 2001 From: taylorfries Date: Wed, 3 Jan 2024 15:57:05 -0800 Subject: [PATCH 3/5] include duplicate enum check --- react-app/.eslintrc.cjs | 1 + 1 file changed, 1 insertion(+) 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', { From 3ff6f9dc7013d0ced46d142835e9ae71f534f61c Mon Sep 17 00:00:00 2001 From: TaylorFries <78506153+TaylorFries@users.noreply.github.com> Date: Fri, 5 Jan 2024 14:42:16 -0800 Subject: [PATCH 4/5] Update .github/workflows/react-app-lint.yml Co-authored-by: Dylan Barkowsky <37922247+dbarkowsky@users.noreply.github.com> --- .github/workflows/react-app-lint.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/react-app-lint.yml b/.github/workflows/react-app-lint.yml index cc1137cbd..9c0af15b2 100644 --- a/.github/workflows/react-app-lint.yml +++ b/.github/workflows/react-app-lint.yml @@ -29,4 +29,5 @@ jobs: - name: Run Prettier working-directory: ./react-app - run: npm run check \ No newline at end of file + run: npm run check + \ No newline at end of file From 4d1243df0b82eb86011d4a31328a6113bf9347fe Mon Sep 17 00:00:00 2001 From: dbarkowsky Date: Fri, 5 Jan 2024 14:47:33 -0800 Subject: [PATCH 5/5] Clean last line --- .github/workflows/react-app-lint.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/react-app-lint.yml b/.github/workflows/react-app-lint.yml index 9c0af15b2..a884b550e 100644 --- a/.github/workflows/react-app-lint.yml +++ b/.github/workflows/react-app-lint.yml @@ -5,8 +5,8 @@ on: types: [opened, synchronize] branches: [main] paths: - - "react-app/**" - - ".github/workflows/react-app-lint.yml" + - 'react-app/**' + - '.github/workflows/react-app-lint.yml' workflow_dispatch: jobs: @@ -29,5 +29,4 @@ jobs: - name: Run Prettier working-directory: ./react-app - run: npm run check - \ No newline at end of file + run: npm run check