From e3a744d9ea3a99430ba97ad1b607be2fc1632520 Mon Sep 17 00:00:00 2001 From: Ridwan Abiola Date: Mon, 4 Sep 2023 10:02:13 +0100 Subject: [PATCH 01/14] Create eslint.yml Add ESLINT to improve code consistency before deploy. closes #17 --- .github/workflows/eslint.yml | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/eslint.yml diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml new file mode 100644 index 0000000..550fadc --- /dev/null +++ b/.github/workflows/eslint.yml @@ -0,0 +1,50 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# ESLint is a tool for identifying and reporting on patterns +# found in ECMAScript/JavaScript code. +# More details at https://github.com/eslint/eslint +# and https://eslint.org + +name: ESLint + +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + schedule: + - cron: '22 11 * * 5' + +jobs: + eslint: + name: Run eslint scanning + runs-on: ubuntu-latest + permissions: + contents: read + security-events: write + actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install ESLint + run: | + npm install eslint@8.10.0 + npm install @microsoft/eslint-formatter-sarif@2.1.7 + + - name: Run ESLint + run: npx eslint . + --config .eslintrc.js + --ext .js,.jsx,.ts,.tsx + --format @microsoft/eslint-formatter-sarif + --output-file eslint-results.sarif + continue-on-error: true + + - name: Upload analysis results to GitHub + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: eslint-results.sarif + wait-for-processing: true From 22ddff5748a5a981d0d323989e30a561d4424d6e Mon Sep 17 00:00:00 2001 From: Ridwan Abiola Date: Mon, 4 Sep 2023 10:16:47 +0100 Subject: [PATCH 02/14] Update eslint.yml --- .github/workflows/eslint.yml | 64 +++++++++++++----------------------- 1 file changed, 23 insertions(+), 41 deletions(-) diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 550fadc..1b1ef7b 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -1,50 +1,32 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# ESLint is a tool for identifying and reporting on patterns -# found in ECMAScript/JavaScript code. -# More details at https://github.com/eslint/eslint -# and https://eslint.org - -name: ESLint +name: Run ESLint on Pull Requests on: - push: - branches: [ "main" ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ "main" ] - schedule: - - cron: '22 11 * * 5' + - pull_request jobs: - eslint: - name: Run eslint scanning + build: + name: Run ESLint runs-on: ubuntu-latest - permissions: - contents: read - security-events: write - actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status + strategy: + max-parallel: 42 + fail-fast: false + matrix: + node-version: [16.x, 18.x, 19.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - - name: Checkout code - uses: actions/checkout@v3 + # Check out the repository + - uses: actions/checkout@v3 + + # Install Node.js + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} - - name: Install ESLint - run: | - npm install eslint@8.10.0 - npm install @microsoft/eslint-formatter-sarif@2.1.7 + # Install your dependencies + - run: npm ci --legacy-peer-deps - - name: Run ESLint - run: npx eslint . - --config .eslintrc.js - --ext .js,.jsx,.ts,.tsx - --format @microsoft/eslint-formatter-sarif - --output-file eslint-results.sarif - continue-on-error: true + # Install ESLint + - run: npm install eslint --save-dev - - name: Upload analysis results to GitHub - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: eslint-results.sarif - wait-for-processing: true + # Run ESLint + - run: npx eslint . From 694a9dc7e5f03ebee3d69fa83c81184b0a470b30 Mon Sep 17 00:00:00 2001 From: Ridwan Abiola Date: Mon, 4 Sep 2023 10:23:13 +0100 Subject: [PATCH 03/14] Update eslint.yml --- .github/workflows/eslint.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 1b1ef7b..04d634c 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -7,6 +7,10 @@ jobs: build: name: Run ESLint runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: cubeseed_login strategy: max-parallel: 42 fail-fast: false From ce941780e456cf95577253a08f4b67cabe3bf6a8 Mon Sep 17 00:00:00 2001 From: Ridwan Abiola Date: Mon, 4 Sep 2023 10:38:42 +0100 Subject: [PATCH 04/14] Update eslint.yml --- .github/workflows/eslint.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 04d634c..c5e133d 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -15,7 +15,7 @@ jobs: max-parallel: 42 fail-fast: false matrix: - node-version: [16.x, 18.x, 19.x] + node-version: [18.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: # Check out the repository @@ -32,5 +32,8 @@ jobs: # Install ESLint - run: npm install eslint --save-dev + # Run Next Lint + - run: npm run lint + # Run ESLint - run: npx eslint . From 146a2770dc5b9f6dd05527e2cfd27fef98416194 Mon Sep 17 00:00:00 2001 From: Ridwan Abiola Date: Mon, 4 Sep 2023 10:41:08 +0100 Subject: [PATCH 05/14] Update eslint.yml --- .github/workflows/eslint.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index c5e133d..4164983 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -32,8 +32,8 @@ jobs: # Install ESLint - run: npm install eslint --save-dev - # Run Next Lint - - run: npm run lint - + # Create Lint config + - run: npm init @eslint/config + # Run ESLint - run: npx eslint . From b12030b8bc9a41e476a0ba630d9d72f3326d76af Mon Sep 17 00:00:00 2001 From: Ridwan Abiola Date: Mon, 4 Sep 2023 10:50:41 +0100 Subject: [PATCH 06/14] Create .eslintrc.json --- .eslintrc.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..bffb357 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "next/core-web-vitals" +} From e2f08363eb5e3f7aaf7125f1e2ad7bc202b05f3a Mon Sep 17 00:00:00 2001 From: Ridwan Abiola Date: Mon, 4 Sep 2023 10:54:21 +0100 Subject: [PATCH 07/14] Update .eslintrc.json --- .eslintrc.json | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index bffb357..a550b53 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,3 +1,22 @@ { - "extends": "next/core-web-vitals" + "env": { + "browser": true, + "es2021": true + }, + "overrides": [], + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module" + }, + "extends": [ + "eslint-config-prettier" + ], + "plugins": [ + "eslint-plugin-prettier" + ], + "rules": { + "prettier/prettier": [ + "error" + ] + } } From e526dc97ceeed7dc77beb6f2034843c4266c0286 Mon Sep 17 00:00:00 2001 From: Ridwan Abiola Date: Mon, 4 Sep 2023 10:54:57 +0100 Subject: [PATCH 08/14] Update eslint.yml --- .github/workflows/eslint.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 4164983..3c126b1 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -7,10 +7,10 @@ jobs: build: name: Run ESLint runs-on: ubuntu-latest - defaults: - run: - shell: bash - working-directory: cubeseed_login + # defaults: + # run: + # shell: bash + # working-directory: cubeseed_login strategy: max-parallel: 42 fail-fast: false @@ -31,9 +31,6 @@ jobs: # Install ESLint - run: npm install eslint --save-dev - - # Create Lint config - - run: npm init @eslint/config # Run ESLint - - run: npx eslint . + - run: npx eslint ./cubeseed_lgin From 49760ae9ea843ec7131789f3f121942ad576a8d9 Mon Sep 17 00:00:00 2001 From: Ridwan Abiola Date: Mon, 4 Sep 2023 10:56:10 +0100 Subject: [PATCH 09/14] Update eslint.yml --- .github/workflows/eslint.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 3c126b1..6273678 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -7,10 +7,10 @@ jobs: build: name: Run ESLint runs-on: ubuntu-latest - # defaults: - # run: - # shell: bash - # working-directory: cubeseed_login + defaults: + run: + shell: bash + working-directory: cubeseed_login strategy: max-parallel: 42 fail-fast: false From 481bc939e55265ec9fe72cc01c707827f000a824 Mon Sep 17 00:00:00 2001 From: Ridwan Abiola Date: Mon, 4 Sep 2023 10:58:36 +0100 Subject: [PATCH 10/14] Update eslint.yml --- .github/workflows/eslint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 6273678..52a9915 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -33,4 +33,4 @@ jobs: - run: npm install eslint --save-dev # Run ESLint - - run: npx eslint ./cubeseed_lgin + - run: npx eslint . From a95c4c19d290724b861777a9407266b6b40042cb Mon Sep 17 00:00:00 2001 From: Ridwan Abiola Date: Mon, 4 Sep 2023 11:53:04 +0100 Subject: [PATCH 11/14] Update eslint.yml --- .github/workflows/eslint.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 52a9915..d4f6adc 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -31,6 +31,9 @@ jobs: # Install ESLint - run: npm install eslint --save-dev + + # Install Next Config + - run: npm install eslint-config-next --save-dev # Run ESLint - run: npx eslint . From 846b684146ed5ba43ea7b85deb3ed6b4be354b41 Mon Sep 17 00:00:00 2001 From: Ridwan Abiola Date: Mon, 4 Sep 2023 11:53:34 +0100 Subject: [PATCH 12/14] Update .eslintrc.json --- .eslintrc.json | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index a550b53..bffb357 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,22 +1,3 @@ { - "env": { - "browser": true, - "es2021": true - }, - "overrides": [], - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "extends": [ - "eslint-config-prettier" - ], - "plugins": [ - "eslint-plugin-prettier" - ], - "rules": { - "prettier/prettier": [ - "error" - ] - } + "extends": "next/core-web-vitals" } From 04f02d2c5490b75e26fd095e5f5eff3b7f5ba096 Mon Sep 17 00:00:00 2001 From: Ridwan Abiola Date: Mon, 4 Sep 2023 14:25:42 +0100 Subject: [PATCH 13/14] Update .eslintrc.json --- .eslintrc.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index bffb357..f7daa01 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,3 +1,8 @@ { - "extends": "next/core-web-vitals" + "rules": { + "@next/next/no-html-link-for-pages": "off", + "react/jsx-key": "off", + "tailwindcss/no-custom-classname": "off", + "tailwindcss/classnames-order": "error" + }, } From b42c04924e57712978cde43e71a654b12aa166d2 Mon Sep 17 00:00:00 2001 From: Ridwan Abiola Date: Mon, 4 Sep 2023 14:27:17 +0100 Subject: [PATCH 14/14] Update .eslintrc.json --- .eslintrc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index f7daa01..db220b5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -4,5 +4,5 @@ "react/jsx-key": "off", "tailwindcss/no-custom-classname": "off", "tailwindcss/classnames-order": "error" - }, + } }