diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6232ab2..46f0cea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,11 +11,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [18, 20] + node: [20, 22, 24] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - name: Cache node_modules - uses: actions/cache@v3 + uses: actions/cache@v5 env: cache-name: cache-node-modules with: @@ -26,7 +26,7 @@ jobs: ${{ runner.os }}-build- ${{ runner.os }}- - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node }} check-latest: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2d6d3e7..b55b8a4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,10 +8,10 @@ jobs: publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 with: - node-version: 18 + node-version: 20 check-latest: true registry-url: https://registry.npmjs.org/ - run: npm publish --access public diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bce1efc..deca056 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,11 +10,11 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - name: Use Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v6 with: - node-version: 18 + node-version: 20 check-latest: true registry-url: https://registry.npmjs.org/ - name: Install Dependencies diff --git a/.husky/pre-commit b/.husky/pre-commit index 20d0d06..a845b85 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -npm run lint +npm run lint \ No newline at end of file diff --git a/.nvmrc b/.nvmrc index 87ec884..54954dc 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18.18.2 +20.0.0 \ No newline at end of file diff --git a/package.json b/package.json index 3861048..675419b 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,9 @@ "build:ci": "npm i --include=dev && tsc", "docs": "typedoc", "prepublishOnly": "npm run build:ci", - "lint": "eslint src/**/*.ts", - "lint:ci": "eslint --output-file eslint_report.json --format json src/**/*.ts", - "prepare": "npx husky install" + "lint": "eslint", + "lint:ci": "eslint --output-file eslint_report.json --format json", + "prepare": "npx husky init" }, "repository": { "type": "git", @@ -25,26 +25,26 @@ }, "homepage": "https://topgg.js.org", "devDependencies": { - "@types/express": "^4.17.17", - "@types/jest": "^29.5.4", - "@types/node": "^20.5.9", - "@typescript-eslint/eslint-plugin": "^6.6.0", - "@typescript-eslint/parser": "^6.6.0", - "eslint": "^8.48.0", - "eslint-config-prettier": "^9.0.0", - "eslint-plugin-jest": "^27.2.3", - "express": "^4.18.2", - "husky": "^8.0.3", - "jest": "^29.6.4", - "lint-staged": "^14.0.1", - "prettier": "^3.0.3", - "ts-jest": "^29.1.1", - "typedoc": "^0.25.1", - "typescript": "^5.2.2" + "@types/express": "^5.0.6", + "@types/jest": "^30.0.0", + "@types/node": "^25.2.0", + "@typescript-eslint/eslint-plugin": "^8.54.0", + "@typescript-eslint/parser": "^8.54.0", + "eslint": "^9.39.2", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-jest": "^29.12.1", + "express": "^5.2.1", + "husky": "^9.1.7", + "jest": "^30.2.0", + "lint-staged": "^16.2.7", + "prettier": "^3.8.1", + "ts-jest": "^29.4.6", + "typedoc": "^0.28.16", + "typescript": "^5.9.3" }, "dependencies": { - "raw-body": "^2.5.2", - "undici": "^5.23.0" + "raw-body": "^3.0.2", + "undici": "^7.20.0" }, "types": "./dist/index.d.ts" } diff --git a/src/structs/Api.ts b/src/structs/Api.ts index 74aaf73..451dab2 100644 --- a/src/structs/Api.ts +++ b/src/structs/Api.ts @@ -49,6 +49,7 @@ export class Api extends EventEmitter { const tokenData = atob(tokenSegments[1]); try { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions JSON.parse(tokenData).id; } catch { throw new Error( diff --git a/src/structs/Webhook.ts b/src/structs/Webhook.ts index d257ce8..80e1ffa 100644 --- a/src/structs/Webhook.ts +++ b/src/structs/Webhook.ts @@ -80,7 +80,7 @@ export class Webhook { const parsed = JSON.parse(body.toString("utf8")); resolve(this._formatIncoming(parsed)); - } catch (err) { + } catch { res.status(400).json({ error: "Invalid body" }); resolve(false); }