From 0c5bc3ff57fcb7b571e471504a1061fe9560100a Mon Sep 17 00:00:00 2001 From: Marco Solis Date: Fri, 13 Oct 2023 01:53:26 -0600 Subject: [PATCH 01/15] add basic CI --- .eslintrc.yml | 15 +++++++++++++++ .github/workflows/CI.yaml | 29 +++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .eslintrc.yml create mode 100644 .github/workflows/CI.yaml diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 0000000..88f23f5 --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,15 @@ +env: + browser: true + es2021: true +extends: + - eslint:recommended + - plugin:@typescript-eslint/recommended + - plugin:react/recommended +parser: '@typescript-eslint/parser' +parserOptions: + ecmaVersion: latest + sourceType: module +plugins: + - '@typescript-eslint' + - react +rules: {} diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml new file mode 100644 index 0000000..1ea7c4c --- /dev/null +++ b/.github/workflows/CI.yaml @@ -0,0 +1,29 @@ +name: + +on: + pull_request: + branches: + - dev + - release + - main + push: + branches: + - dev + - release + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install modules + run: yarn + - name: Run ESLint + # echo 0 ensures the CI passess even after + run: eslint . --format json --ext .js,.jsx,.ts,.tsx >> eslint-report.json || echo 0 + - name: ESLint Reporter + uses: rahmanrafi/eslint-reporter-action@v3 + with: + json: ./sample.json + title: ESLint Report \ No newline at end of file From d0e55ceae5d719dddefb679336e116568751f1d4 Mon Sep 17 00:00:00 2001 From: Marco Solis Date: Fri, 13 Oct 2023 01:53:53 -0600 Subject: [PATCH 02/15] fix lint report file --- .github/workflows/CI.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 1ea7c4c..ed882db 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -25,5 +25,5 @@ jobs: - name: ESLint Reporter uses: rahmanrafi/eslint-reporter-action@v3 with: - json: ./sample.json + json: ./eslint-report.json title: ESLint Report \ No newline at end of file From 81f24b5fcc001503c6976ca4f38c851922b629fe Mon Sep 17 00:00:00 2001 From: Marco Solis Date: Sat, 14 Oct 2023 14:33:58 -0600 Subject: [PATCH 03/15] only install eslint and cat report file --- .github/workflows/CI.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index ed882db..9bcbf69 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -18,10 +18,13 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install modules - run: yarn + run: yarn install eslint - name: Run ESLint # echo 0 ensures the CI passess even after - run: eslint . --format json --ext .js,.jsx,.ts,.tsx >> eslint-report.json || echo 0 + run: yarn run eslint . --format json --ext .js,.jsx,.ts,.tsx >> eslint-report.json || echo 0 + - name: cat report file + # echo 0 ensures the CI passess even after + run: cat eslint-report.json || echo 0 - name: ESLint Reporter uses: rahmanrafi/eslint-reporter-action@v3 with: From f33724dd8739f1061a662be6f718911cc7ac0a2a Mon Sep 17 00:00:00 2001 From: Marco Solis Date: Sat, 14 Oct 2023 14:36:01 -0600 Subject: [PATCH 04/15] install eslint globally --- .github/workflows/CI.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 9bcbf69..704e089 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install modules - run: yarn install eslint + run: yarn global add eslint - name: Run ESLint # echo 0 ensures the CI passess even after run: yarn run eslint . --format json --ext .js,.jsx,.ts,.tsx >> eslint-report.json || echo 0 From 07b39adc691876b080aa2d698c23c9fda31bc84a Mon Sep 17 00:00:00 2001 From: Marco Solis Date: Sat, 14 Oct 2023 14:37:23 -0600 Subject: [PATCH 05/15] remove eslint invocation from yarn --- .github/workflows/CI.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 704e089..d39e5ee 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -21,7 +21,7 @@ jobs: run: yarn global add eslint - name: Run ESLint # echo 0 ensures the CI passess even after - run: yarn run eslint . --format json --ext .js,.jsx,.ts,.tsx >> eslint-report.json || echo 0 + run: eslint . --format json --ext .js,.jsx,.ts,.tsx >> eslint-report.json || echo 0 - name: cat report file # echo 0 ensures the CI passess even after run: cat eslint-report.json || echo 0 From 919565ddbec28648ac4c28b9f077df56ded758b8 Mon Sep 17 00:00:00 2001 From: Marco Solis Date: Sat, 14 Oct 2023 14:38:52 -0600 Subject: [PATCH 06/15] change file operator --- .github/workflows/CI.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index d39e5ee..4b93af9 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -21,7 +21,7 @@ jobs: run: yarn global add eslint - name: Run ESLint # echo 0 ensures the CI passess even after - run: eslint . --format json --ext .js,.jsx,.ts,.tsx >> eslint-report.json || echo 0 + run: eslint . --format json --ext .js,.jsx,.ts,.tsx > eslint-report.json || echo 0 - name: cat report file # echo 0 ensures the CI passess even after run: cat eslint-report.json || echo 0 From 2ec9d6bdf30402d23cf22126dcf3e59935658c3c Mon Sep 17 00:00:00 2001 From: Marco Solis Date: Sat, 14 Oct 2023 14:40:31 -0600 Subject: [PATCH 07/15] add typescript support for eslint --- .github/workflows/CI.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 4b93af9..9786cee 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install modules - run: yarn global add eslint + run: yarn global add eslint @typescript-eslint/eslint-plugin@latest - name: Run ESLint # echo 0 ensures the CI passess even after run: eslint . --format json --ext .js,.jsx,.ts,.tsx > eslint-report.json || echo 0 From 42aa4241053b0447d7b0ae7cecfe75d24ae0318d Mon Sep 17 00:00:00 2001 From: Marco Solis Date: Sat, 14 Oct 2023 14:43:51 -0600 Subject: [PATCH 08/15] install eslint locally --- .github/workflows/CI.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 9786cee..c1520f0 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install modules - run: yarn global add eslint @typescript-eslint/eslint-plugin@latest + run: yarn add eslint @typescript-eslint/eslint-plugin@latest - name: Run ESLint # echo 0 ensures the CI passess even after run: eslint . --format json --ext .js,.jsx,.ts,.tsx > eslint-report.json || echo 0 From 23830991d85bc5d3898efde356eee27a119eb442 Mon Sep 17 00:00:00 2001 From: Marco Solis Date: Sat, 14 Oct 2023 14:46:26 -0600 Subject: [PATCH 09/15] call eslint from yarn --- .github/workflows/CI.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index c1520f0..bdb9cc1 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -21,7 +21,7 @@ jobs: run: yarn add eslint @typescript-eslint/eslint-plugin@latest - name: Run ESLint # echo 0 ensures the CI passess even after - run: eslint . --format json --ext .js,.jsx,.ts,.tsx > eslint-report.json || echo 0 + run: yarn run eslint . --format json --ext .js,.jsx,.ts,.tsx > eslint-report.json || echo 0 - name: cat report file # echo 0 ensures the CI passess even after run: cat eslint-report.json || echo 0 From 8a989f3fb0d396892ee0a22b395787c557196ce2 Mon Sep 17 00:00:00 2001 From: Marco Solis Date: Sat, 14 Oct 2023 14:50:07 -0600 Subject: [PATCH 10/15] add eslint react plugin --- .github/workflows/CI.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index bdb9cc1..3900f89 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install modules - run: yarn add eslint @typescript-eslint/eslint-plugin@latest + run: yarn add eslint @typescript-eslint/eslint-plugin@latest eslint-plugin-react - name: Run ESLint # echo 0 ensures the CI passess even after run: yarn run eslint . --format json --ext .js,.jsx,.ts,.tsx > eslint-report.json || echo 0 From 24a9ec168dd82f6b45e6ce47b49d64694992ef6d Mon Sep 17 00:00:00 2001 From: Marco Solis Date: Sat, 14 Oct 2023 14:52:59 -0600 Subject: [PATCH 11/15] add eslint parser --- .github/workflows/CI.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 3900f89..65f6885 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install modules - run: yarn add eslint @typescript-eslint/eslint-plugin@latest eslint-plugin-react + run: yarn add eslint @typescript-eslint/eslint-plugin@latest eslint-plugin-react @typescript-eslint/parser - name: Run ESLint # echo 0 ensures the CI passess even after run: yarn run eslint . --format json --ext .js,.jsx,.ts,.tsx > eslint-report.json || echo 0 From 6c898e89d9b1dbcac304c6bce49c3bfa9a395cd2 Mon Sep 17 00:00:00 2001 From: Marco Solis Date: Sat, 14 Oct 2023 14:57:39 -0600 Subject: [PATCH 12/15] use integrated output from eslint --- .github/workflows/CI.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 65f6885..c5200fa 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -21,7 +21,7 @@ jobs: run: yarn add eslint @typescript-eslint/eslint-plugin@latest eslint-plugin-react @typescript-eslint/parser - name: Run ESLint # echo 0 ensures the CI passess even after - run: yarn run eslint . --format json --ext .js,.jsx,.ts,.tsx > eslint-report.json || echo 0 + run: yarn run eslint . --format json --ext .js,.jsx,.ts,.tsx --output-file eslint-report.json || echo 0 - name: cat report file # echo 0 ensures the CI passess even after run: cat eslint-report.json || echo 0 From add6fbe11614feeadc8863ca10fd44ac995774a0 Mon Sep 17 00:00:00 2001 From: Marco Solis Date: Sat, 14 Oct 2023 15:03:01 -0600 Subject: [PATCH 13/15] change yarn to npm --- .github/workflows/CI.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index c5200fa..960b4d3 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -18,13 +18,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install modules - run: yarn add eslint @typescript-eslint/eslint-plugin@latest eslint-plugin-react @typescript-eslint/parser + run: npm i eslint @typescript-eslint/eslint-plugin@latest eslint-plugin-react @typescript-eslint/parser - name: Run ESLint # echo 0 ensures the CI passess even after - run: yarn run eslint . --format json --ext .js,.jsx,.ts,.tsx --output-file eslint-report.json || echo 0 - - name: cat report file - # echo 0 ensures the CI passess even after - run: cat eslint-report.json || echo 0 + run: node_modules/eslint/bin/eslint.js . . --format json --ext .js,.jsx,.ts,.tsx --output-file eslint-report.json || echo 0 - name: ESLint Reporter uses: rahmanrafi/eslint-reporter-action@v3 with: From 1156d3bc1b43adf3a8f478b6841102de674b753a Mon Sep 17 00:00:00 2001 From: Marco Solis Date: Sat, 14 Oct 2023 15:04:19 -0600 Subject: [PATCH 14/15] rollback to yarn --- .github/workflows/CI.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 960b4d3..199f2f2 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -18,10 +18,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install modules - run: npm i eslint @typescript-eslint/eslint-plugin@latest eslint-plugin-react @typescript-eslint/parser + run: yarn add eslint @typescript-eslint/eslint-plugin@latest eslint-plugin-react @typescript-eslint/parser - name: Run ESLint # echo 0 ensures the CI passess even after - run: node_modules/eslint/bin/eslint.js . . --format json --ext .js,.jsx,.ts,.tsx --output-file eslint-report.json || echo 0 + run: yarn run eslint . --format json --ext .js,.jsx,.ts,.tsx --output-file eslint-report.json || echo 0 - name: ESLint Reporter uses: rahmanrafi/eslint-reporter-action@v3 with: From d1435cd084d332f0607ebc516b355c23ec8493f4 Mon Sep 17 00:00:00 2001 From: Marco Solis Date: Sat, 14 Oct 2023 15:12:40 -0600 Subject: [PATCH 15/15] fix ignore react jsx in scope eslint --- .eslintrc.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index f63e8c5..d0400d5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -31,6 +31,8 @@ ], "rules": { "@typescript-eslint/no-var-requires": 0, - "@typescript-eslint/no-explicit-any": 0 + "@typescript-eslint/no-explicit-any": 0, + "react/react-in-jsx-scope": "off", + "react/jsx-uses-react": "off" } } \ No newline at end of file