From adf75adc6ecd4e75e96fe2e9988ef99ab799158b Mon Sep 17 00:00:00 2001 From: Kath Date: Sun, 28 Jul 2024 12:03:56 +0800 Subject: [PATCH] feat(eslint) --- .github/workflows/ci-cd.yml | 23 + .gitignore | 3 +- .npmignore | 1 + eslint.config.js | 67 + package.json | 17 +- pnpm-lock.yaml | 1110 +++++++++++++++++ src/Client.ts | 9 +- src/Errors.ts | 1 + src/Private/defaultCache.ts | 4 +- src/Private/updater.ts | 6 +- src/index.ts | 1 + src/structures/Guild/Guild.ts | 1 + src/structures/Guild/GuildMember.ts | 2 +- src/structures/MiniGames/BedWars.ts | 2 +- src/structures/Player.ts | 4 +- src/structures/PlayerCosmetics.ts | 91 +- .../SkyBlock/Auctions/AuctionInfo.ts | 1 + src/structures/SkyBlock/SkyblockMember.ts | 3 +- src/structures/Static/Achievement.ts | 2 +- src/typings/index.d.ts | 33 +- src/utils/Player.ts | 2 +- src/utils/SkyblockUtils.ts | 10 +- tsconfig.json | 3 +- 23 files changed, 1291 insertions(+), 105 deletions(-) create mode 100644 eslint.config.js diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index e2982c37..ea5be543 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -53,3 +53,26 @@ jobs: - name: Check prettier run: pnpm prettier:check + + eslint: + name: check linting (eslint) + needs: [pnpm] + runs-on: ubuntu-latest + steps: + - name: Git checkout + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v2 + + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'pnpm' + + - name: Install node dependencies + run: pnpm i + + - name: Check eslint + run: pnpm lint:check diff --git a/.gitignore b/.gitignore index 4ff805cc..d984d2dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules/ oldreborn/ .env -build/ \ No newline at end of file +build/ +.eslintcache \ No newline at end of file diff --git a/.npmignore b/.npmignore index b24f01f5..6b2a33ee 100644 --- a/.npmignore +++ b/.npmignore @@ -2,3 +2,4 @@ node_modules/ .git oldreborn/ .github/ +.eslintcache \ No newline at end of file diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000..4057b864 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,67 @@ +import prettier from 'eslint-config-prettier'; +import ts from 'typescript-eslint'; +import globals from 'globals'; + +export default [ + ...ts.configs.recommended, + prettier, + { + ignores: ['**/node_modules/', '**/build/', '**/pnpm-lock.yaml'], + languageOptions: { + ecmaVersion: 2022, + sourceType: 'module', + globals: { + ...globals.es2022, + ...globals.node + } + }, + rules: { + 'max-len': ['error', { code: 120, ignoreUrls: true, ignoreComments: true }], + '@typescript-eslint/no-unused-vars': ['error', { args: 'none' }], + 'no-constant-condition': ['error', { checkLoops: false }], + 'prefer-const': ['warn', { destructuring: 'all' }], + curly: ['warn', 'multi-line', 'consistent'], + '@typescript-eslint/no-explicit-any': 'off', + 'logical-assignment-operators': 'warn', + 'no-template-curly-in-string': 'error', + 'quote-props': ['error', 'as-needed'], + 'comma-dangle': ['error', 'never'], + 'no-useless-constructor': 'error', + 'no-useless-assignment': 'error', + 'no-inner-declarations': 'error', + 'no-implicit-coercion': 'error', + 'no-use-before-define': 'warn', + 'no-underscore-dangle': 'warn', + 'no-unneeded-ternary': 'error', + 'default-param-last': 'error', + 'one-var': ['warn', 'never'], + 'no-inline-comments': 'warn', + 'no-empty-function': 'error', + 'no-useless-return': 'error', + 'no-useless-rename': 'warn', + 'no-useless-concat': 'warn', + 'no-throw-literal': 'error', + 'no-extend-native': 'error', + 'default-case-last': 'warn', + 'no-self-compare': 'error', + 'no-new-wrappers': 'error', + 'no-lone-blocks': 'error', + 'no-undef-init': 'error', + 'no-else-return': 'warn', + 'no-extra-semi': 'error', + 'require-await': 'warn', + yoda: ['error', 'always'], + 'default-case': 'error', + 'dot-notation': 'error', + 'no-sequences': 'warn', + 'no-multi-str': 'warn', + 'no-lonely-if': 'warn', + 'no-new-func': 'error', + 'no-console': 'error', + camelcase: 'warn', + 'no-var': 'warn', + eqeqeq: 'warn', + semi: 'error' + } + } +]; diff --git a/package.json b/package.json index 8a88f8e0..ed389c01 100644 --- a/package.json +++ b/package.json @@ -16,10 +16,10 @@ "url": "https://github.com/Hypixel-API-Reborn/hypixel-api-reborn/issues" }, "scripts": { - "lint": "npx eslint --cache src/", - "lint:fix": "npx eslint --cache src/ --fix", - "prettier": "npx prettier --cache --write src/", - "prettier:check": "npx prettier --cache --check src/" + "lint:check": "npx eslint --cache src/", + "lint": "npx eslint --cache src/ --fix", + "prettier:check": "npx prettier --cache --check src/", + "prettier": "npx prettier --cache --write src/" }, "engines": { "node": ">=20.16.0", @@ -28,6 +28,7 @@ "yarn": "forbidden, use pnpm instead", "bun": "forbidden, use pnpm instead" }, + "type": "module", "packageManager": "pnpm@9.6.0", "author": "Kathund", "dependencies": { @@ -43,8 +44,14 @@ }, "publisher": "Kathund", "devDependencies": { + "@eslint/js": "^9.8.0", + "@types/eslint": "^9.6.0", "@types/node": "^20.14.12", + "eslint": "^9.8.0", + "eslint-config-prettier": "^9.1.0", + "globals": "^15.8.0", "prettier": "^3.3.3", - "typescript": "^5.5.4" + "typescript": "^5.5.4", + "typescript-eslint": "^7.17.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e3a37dc8..de5c5cd5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,25 +20,209 @@ importers: specifier: ^1.21.0 version: 1.21.0 devDependencies: + '@eslint/js': + specifier: ^9.8.0 + version: 9.8.0 + '@types/eslint': + specifier: ^9.6.0 + version: 9.6.0 '@types/node': specifier: ^20.14.12 version: 20.14.12 + eslint: + specifier: ^9.8.0 + version: 9.8.0 + eslint-config-prettier: + specifier: ^9.1.0 + version: 9.1.0(eslint@9.8.0) + globals: + specifier: ^15.8.0 + version: 15.8.0 prettier: specifier: ^3.3.3 version: 3.3.3 typescript: specifier: ^5.5.4 version: 5.5.4 + typescript-eslint: + specifier: ^7.17.0 + version: 7.17.0(eslint@9.8.0)(typescript@5.5.4) packages: + '@eslint-community/eslint-utils@4.4.0': + resolution: + { integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + + '@eslint-community/regexpp@4.11.0': + resolution: + { integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A== } + engines: { node: ^12.0.0 || ^14.0.0 || >=16.0.0 } + + '@eslint/config-array@0.17.1': + resolution: + { integrity: sha512-BlYOpej8AQ8Ev9xVqroV7a02JK3SkBAaN9GfMMH9W6Ch8FlQlkjGw4Ir7+FgYwfirivAf4t+GtzuAxqfukmISA== } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + + '@eslint/eslintrc@3.1.0': + resolution: + { integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ== } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + + '@eslint/js@9.8.0': + resolution: + { integrity: sha512-MfluB7EUfxXtv3i/++oh89uzAr4PDI4nn201hsp+qaXqsjAWzinlZEHEfPgAX4doIlKvPG/i0A9dpKxOLII8yA== } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + + '@eslint/object-schema@2.1.4': + resolution: + { integrity: sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ== } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + + '@humanwhocodes/module-importer@1.0.1': + resolution: + { integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== } + engines: { node: '>=12.22' } + + '@humanwhocodes/retry@0.3.0': + resolution: + { integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew== } + engines: { node: '>=18.18' } + + '@nodelib/fs.scandir@2.1.5': + resolution: + { integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== } + engines: { node: '>= 8' } + + '@nodelib/fs.stat@2.0.5': + resolution: + { integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== } + engines: { node: '>= 8' } + + '@nodelib/fs.walk@1.2.8': + resolution: + { integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== } + engines: { node: '>= 8' } + + '@types/eslint@9.6.0': + resolution: + { integrity: sha512-gi6WQJ7cHRgZxtkQEoyHMppPjq9Kxo5Tjn2prSKDSmZrCz8TZ3jSRCeTJm+WoM+oB0WG37bRqLzaaU3q7JypGg== } + + '@types/estree@1.0.5': + resolution: + { integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== } + + '@types/json-schema@7.0.15': + resolution: + { integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== } + '@types/node@20.14.12': resolution: { integrity: sha512-r7wNXakLeSsGT0H1AU863vS2wa5wBOK4bWMjZz2wj+8nBx+m5PeIn0k8AloSLpRuiwdRQZwarZqHE4FNArPuJQ== } + '@typescript-eslint/eslint-plugin@7.17.0': + resolution: + { integrity: sha512-pyiDhEuLM3PuANxH7uNYan1AaFs5XE0zw1hq69JBvGvE7gSuEoQl1ydtEe/XQeoC3GQxLXyOVa5kNOATgM638A== } + engines: { node: ^18.18.0 || >=20.0.0 } + peerDependencies: + '@typescript-eslint/parser': ^7.0.0 + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/parser@7.17.0': + resolution: + { integrity: sha512-puiYfGeg5Ydop8eusb/Hy1k7QmOU6X3nvsqCgzrB2K4qMavK//21+PzNE8qeECgNOIoertJPUC1SpegHDI515A== } + engines: { node: ^18.18.0 || >=20.0.0 } + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/scope-manager@7.17.0': + resolution: + { integrity: sha512-0P2jTTqyxWp9HiKLu/Vemr2Rg1Xb5B7uHItdVZ6iAenXmPo4SZ86yOPCJwMqpCyaMiEHTNqizHfsbmCFT1x9SA== } + engines: { node: ^18.18.0 || >=20.0.0 } + + '@typescript-eslint/type-utils@7.17.0': + resolution: + { integrity: sha512-XD3aaBt+orgkM/7Cei0XNEm1vwUxQ958AOLALzPlbPqb8C1G8PZK85tND7Jpe69Wualri81PLU+Zc48GVKIMMA== } + engines: { node: ^18.18.0 || >=20.0.0 } + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/types@7.17.0': + resolution: + { integrity: sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A== } + engines: { node: ^18.18.0 || >=20.0.0 } + + '@typescript-eslint/typescript-estree@7.17.0': + resolution: + { integrity: sha512-72I3TGq93t2GoSBWI093wmKo0n6/b7O4j9o8U+f65TVD0FS6bI2180X5eGEr8MA8PhKMvYe9myZJquUT2JkCZw== } + engines: { node: ^18.18.0 || >=20.0.0 } + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/utils@7.17.0': + resolution: + { integrity: sha512-r+JFlm5NdB+JXc7aWWZ3fKSm1gn0pkswEwIYsrGPdsT2GjsRATAKXiNtp3vgAAO1xZhX8alIOEQnNMl3kbTgJw== } + engines: { node: ^18.18.0 || >=20.0.0 } + peerDependencies: + eslint: ^8.56.0 + + '@typescript-eslint/visitor-keys@7.17.0': + resolution: + { integrity: sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A== } + engines: { node: ^18.18.0 || >=20.0.0 } + + acorn-jsx@5.3.2: + resolution: + { integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== } + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + + acorn@8.12.1: + resolution: + { integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== } + engines: { node: '>=0.4.0' } + hasBin: true + ajv@6.12.6: resolution: { integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== } + ansi-regex@5.0.1: + resolution: + { integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== } + engines: { node: '>=8' } + + ansi-styles@4.3.0: + resolution: + { integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== } + engines: { node: '>=8' } + + argparse@2.0.1: + resolution: + { integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== } + + array-union@2.1.0: + resolution: + { integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== } + engines: { node: '>=8' } + asynckit@0.4.0: resolution: { integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== } @@ -47,29 +231,188 @@ packages: resolution: { integrity: sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw== } + balanced-match@1.0.2: + resolution: + { integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== } + + brace-expansion@1.1.11: + resolution: + { integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== } + + brace-expansion@2.0.1: + resolution: + { integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== } + + braces@3.0.3: + resolution: + { integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== } + engines: { node: '>=8' } + + callsites@3.1.0: + resolution: + { integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== } + engines: { node: '>=6' } + + chalk@4.1.2: + resolution: + { integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== } + engines: { node: '>=10' } + clone@2.1.2: resolution: { integrity: sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w== } engines: { node: '>=0.8' } + color-convert@2.0.1: + resolution: + { integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== } + engines: { node: '>=7.0.0' } + + color-name@1.1.4: + resolution: + { integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== } + combined-stream@1.0.8: resolution: { integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== } engines: { node: '>= 0.8' } + concat-map@0.0.1: + resolution: + { integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== } + + cross-spawn@7.0.3: + resolution: + { integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== } + engines: { node: '>= 8' } + + debug@4.3.6: + resolution: + { integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg== } + engines: { node: '>=6.0' } + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + deep-is@0.1.4: + resolution: + { integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== } + delayed-stream@1.0.0: resolution: { integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== } engines: { node: '>=0.4.0' } + dir-glob@3.0.1: + resolution: + { integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== } + engines: { node: '>=8' } + + escape-string-regexp@4.0.0: + resolution: + { integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== } + engines: { node: '>=10' } + + eslint-config-prettier@9.1.0: + resolution: + { integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw== } + hasBin: true + peerDependencies: + eslint: '>=7.0.0' + + eslint-scope@8.0.2: + resolution: + { integrity: sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA== } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + + eslint-visitor-keys@3.4.3: + resolution: + { integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + + eslint-visitor-keys@4.0.0: + resolution: + { integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw== } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + + eslint@9.8.0: + resolution: + { integrity: sha512-K8qnZ/QJzT2dLKdZJVX6W4XOwBzutMYmt0lqUS+JdXgd+HTYFlonFgkJ8s44d/zMPPCnOOk0kMWCApCPhiOy9A== } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + hasBin: true + + espree@10.1.0: + resolution: + { integrity: sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA== } + engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + + esquery@1.6.0: + resolution: + { integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg== } + engines: { node: '>=0.10' } + + esrecurse@4.3.0: + resolution: + { integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== } + engines: { node: '>=4.0' } + + estraverse@5.3.0: + resolution: + { integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== } + engines: { node: '>=4.0' } + + esutils@2.0.3: + resolution: + { integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== } + engines: { node: '>=0.10.0' } + fast-deep-equal@3.1.3: resolution: { integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== } + fast-glob@3.3.2: + resolution: + { integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== } + engines: { node: '>=8.6.0' } + fast-json-stable-stringify@2.1.0: resolution: { integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== } + fast-levenshtein@2.0.6: + resolution: + { integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== } + + fastq@1.17.1: + resolution: + { integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w== } + + file-entry-cache@8.0.0: + resolution: + { integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ== } + engines: { node: '>=16.0.0' } + + fill-range@7.1.1: + resolution: + { integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== } + engines: { node: '>=8' } + + find-up@5.0.0: + resolution: + { integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== } + engines: { node: '>=10' } + + flat-cache@4.0.1: + resolution: + { integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw== } + engines: { node: '>=16' } + + flatted@3.3.1: + resolution: + { integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw== } + follow-redirects@1.15.6: resolution: { integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== } @@ -85,22 +428,136 @@ packages: { integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== } engines: { node: '>= 6' } + glob-parent@5.1.2: + resolution: + { integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== } + engines: { node: '>= 6' } + + glob-parent@6.0.2: + resolution: + { integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== } + engines: { node: '>=10.13.0' } + + globals@14.0.0: + resolution: + { integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ== } + engines: { node: '>=18' } + + globals@15.8.0: + resolution: + { integrity: sha512-VZAJ4cewHTExBWDHR6yptdIBlx9YSSZuwojj9Nt5mBRXQzrKakDsVKQ1J63sklLvzAJm0X5+RpO4i3Y2hcOnFw== } + engines: { node: '>=18' } + + globby@11.1.0: + resolution: + { integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== } + engines: { node: '>=10' } + + graphemer@1.4.0: + resolution: + { integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== } + + has-flag@4.0.0: + resolution: + { integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== } + engines: { node: '>=8' } + + ignore@5.3.1: + resolution: + { integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw== } + engines: { node: '>= 4' } + + import-fresh@3.3.0: + resolution: + { integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== } + engines: { node: '>=6' } + + imurmurhash@0.1.4: + resolution: + { integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== } + engines: { node: '>=0.8.19' } + inherits@2.0.4: resolution: { integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== } + is-extglob@2.1.1: + resolution: + { integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== } + engines: { node: '>=0.10.0' } + + is-glob@4.0.3: + resolution: + { integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== } + engines: { node: '>=0.10.0' } + + is-number@7.0.0: + resolution: + { integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== } + engines: { node: '>=0.12.0' } + + is-path-inside@3.0.3: + resolution: + { integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== } + engines: { node: '>=8' } + + isexe@2.0.0: + resolution: + { integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== } + + js-yaml@4.1.0: + resolution: + { integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== } + hasBin: true + + json-buffer@3.0.1: + resolution: + { integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== } + json-schema-traverse@0.4.1: resolution: { integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== } + json-stable-stringify-without-jsonify@1.0.1: + resolution: + { integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== } + + keyv@4.5.4: + resolution: + { integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== } + + levn@0.4.1: + resolution: + { integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== } + engines: { node: '>= 0.8.0' } + + locate-path@6.0.0: + resolution: + { integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== } + engines: { node: '>=10' } + lodash.get@4.4.2: resolution: { integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ== } + lodash.merge@4.6.2: + resolution: + { integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== } + lodash.reduce@4.6.0: resolution: { integrity: sha512-6raRe2vxCYBhpBu+B+TtNGUzah+hQjVdu3E17wfusjyrXBka2nBS8OH/gjVZ5PvHOhWmIZTYri09Z6n/QfnNMw== } + merge2@1.4.1: + resolution: + { integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== } + engines: { node: '>= 8' } + + micromatch@4.0.7: + resolution: + { integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q== } + engines: { node: '>=8.6' } + mime-db@1.52.0: resolution: { integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== } @@ -111,11 +568,73 @@ packages: { integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== } engines: { node: '>= 0.6' } + minimatch@3.1.2: + resolution: + { integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== } + + minimatch@9.0.5: + resolution: + { integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== } + engines: { node: '>=16 || 14 >=14.17' } + + ms@2.1.2: + resolution: + { integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== } + + natural-compare@1.4.0: + resolution: + { integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== } + node-cache@5.1.2: resolution: { integrity: sha512-t1QzWwnk4sjLWaQAS8CHgOJ+RAfmHpxFWmc36IWTiWHQfs0w5JDMBS1b1ZxQteo0vVVuWJvIUKHDkkeK7vIGCg== } engines: { node: '>= 8.0.0' } + optionator@0.9.4: + resolution: + { integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g== } + engines: { node: '>= 0.8.0' } + + p-limit@3.1.0: + resolution: + { integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== } + engines: { node: '>=10' } + + p-locate@5.0.0: + resolution: + { integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== } + engines: { node: '>=10' } + + parent-module@1.0.1: + resolution: + { integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== } + engines: { node: '>=6' } + + path-exists@4.0.0: + resolution: + { integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== } + engines: { node: '>=8' } + + path-key@3.1.1: + resolution: + { integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== } + engines: { node: '>=8' } + + path-type@4.0.0: + resolution: + { integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== } + engines: { node: '>=8' } + + picomatch@2.3.1: + resolution: + { integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== } + engines: { node: '>=8.6' } + + prelude-ls@1.2.1: + resolution: + { integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== } + engines: { node: '>= 0.8.0' } + prettier@3.3.3: resolution: { integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew== } @@ -145,23 +664,109 @@ packages: { integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== } engines: { node: '>=6' } + queue-microtask@1.2.3: + resolution: + { integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== } + readable-stream@3.6.2: resolution: { integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== } engines: { node: '>= 6' } + resolve-from@4.0.0: + resolution: + { integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== } + engines: { node: '>=4' } + + reusify@1.0.4: + resolution: + { integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== } + engines: { iojs: '>=1.0.0', node: '>=0.10.0' } + + run-parallel@1.2.0: + resolution: + { integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== } + safe-buffer@5.2.1: resolution: { integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== } + semver@7.6.3: + resolution: + { integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== } + engines: { node: '>=10' } + hasBin: true + + shebang-command@2.0.0: + resolution: + { integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== } + engines: { node: '>=8' } + + shebang-regex@3.0.0: + resolution: + { integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== } + engines: { node: '>=8' } + skyhelper-networth@1.21.0: resolution: { integrity: sha512-AB7Jz1zZYOaoVZ6s95fjjXZOCglWT9y7U8SXFintm+Ln0FmXAr33y4BHqhGj7DFJzpiywybH5ga2Q0NQyZZOVA== } + slash@3.0.0: + resolution: + { integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== } + engines: { node: '>=8' } + string_decoder@1.3.0: resolution: { integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== } + strip-ansi@6.0.1: + resolution: + { integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== } + engines: { node: '>=8' } + + strip-json-comments@3.1.1: + resolution: + { integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== } + engines: { node: '>=8' } + + supports-color@7.2.0: + resolution: + { integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== } + engines: { node: '>=8' } + + text-table@0.2.0: + resolution: + { integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== } + + to-regex-range@5.0.1: + resolution: + { integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== } + engines: { node: '>=8.0' } + + ts-api-utils@1.3.0: + resolution: + { integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ== } + engines: { node: '>=16' } + peerDependencies: + typescript: '>=4.2.0' + + type-check@0.4.0: + resolution: + { integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== } + engines: { node: '>= 0.8.0' } + + typescript-eslint@7.17.0: + resolution: + { integrity: sha512-spQxsQvPguduCUfyUvLItvKqK3l8KJ/kqs5Pb/URtzQ5AC53Z6us32St37rpmlt2uESG23lOFpV4UErrmy4dZQ== } + engines: { node: ^18.18.0 || >=20.0.0 } + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + typescript@5.5.4: resolution: { integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q== } @@ -180,11 +785,172 @@ packages: resolution: { integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== } + which@2.0.2: + resolution: + { integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== } + engines: { node: '>= 8' } + hasBin: true + + word-wrap@1.2.5: + resolution: + { integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== } + engines: { node: '>=0.10.0' } + + yocto-queue@0.1.0: + resolution: + { integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== } + engines: { node: '>=10' } + snapshots: + '@eslint-community/eslint-utils@4.4.0(eslint@9.8.0)': + dependencies: + eslint: 9.8.0 + eslint-visitor-keys: 3.4.3 + + '@eslint-community/regexpp@4.11.0': {} + + '@eslint/config-array@0.17.1': + dependencies: + '@eslint/object-schema': 2.1.4 + debug: 4.3.6 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + + '@eslint/eslintrc@3.1.0': + dependencies: + ajv: 6.12.6 + debug: 4.3.6 + espree: 10.1.0 + globals: 14.0.0 + ignore: 5.3.1 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + + '@eslint/js@9.8.0': {} + + '@eslint/object-schema@2.1.4': {} + + '@humanwhocodes/module-importer@1.0.1': {} + + '@humanwhocodes/retry@0.3.0': {} + + '@nodelib/fs.scandir@2.1.5': + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + + '@nodelib/fs.stat@2.0.5': {} + + '@nodelib/fs.walk@1.2.8': + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.17.1 + + '@types/eslint@9.6.0': + dependencies: + '@types/estree': 1.0.5 + '@types/json-schema': 7.0.15 + + '@types/estree@1.0.5': {} + + '@types/json-schema@7.0.15': {} + '@types/node@20.14.12': dependencies: undici-types: 5.26.5 + '@typescript-eslint/eslint-plugin@7.17.0(@typescript-eslint/parser@7.17.0(eslint@9.8.0)(typescript@5.5.4))(eslint@9.8.0)(typescript@5.5.4)': + dependencies: + '@eslint-community/regexpp': 4.11.0 + '@typescript-eslint/parser': 7.17.0(eslint@9.8.0)(typescript@5.5.4) + '@typescript-eslint/scope-manager': 7.17.0 + '@typescript-eslint/type-utils': 7.17.0(eslint@9.8.0)(typescript@5.5.4) + '@typescript-eslint/utils': 7.17.0(eslint@9.8.0)(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 7.17.0 + eslint: 9.8.0 + graphemer: 1.4.0 + ignore: 5.3.1 + natural-compare: 1.4.0 + ts-api-utils: 1.3.0(typescript@5.5.4) + optionalDependencies: + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/parser@7.17.0(eslint@9.8.0)(typescript@5.5.4)': + dependencies: + '@typescript-eslint/scope-manager': 7.17.0 + '@typescript-eslint/types': 7.17.0 + '@typescript-eslint/typescript-estree': 7.17.0(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 7.17.0 + debug: 4.3.6 + eslint: 9.8.0 + optionalDependencies: + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/scope-manager@7.17.0': + dependencies: + '@typescript-eslint/types': 7.17.0 + '@typescript-eslint/visitor-keys': 7.17.0 + + '@typescript-eslint/type-utils@7.17.0(eslint@9.8.0)(typescript@5.5.4)': + dependencies: + '@typescript-eslint/typescript-estree': 7.17.0(typescript@5.5.4) + '@typescript-eslint/utils': 7.17.0(eslint@9.8.0)(typescript@5.5.4) + debug: 4.3.6 + eslint: 9.8.0 + ts-api-utils: 1.3.0(typescript@5.5.4) + optionalDependencies: + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/types@7.17.0': {} + + '@typescript-eslint/typescript-estree@7.17.0(typescript@5.5.4)': + dependencies: + '@typescript-eslint/types': 7.17.0 + '@typescript-eslint/visitor-keys': 7.17.0 + debug: 4.3.6 + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.6.3 + ts-api-utils: 1.3.0(typescript@5.5.4) + optionalDependencies: + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/utils@7.17.0(eslint@9.8.0)(typescript@5.5.4)': + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.8.0) + '@typescript-eslint/scope-manager': 7.17.0 + '@typescript-eslint/types': 7.17.0 + '@typescript-eslint/typescript-estree': 7.17.0(typescript@5.5.4) + eslint: 9.8.0 + transitivePeerDependencies: + - supports-color + - typescript + + '@typescript-eslint/visitor-keys@7.17.0': + dependencies: + '@typescript-eslint/types': 7.17.0 + eslint-visitor-keys: 3.4.3 + + acorn-jsx@5.3.2(acorn@8.12.1): + dependencies: + acorn: 8.12.1 + + acorn@8.12.1: {} + ajv@6.12.6: dependencies: fast-deep-equal: 3.1.3 @@ -192,6 +958,16 @@ snapshots: json-schema-traverse: 0.4.1 uri-js: 4.4.1 + ansi-regex@5.0.1: {} + + ansi-styles@4.3.0: + dependencies: + color-convert: 2.0.1 + + argparse@2.0.1: {} + + array-union@2.1.0: {} + asynckit@0.4.0: {} axios@1.7.2: @@ -202,18 +978,170 @@ snapshots: transitivePeerDependencies: - debug + balanced-match@1.0.2: {} + + brace-expansion@1.1.11: + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + + brace-expansion@2.0.1: + dependencies: + balanced-match: 1.0.2 + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + callsites@3.1.0: {} + + chalk@4.1.2: + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + clone@2.1.2: {} + color-convert@2.0.1: + dependencies: + color-name: 1.1.4 + + color-name@1.1.4: {} + combined-stream@1.0.8: dependencies: delayed-stream: 1.0.0 + concat-map@0.0.1: {} + + cross-spawn@7.0.3: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + + debug@4.3.6: + dependencies: + ms: 2.1.2 + + deep-is@0.1.4: {} + delayed-stream@1.0.0: {} + dir-glob@3.0.1: + dependencies: + path-type: 4.0.0 + + escape-string-regexp@4.0.0: {} + + eslint-config-prettier@9.1.0(eslint@9.8.0): + dependencies: + eslint: 9.8.0 + + eslint-scope@8.0.2: + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + + eslint-visitor-keys@3.4.3: {} + + eslint-visitor-keys@4.0.0: {} + + eslint@9.8.0: + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.8.0) + '@eslint-community/regexpp': 4.11.0 + '@eslint/config-array': 0.17.1 + '@eslint/eslintrc': 3.1.0 + '@eslint/js': 9.8.0 + '@humanwhocodes/module-importer': 1.0.1 + '@humanwhocodes/retry': 0.3.0 + '@nodelib/fs.walk': 1.2.8 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.3 + debug: 4.3.6 + escape-string-regexp: 4.0.0 + eslint-scope: 8.0.2 + eslint-visitor-keys: 4.0.0 + espree: 10.1.0 + esquery: 1.6.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 8.0.0 + find-up: 5.0.0 + glob-parent: 6.0.2 + ignore: 5.3.1 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.4 + strip-ansi: 6.0.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + + espree@10.1.0: + dependencies: + acorn: 8.12.1 + acorn-jsx: 5.3.2(acorn@8.12.1) + eslint-visitor-keys: 4.0.0 + + esquery@1.6.0: + dependencies: + estraverse: 5.3.0 + + esrecurse@4.3.0: + dependencies: + estraverse: 5.3.0 + + estraverse@5.3.0: {} + + esutils@2.0.3: {} + fast-deep-equal@3.1.3: {} + fast-glob@3.3.2: + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.7 + fast-json-stable-stringify@2.1.0: {} + fast-levenshtein@2.0.6: {} + + fastq@1.17.1: + dependencies: + reusify: 1.0.4 + + file-entry-cache@8.0.0: + dependencies: + flat-cache: 4.0.1 + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + find-up@5.0.0: + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + + flat-cache@4.0.1: + dependencies: + flatted: 3.3.1 + keyv: 4.5.4 + + flatted@3.3.1: {} + follow-redirects@1.15.6: {} form-data@4.0.0: @@ -222,24 +1150,143 @@ snapshots: combined-stream: 1.0.8 mime-types: 2.1.35 + glob-parent@5.1.2: + dependencies: + is-glob: 4.0.3 + + glob-parent@6.0.2: + dependencies: + is-glob: 4.0.3 + + globals@14.0.0: {} + + globals@15.8.0: {} + + globby@11.1.0: + dependencies: + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.3.2 + ignore: 5.3.1 + merge2: 1.4.1 + slash: 3.0.0 + + graphemer@1.4.0: {} + + has-flag@4.0.0: {} + + ignore@5.3.1: {} + + import-fresh@3.3.0: + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + + imurmurhash@0.1.4: {} + inherits@2.0.4: {} + is-extglob@2.1.1: {} + + is-glob@4.0.3: + dependencies: + is-extglob: 2.1.1 + + is-number@7.0.0: {} + + is-path-inside@3.0.3: {} + + isexe@2.0.0: {} + + js-yaml@4.1.0: + dependencies: + argparse: 2.0.1 + + json-buffer@3.0.1: {} + json-schema-traverse@0.4.1: {} + json-stable-stringify-without-jsonify@1.0.1: {} + + keyv@4.5.4: + dependencies: + json-buffer: 3.0.1 + + levn@0.4.1: + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + + locate-path@6.0.0: + dependencies: + p-locate: 5.0.0 + lodash.get@4.4.2: {} + lodash.merge@4.6.2: {} + lodash.reduce@4.6.0: {} + merge2@1.4.1: {} + + micromatch@4.0.7: + dependencies: + braces: 3.0.3 + picomatch: 2.3.1 + mime-db@1.52.0: {} mime-types@2.1.35: dependencies: mime-db: 1.52.0 + minimatch@3.1.2: + dependencies: + brace-expansion: 1.1.11 + + minimatch@9.0.5: + dependencies: + brace-expansion: 2.0.1 + + ms@2.1.2: {} + + natural-compare@1.4.0: {} + node-cache@5.1.2: dependencies: clone: 2.1.2 + optionator@0.9.4: + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + word-wrap: 1.2.5 + + p-limit@3.1.0: + dependencies: + yocto-queue: 0.1.0 + + p-locate@5.0.0: + dependencies: + p-limit: 3.1.0 + + parent-module@1.0.1: + dependencies: + callsites: 3.1.0 + + path-exists@4.0.0: {} + + path-key@3.1.1: {} + + path-type@4.0.0: {} + + picomatch@2.3.1: {} + + prelude-ls@1.2.1: {} + prettier@3.3.3: {} prismarine-nbt@2.5.0: @@ -261,14 +1308,32 @@ snapshots: punycode@2.3.1: {} + queue-microtask@1.2.3: {} + readable-stream@3.6.2: dependencies: inherits: 2.0.4 string_decoder: 1.3.0 util-deprecate: 1.0.2 + resolve-from@4.0.0: {} + + reusify@1.0.4: {} + + run-parallel@1.2.0: + dependencies: + queue-microtask: 1.2.3 + safe-buffer@5.2.1: {} + semver@7.6.3: {} + + shebang-command@2.0.0: + dependencies: + shebang-regex: 3.0.0 + + shebang-regex@3.0.0: {} + skyhelper-networth@1.21.0: dependencies: axios: 1.7.2 @@ -276,10 +1341,47 @@ snapshots: transitivePeerDependencies: - debug + slash@3.0.0: {} + string_decoder@1.3.0: dependencies: safe-buffer: 5.2.1 + strip-ansi@6.0.1: + dependencies: + ansi-regex: 5.0.1 + + strip-json-comments@3.1.1: {} + + supports-color@7.2.0: + dependencies: + has-flag: 4.0.0 + + text-table@0.2.0: {} + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + ts-api-utils@1.3.0(typescript@5.5.4): + dependencies: + typescript: 5.5.4 + + type-check@0.4.0: + dependencies: + prelude-ls: 1.2.1 + + typescript-eslint@7.17.0(eslint@9.8.0)(typescript@5.5.4): + dependencies: + '@typescript-eslint/eslint-plugin': 7.17.0(@typescript-eslint/parser@7.17.0(eslint@9.8.0)(typescript@5.5.4))(eslint@9.8.0)(typescript@5.5.4) + '@typescript-eslint/parser': 7.17.0(eslint@9.8.0)(typescript@5.5.4) + '@typescript-eslint/utils': 7.17.0(eslint@9.8.0)(typescript@5.5.4) + eslint: 9.8.0 + optionalDependencies: + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + typescript@5.5.4: {} undici-types@5.26.5: {} @@ -289,3 +1391,11 @@ snapshots: punycode: 2.3.1 util-deprecate@1.0.2: {} + + which@2.0.2: + dependencies: + isexe: 2.0.0 + + word-wrap@1.2.5: {} + + yocto-queue@0.1.0: {} diff --git a/src/Client.ts b/src/Client.ts index 258c1ed4..449feb92 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -1,4 +1,5 @@ -import { CacheHandler, ClientOptions } from './typings/index'; +import { ClientOptions } from './typings/index'; +import Cache from '../Private/defaultCache'; import rateLimit from './Private/rateLimit'; import Requests from './Private/requests'; import updater from './Private/updater'; @@ -26,10 +27,11 @@ class Client extends EventEmitter { requests: any; key: string; options: ClientOptions; - cache: CacheHandler; + cache: Cache; constructor(key: string, options: ClientOptions) { super(); this.requests = new Requests(this, options.cacheHandler); + // eslint-disable-next-line no-console if (options && !options.silent) this.on('warn', console.warn); if (clients.find((x) => x.key === key)) { this.emit('warn', Errors.MULTIPLE_INSTANCES); @@ -43,6 +45,7 @@ class Client extends EventEmitter { const lastArg = args[args.length - 1]; return API[func].apply( { + // eslint-disable-next-line no-underscore-dangle _makeRequest: this._makeRequest.bind(this, validate.cacheSuboptions(lastArg) ? lastArg : {}), ...this }, @@ -53,6 +56,7 @@ class Client extends EventEmitter { if (this.options.checkForUpdates) { updater.checkForUpdates().catch(() => { + // eslint-disable-next-line no-console if (!this.options.silent) console.warn('[hypixel-api-reborn] Error whilst checking for updates!'); }); } @@ -76,6 +80,7 @@ class Client extends EventEmitter { ...options, headers: { ...options.headers, ...this.options.headers } }); + // eslint-disable-next-line no-underscore-dangle if (this.options.syncWithHeaders) rateLimit.sync(result._headers); return result; } diff --git a/src/Errors.ts b/src/Errors.ts index 570ab358..499d3a3d 100644 --- a/src/Errors.ts +++ b/src/Errors.ts @@ -1,3 +1,4 @@ +/* eslint-disable max-len */ export default { INVALID_API_KEY: '[hypixel-api-reborn] Invalid API Key! For help join our Discord Server https://discord.gg/NSEBNMM', NO_API_KEY: '[hypixel-api-reborn] No API Key specified! For help join our Discord Server https://discord.gg/NSEBNMM', diff --git a/src/Private/defaultCache.ts b/src/Private/defaultCache.ts index 20adee2f..f5ddf5a5 100644 --- a/src/Private/defaultCache.ts +++ b/src/Private/defaultCache.ts @@ -1,6 +1,4 @@ -import type { CacheHandler } from '../typings'; - -class Cache implements CacheHandler { +class Cache { storage: Map; constructor() { this.storage = new Map(); diff --git a/src/Private/updater.ts b/src/Private/updater.ts index 443e30c8..ff64d308 100644 --- a/src/Private/updater.ts +++ b/src/Private/updater.ts @@ -1,16 +1,18 @@ +import { version } from '../../package.json'; import { UpdateHandler } from '../typings'; import Errors from '../Errors'; import axios from 'axios'; class Updater implements UpdateHandler { async checkForUpdates() { - const version = require('../../package.json').version; const request = await axios.get('https://registry.npmjs.org/hypixel-api-reborn'); - if (request.status !== 200) return console.log(Errors.UPDATER_REQUEST_NOT_OK); + // eslint-disable-next-line no-console + if (200 !== request.status) return console.log(Errors.UPDATER_REQUEST_NOT_OK); const metadata = await request.data; const latest = metadata['dist-tags'].latest; const compare = this.compare(version, latest); if (-1 === compare) { + // eslint-disable-next-line no-console console.log( `New version of hypixel-api-reborn is available! Current version: ${version}, Latest version: ${latest}` ); diff --git a/src/index.ts b/src/index.ts index 9e1ff275..51fd9567 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ import Client from './Client'; import Errors from './Errors'; diff --git a/src/structures/Guild/Guild.ts b/src/structures/Guild/Guild.ts index adf2e1be..ecbb7190 100644 --- a/src/structures/Guild/Guild.ts +++ b/src/structures/Guild/Guild.ts @@ -29,6 +29,7 @@ class Guild { preferredGames: Game[]; constructor(data: Record, uuid?: string) { + // eslint-disable-next-line no-underscore-dangle this.id = data._id; this.name = data.name; this.description = data.description ?? ''; diff --git a/src/structures/Guild/GuildMember.ts b/src/structures/Guild/GuildMember.ts index a003bd85..6fa25438 100644 --- a/src/structures/Guild/GuildMember.ts +++ b/src/structures/Guild/GuildMember.ts @@ -7,7 +7,7 @@ class GuildMember { joinedAt: Date; questParticipation: number; rank: string; - mutedUntilTimestamp: Number | null; + mutedUntilTimestamp: number | null; mutedUntil: Date | null; expHistory: ExpHistory[]; weeklyExperience: any | null; diff --git a/src/structures/MiniGames/BedWars.ts b/src/structures/MiniGames/BedWars.ts index c5ab6e9a..a2a44ec9 100644 --- a/src/structures/MiniGames/BedWars.ts +++ b/src/structures/MiniGames/BedWars.ts @@ -260,7 +260,7 @@ class BedWars { threes: BedWarsModeStats; fours: BedWarsModeStats; '4v4': BedWarsModeStats; - dream: BedwarsDreamStats | {}; + dream: BedwarsDreamStats | object; castle: BedWarsModeStats; practice: BedWarsPracticeStats; slumberTickets: number; diff --git a/src/structures/Player.ts b/src/structures/Player.ts index 16b1c896..a761659f 100644 --- a/src/structures/Player.ts +++ b/src/structures/Player.ts @@ -98,8 +98,8 @@ class Player { this.giftBundlesReceived = data.giftingMeta ? data.giftingMeta.realBundlesReceived || 0 : null; this.giftsSent = data.giftingMeta ? data.giftingMeta.giftsGiven || 0 : null; this.isOnline = - this.lastLoginTimestamp !== null && - this.lastLogoutTimestamp !== null && + null !== this.lastLoginTimestamp && + null !== this.lastLogoutTimestamp && this.lastLoginTimestamp > this.lastLogoutTimestamp; this.lastDailyReward = data.lastAdsenseGenerateTime ? new Date(data.lastAdsenseGenerateTime) : null; this.lastDailyRewardTimestamp = data.lastAdsenseGenerateTime || null; diff --git a/src/structures/PlayerCosmetics.ts b/src/structures/PlayerCosmetics.ts index e093034a..135bee99 100644 --- a/src/structures/PlayerCosmetics.ts +++ b/src/structures/PlayerCosmetics.ts @@ -1,23 +1,25 @@ /* eslint-disable no-underscore-dangle */ -const { removeSnakeCaseString } = require('../utils/removeSnakeCase'); -const Pets = require('./Pets'); +import { removeSnakeCaseString } from '../utils/removeSnakeCase'; +import Pets from './Pets'; + /** * Player Cosmetics class */ class PlayerCosmetics { - /** - * @param {object} data data - */ + allCosmetics: string[]; + petManager: Pets | null; + _suits: any; + _hats: any; + _gadgets: any; + _morphs: any; + _cloaks: any; + _taunts: any; + _rankColors: any; + _particle: any; + _particlepacks: any; + _clickfx: any; constructor(data: Record) { - /** - * All cosmetics - * @type {string[]} - */ this.allCosmetics = data?.vanityMeta?.packages || undefined; - /** - * Pets - * @type {Pets|null} - */ this.petManager = this.allCosmetics ? new Pets( this.allCosmetics.filter((x) => x.startsWith('pet_')), @@ -25,11 +27,8 @@ class PlayerCosmetics { ) : null; } - /** - * Suits - * @type {string[]} - */ - get suits() { + + suits(): string[] { if (!this._suits) { this._suits = this.allCosmetics ? this.allCosmetics @@ -39,11 +38,8 @@ class PlayerCosmetics { } return this._suits; } - /** - * Hats - * @type {string[]} - */ - get hats() { + + hats(): string[] { if (!this._hats) { this._hats = this.allCosmetics ? this.allCosmetics @@ -53,11 +49,8 @@ class PlayerCosmetics { } return this._hats; } - /** - * Gadgets - * @type {string[]} - */ - get gadgets() { + + gadgets(): string[] { if (!this._gadgets) { this._gadgets = this.allCosmetics ? this.allCosmetics @@ -67,11 +60,8 @@ class PlayerCosmetics { } return this._gadgets; } - /** - * Morphs - * @type {string[]} - */ - get morphs() { + + morphs(): string[] { if (!this._morphs) { this._morphs = this.allCosmetics ? this.allCosmetics @@ -81,11 +71,8 @@ class PlayerCosmetics { } return this._morphs; } - /** - * Cloaks - * @type {string[]} - */ - get cloaks() { + + cloaks(): string[] { if (!this._cloaks) { this._cloaks = this.allCosmetics ? this.allCosmetics @@ -95,11 +82,8 @@ class PlayerCosmetics { } return this._cloaks; } - /** - * Taunts - * @type {string[]} - */ - get taunts() { + + taunts(): string[] { if (!this._taunts) { this._taunts = this.allCosmetics ? this.allCosmetics @@ -109,11 +93,8 @@ class PlayerCosmetics { } return this._taunts; } - /** - * rankColors - * @type {string[]} - */ - get rankColors() { + + rankColors(): string[] { if (!this._rankColors) { this._rankColors = this.allCosmetics ? this.allCosmetics @@ -123,11 +104,8 @@ class PlayerCosmetics { } return this._rankColors; } - /** - * Particle Packs - * @type {string[]} - */ - get particlePacks() { + + particlePacks(): string[] { if (!this._particle) { this._particle = this.allCosmetics ? this.allCosmetics @@ -137,11 +115,8 @@ class PlayerCosmetics { } return this._particlepacks; } - /** - * Click Effects - * @type {string[]} - */ - get clickEffects() { + + clickEffects(): string[] { if (!this._clickfx) { this._clickfx = this.allCosmetics ? this.allCosmetics diff --git a/src/structures/SkyBlock/Auctions/AuctionInfo.ts b/src/structures/SkyBlock/Auctions/AuctionInfo.ts index 0a9d8112..c6ae7135 100644 --- a/src/structures/SkyBlock/Auctions/AuctionInfo.ts +++ b/src/structures/SkyBlock/Auctions/AuctionInfo.ts @@ -15,6 +15,7 @@ class AuctionInfo { this.totalAuctions = parseInt(data.totalAuctions, 10) || 0; this.lastUpdatedTimestamp = data.lastUpdated; this.lastUpdatedAt = new Date(data.lastUpdated); + // eslint-disable-next-line no-underscore-dangle this.age = parseInt(data._headers.get('age'), 10) || 0; } diff --git a/src/structures/SkyBlock/SkyblockMember.ts b/src/structures/SkyBlock/SkyblockMember.ts index b010702d..5fdcfed7 100644 --- a/src/structures/SkyBlock/SkyblockMember.ts +++ b/src/structures/SkyBlock/SkyblockMember.ts @@ -186,13 +186,14 @@ class SkyblockMember { }; this.getEquipment = async () => { let equipment = data.m.inventory.equipment_contents; - if (!equipment) + if (!equipment) { return { gauntlet: null, belt: null, cloak: null, necklace: null }; + } try { equipment = await decode(equipment.data); diff --git a/src/structures/Static/Achievement.ts b/src/structures/Static/Achievement.ts index db46e048..793f36ec 100644 --- a/src/structures/Static/Achievement.ts +++ b/src/structures/Static/Achievement.ts @@ -1,7 +1,7 @@ import AchievementTier from './AchievementTier'; function collectAll(data: AchievementTier | null) { - if (data === null) { + if (null === data) { return { totalPoints: 0, totalAmount: 0 }; } const mTier = data.maxTier; diff --git a/src/typings/index.d.ts b/src/typings/index.d.ts index b8ea98f4..84b85274 100644 --- a/src/typings/index.d.ts +++ b/src/typings/index.d.ts @@ -1,11 +1,12 @@ -import PitInventoryItem from '../structures/MiniGames/PitInventoryItem'; import SkyblockInventoryItem from '../structures/SkyBlock/SkyblockInventoryItem'; +import PitInventoryItem from '../structures/MiniGames/PitInventoryItem'; +import Cache from '../Private/defaultCache'; export interface ClientOptions { cache?: boolean; hypixelCacheTime?: number; mojangCacheTime?: number; - cacheHandler?: CacheHandler; + cacheHandler?: Cache; rateLimit?: 'AUTO' | 'HARD' | 'NONE'; syncWithHeaders?: boolean; keyLimit?: number; @@ -16,16 +17,6 @@ export interface ClientOptions { useThirdPartyAPI?: boolean | string; } -export interface CacheHandler { - set(key: string, value: any): void; - get(key: string): any; - has(key: string): boolean; - delete(key: string): void; - keys(): string[]; - size(): number; - clear(): void; -} - export interface UpdateHandler { checkForUpdates(): void; compare(a: string, b: string): number; @@ -416,6 +407,10 @@ export interface BedWarsModeStats { WLRatio: number; finalKDRatio: number; } +export interface BedwarsDreamModeStats { + doubles: BedWarsModeStats; + fours: BedWarsModeStats; +} export interface BedwarsDreamStats { ultimate: BedwarsDreamModeStats; @@ -425,11 +420,6 @@ export interface BedwarsDreamStats { voidless: BedwarsDreamModeStats; } -export interface BedwarsDreamModeStats { - doubles: BedWarsModeStats; - fours: BedWarsModeStats; -} - export interface BedWarsPracticeAttempts { failed: number; successful: number; @@ -613,17 +603,16 @@ export type SkyblockRarity = | 'SPECIAL' | 'VERY_SPECIAL'; +export interface SkyblockGardenVisitorServed { + total: number; + unique: number; +} export interface SkyblockGardenVisitor { visited: Record; completed: Record; served: SkyblockGardenVisitorServed; } -export interface SkyblockGardenVisitorServed { - total: number; - unique: number; -} - export interface SkyblockGardenComposterUpgrades { speed: number; multiDrop: number; diff --git a/src/utils/Player.ts b/src/utils/Player.ts index 5b82ec41..2d7f5e1e 100644 --- a/src/utils/Player.ts +++ b/src/utils/Player.ts @@ -96,5 +96,5 @@ export function parseClaimedRewards(data: Record): number[] { .map((x) => x.match(/levelingReward_(\d+)/)) .filter((x) => x) .map((x) => (x ? parseInt(x[1], 10) : null)) - .filter((x) => x !== null); + .filter((x) => null !== x); } diff --git a/src/utils/SkyblockUtils.ts b/src/utils/SkyblockUtils.ts index 228d1eea..d5b327e0 100644 --- a/src/utils/SkyblockUtils.ts +++ b/src/utils/SkyblockUtils.ts @@ -1,3 +1,4 @@ +import { promisify } from 'util'; import { SkyblockMemberChocolateFactoryData, SkyblockMemberTrophyFishRank, @@ -14,9 +15,9 @@ import Constants from './Constants'; import nbt from 'prismarine-nbt'; export async function decode(base64: string | Buffer, isBuffer = false): Promise { - const parseNbt = require('util').promisify(nbt.parse); + const parseNbt = promisify(nbt.parse); const buffer = isBuffer ? base64 : Buffer.from(String(base64), 'base64'); - let data = await parseNbt(buffer); + let data = await parseNbt(buffer as Buffer); data = nbt.simplify(data); const newdata = []; for (let i = 0; i < data.i.length; i++) { @@ -76,7 +77,7 @@ export function getLevelByXp(xp: number, type: string): SkyblockSkillLevel { default: xpTable = Constants.levelingXp; } - let maxLevel = Math.max(...Object.keys(xpTable).map(Number)); + const maxLevel = Math.max(...Object.keys(xpTable).map(Number)); if (isNaN(xp)) { return { xp: 0, @@ -129,9 +130,11 @@ export function getSlayerLevel(slayer: Record): SkyblockMemberSlaye }; } + // eslint-disable-next-line camelcase const { claimed_levels } = slayer; let level = 0; + // eslint-disable-next-line camelcase for (const levelName in claimed_levels) { if (Object.prototype.hasOwnProperty.call(claimed_levels, levelName)) { const newLevel = parseInt(levelName.replace('_special', '').split('_').pop() ?? '', 10); @@ -258,7 +261,6 @@ export function getBestiaryLevel(userProfile: Record): number { return tiersUnlocked / 10; } catch (error) { - console.log(error); return 0; } } diff --git a/tsconfig.json b/tsconfig.json index 5886fe9f..3c0e09ad 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,9 @@ { "compilerOptions": { "forceConsistentCasingInFileNames": true, + "moduleResolution": "node", + "resolveJsonModule": true, "esModuleInterop": true, - "module": "CommonJS", "skipLibCheck": true, "outDir": "./build", "target": "ES2022",