diff --git a/.vscode/settings.json b/.vscode/settings.json index e20eccc6d..c55efcff8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,9 @@ { - "eslint.workingDirectories": [{ "pattern": "./packages/*" }] + "eslint.workingDirectories": [{ "pattern": "./packages/*" }], + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.fixAll": true, + "source.organizeImports": false + } } diff --git a/package.json b/package.json index 79bb639cf..7cd31bfe7 100644 --- a/package.json +++ b/package.json @@ -39,14 +39,14 @@ }, "homepage": "https://discord.js.org", "devDependencies": { - "@commitlint/cli": "^16.0.1", + "@commitlint/cli": "^16.0.2", "@commitlint/config-angular": "^16.0.0", "@favware/npm-deprecate": "^1.0.4", "conventional-changelog-cli": "^2.2.2", "husky": "^7.0.4", "lint-staged": "^12.1.7", "prettier": "^2.5.1", - "turbo": "^1.0.24" + "turbo": "1.0.24" }, "engines": { "node": ">=16.9.0" @@ -70,7 +70,9 @@ "dependsOn": [ "^build" ], - "outputs": [] + "outputs": [ + "coverage/**" + ] }, "lint": { "dependsOn": [ diff --git a/packages/builders/.eslintrc.json b/packages/builders/.eslintrc.json index cfff6f7db..0998f03ac 100644 --- a/packages/builders/.eslintrc.json +++ b/packages/builders/.eslintrc.json @@ -8,9 +8,5 @@ "ignorePatterns": ["**/dist/*"], "env": { "jest": true - }, - "rules": { - "no-redeclare": 0, - "@typescript-eslint/naming-convention": 0 } } diff --git a/packages/builders/.prettierignore b/packages/builders/.prettierignore index d5a8d0059..553e0ea6c 100644 --- a/packages/builders/.prettierignore +++ b/packages/builders/.prettierignore @@ -1,2 +1,8 @@ # Autogenerated CHANGELOG.md +.turbo +dist/ +docs/**/* +!docs/index.yml +!docs/README.md +coverage/ diff --git a/packages/builders/__tests__/interactions/SlashCommands/SlashCommands.test.ts b/packages/builders/__tests__/interactions/SlashCommands/SlashCommands.test.ts index 6f0d75a2e..0f522b024 100644 --- a/packages/builders/__tests__/interactions/SlashCommands/SlashCommands.test.ts +++ b/packages/builders/__tests__/interactions/SlashCommands/SlashCommands.test.ts @@ -178,14 +178,14 @@ describe('Slash Commands', () => { expect(() => getBuilder().addStringOption( // @ts-expect-error Checking if check works JS-side too - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call getStringOption().setAutocomplete(true).addChoice('Fancy Pants', 'fp_1'), ), ).toThrowError(); expect(() => getBuilder().addStringOption( - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call getStringOption() .setAutocomplete(true) // @ts-expect-error Checking if check works JS-side too @@ -200,7 +200,7 @@ describe('Slash Commands', () => { expect(() => getBuilder().addStringOption( // @ts-expect-error Checking if check works JS-side too - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call getStringOption().addChoice('Fancy Pants', 'fp_1').setAutocomplete(true), ), ).toThrowError(); @@ -384,6 +384,7 @@ describe('Slash Commands', () => { test('GIVEN builder with a subcommand that tries to add an invalid result THEN throw error', () => { expect(() => // @ts-expect-error Checking if check works JS-side too + // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call getNamedBuilder().addSubcommand(getSubcommand()).addInteger(getInteger()), ).toThrowError(); }); diff --git a/packages/builders/package.json b/packages/builders/package.json index f07b33bc3..fc9aee083 100644 --- a/packages/builders/package.json +++ b/packages/builders/package.json @@ -5,9 +5,8 @@ "scripts": { "build": "tsup", "test": "jest --pass-with-no-tests", - "lint": "eslint src --ext mjs,js,ts", - "lint:fix": "eslint src --ext mjs,js,ts --fix", - "format": "prettier --write .", + "lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts", + "format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix", "docs": "typedoc --json docs/typedoc-out.json src/index.ts && node scripts/docs.mjs", "prepublishOnly": "yarn build && yarn lint && yarn test", "changelog": "git cliff --prepend ./CHANGELOG.md -l -c ../../cliff.toml -r ../../ --include-path './*'" @@ -61,16 +60,16 @@ "devDependencies": { "@babel/core": "^7.16.5", "@babel/plugin-proposal-decorators": "^7.16.5", - "@babel/preset-env": "^7.16.5", + "@babel/preset-env": "^7.16.8", "@babel/preset-typescript": "^7.16.5", "@discordjs/ts-docgen": "^0.3.4", "@types/jest": "^27.0.3", "@types/node": "^16.11.6", - "@typescript-eslint/eslint-plugin": "^5.9.0", - "@typescript-eslint/parser": "^5.9.0", + "@typescript-eslint/eslint-plugin": "^5.9.1", + "@typescript-eslint/parser": "^5.9.1", "babel-plugin-transform-typescript-metadata": "^0.3.2", "eslint": "^8.5.0", - "eslint-config-marine": "^9.1.0", + "eslint-config-marine": "^9.3.2", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^4.0.0", "jest": "^27.4.7", diff --git a/packages/builders/src/interactions/contextMenuCommands/Assertions.ts b/packages/builders/src/interactions/contextMenuCommands/Assertions.ts index 5a22e2f36..f2f5e2e3d 100644 --- a/packages/builders/src/interactions/contextMenuCommands/Assertions.ts +++ b/packages/builders/src/interactions/contextMenuCommands/Assertions.ts @@ -2,6 +2,28 @@ import { z } from 'zod'; import { ApplicationCommandType } from 'discord-api-types/v9'; import type { ContextMenuCommandType } from './ContextMenuCommandBuilder'; +const namePredicate = z + .string() + .min(1) + .max(32) + .regex(/^( *[\p{L}\p{N}_-]+ *)+$/u); + +const typePredicate = z.union([z.literal(ApplicationCommandType.User), z.literal(ApplicationCommandType.Message)]); + +const booleanPredicate = z.boolean(); + +export function validateDefaultPermission(value: unknown): asserts value is boolean { + booleanPredicate.parse(value); +} + +export function validateName(name: unknown): asserts name is string { + namePredicate.parse(name); +} + +export function validateType(type: unknown): asserts type is ContextMenuCommandType { + typePredicate.parse(type); +} + export function validateRequiredParameters(name: string, type: number) { // Assert name matches all conditions validateName(name); @@ -9,25 +31,3 @@ export function validateRequiredParameters(name: string, type: number) { // Assert type is valid validateType(type); } - -const namePredicate = z - .string() - .min(1) - .max(32) - .regex(/^( *[\p{L}\p{N}_-]+ *)+$/u); - -export function validateName(name: unknown): asserts name is string { - namePredicate.parse(name); -} - -const typePredicate = z.union([z.literal(ApplicationCommandType.User), z.literal(ApplicationCommandType.Message)]); - -export function validateType(type: unknown): asserts type is ContextMenuCommandType { - typePredicate.parse(type); -} - -const booleanPredicate = z.boolean(); - -export function validateDefaultPermission(value: unknown): asserts value is boolean { - booleanPredicate.parse(value); -} diff --git a/packages/builders/src/interactions/slashCommands/Assertions.ts b/packages/builders/src/interactions/slashCommands/Assertions.ts index af00a214b..d409ad716 100644 --- a/packages/builders/src/interactions/slashCommands/Assertions.ts +++ b/packages/builders/src/interactions/slashCommands/Assertions.ts @@ -5,21 +5,6 @@ import type { ApplicationCommandOptionBase } from './mixins/ApplicationCommandOp import type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder'; import type { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands'; -export function validateRequiredParameters( - name: string, - description: string, - options: ToAPIApplicationCommandOptions[], -) { - // Assert name matches all conditions - validateName(name); - - // Assert description conditions - validateDescription(description); - - // Assert options conditions - validateMaxOptionsLength(options); -} - const namePredicate = z .string() .min(1) @@ -36,6 +21,27 @@ export function validateDescription(description: unknown): asserts description i descriptionPredicate.parse(description); } +const maxArrayLengthPredicate = z.unknown().array().max(25); + +export function validateMaxOptionsLength(options: unknown): asserts options is ToAPIApplicationCommandOptions[] { + maxArrayLengthPredicate.parse(options); +} + +export function validateRequiredParameters( + name: string, + description: string, + options: ToAPIApplicationCommandOptions[], +) { + // Assert name matches all conditions + validateName(name); + + // Assert description conditions + validateDescription(description); + + // Assert options conditions + validateMaxOptionsLength(options); +} + const booleanPredicate = z.boolean(); export function validateDefaultPermission(value: unknown): asserts value is boolean { @@ -46,12 +52,6 @@ export function validateRequired(required: unknown): asserts required is boolean booleanPredicate.parse(required); } -const maxArrayLengthPredicate = z.unknown().array().max(25); - -export function validateMaxOptionsLength(options: unknown): asserts options is ToAPIApplicationCommandOptions[] { - maxArrayLengthPredicate.parse(options); -} - export function validateMaxChoicesLength(choices: APIApplicationCommandOptionChoice[]) { maxArrayLengthPredicate.parse(choices); } diff --git a/packages/builders/src/interactions/slashCommands/SlashCommandBuilder.ts b/packages/builders/src/interactions/slashCommands/SlashCommandBuilder.ts index c9ddb2a94..c108c5889 100644 --- a/packages/builders/src/interactions/slashCommands/SlashCommandBuilder.ts +++ b/packages/builders/src/interactions/slashCommands/SlashCommandBuilder.ts @@ -133,5 +133,5 @@ export interface SlashCommandOptionsOnlyBuilder Pick {} export interface ToAPIApplicationCommandOptions { - toJSON(): APIApplicationCommandOption; + toJSON: () => APIApplicationCommandOption; } diff --git a/packages/builders/src/interactions/slashCommands/SlashCommandSubcommands.ts b/packages/builders/src/interactions/slashCommands/SlashCommandSubcommands.ts index 89034a8b8..c762f6857 100644 --- a/packages/builders/src/interactions/slashCommands/SlashCommandSubcommands.ts +++ b/packages/builders/src/interactions/slashCommands/SlashCommandSubcommands.ts @@ -48,8 +48,10 @@ export class SlashCommandSubcommandGroupBuilder implements ToAPIApplicationComma validateMaxOptionsLength(options); // Get the final result + // eslint-disable-next-line @typescript-eslint/no-use-before-define const result = typeof input === 'function' ? input(new SlashCommandSubcommandBuilder()) : input; + // eslint-disable-next-line @typescript-eslint/no-use-before-define assertReturnOfBuilder(result, SlashCommandSubcommandBuilder); // Push it diff --git a/packages/collection/.eslintrc.json b/packages/collection/.eslintrc.json index cfff6f7db..0998f03ac 100644 --- a/packages/collection/.eslintrc.json +++ b/packages/collection/.eslintrc.json @@ -8,9 +8,5 @@ "ignorePatterns": ["**/dist/*"], "env": { "jest": true - }, - "rules": { - "no-redeclare": 0, - "@typescript-eslint/naming-convention": 0 } } diff --git a/packages/collection/.prettierignore b/packages/collection/.prettierignore index d5a8d0059..553e0ea6c 100644 --- a/packages/collection/.prettierignore +++ b/packages/collection/.prettierignore @@ -1,2 +1,8 @@ # Autogenerated CHANGELOG.md +.turbo +dist/ +docs/**/* +!docs/index.yml +!docs/README.md +coverage/ diff --git a/packages/collection/package.json b/packages/collection/package.json index bd7b89fea..976019afb 100644 --- a/packages/collection/package.json +++ b/packages/collection/package.json @@ -5,9 +5,8 @@ "scripts": { "test": "jest --pass-with-no-tests", "build": "tsup", - "lint": "eslint src --ext mjs,js,ts", - "lint:fix": "eslint src --ext mjs,js,ts --fix", - "format": "prettier --write .", + "lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts", + "format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix", "docs": "typedoc --json docs/typedoc-out.json src/index.ts && node scripts/docs.mjs", "prepublishOnly": "yarn build && yarn lint && yarn test", "changelog": "git cliff --prepend ./CHANGELOG.md -l -c ../../cliff.toml -r ../../ --include-path './*'" @@ -49,15 +48,15 @@ "homepage": "https://discord.js.org", "devDependencies": { "@babel/core": "^7.16.5", - "@babel/preset-env": "^7.16.5", + "@babel/preset-env": "^7.16.8", "@babel/preset-typescript": "^7.16.5", "@discordjs/ts-docgen": "^0.3.4", "@types/jest": "^27.0.3", "@types/node": "^16.11.6", - "@typescript-eslint/eslint-plugin": "^5.9.0", - "@typescript-eslint/parser": "^5.9.0", + "@typescript-eslint/eslint-plugin": "^5.9.1", + "@typescript-eslint/parser": "^5.9.1", "eslint": "^8.5.0", - "eslint-config-marine": "^9.1.0", + "eslint-config-marine": "^9.3.2", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^4.0.0", "jest": "^27.4.7", diff --git a/packages/collection/src/index.ts b/packages/collection/src/index.ts index ed266aebd..8fd02b2fb 100644 --- a/packages/collection/src/index.ts +++ b/packages/collection/src/index.ts @@ -73,10 +73,12 @@ export class Collection extends Map { public first(): V | undefined; public first(amount: number): V[]; public first(amount?: number): V | V[] | undefined { + // eslint-disable-next-line @typescript-eslint/no-unsafe-return if (typeof amount === 'undefined') return this.values().next().value; if (amount < 0) return this.last(amount * -1); amount = Math.min(this.size, amount); const iter = this.values(); + // eslint-disable-next-line @typescript-eslint/no-unsafe-return return Array.from({ length: amount }, (): V => iter.next().value); } @@ -91,10 +93,12 @@ export class Collection extends Map { public firstKey(): K | undefined; public firstKey(amount: number): K[]; public firstKey(amount?: number): K | K[] | undefined { + // eslint-disable-next-line @typescript-eslint/no-unsafe-return if (typeof amount === 'undefined') return this.keys().next().value; if (amount < 0) return this.lastKey(amount * -1); amount = Math.min(this.size, amount); const iter = this.keys(); + // eslint-disable-next-line @typescript-eslint/no-unsafe-return return Array.from({ length: amount }, (): K => iter.next().value); } @@ -398,6 +402,7 @@ export class Collection extends Map { if (typeof thisArg !== 'undefined') fn = fn.bind(thisArg); const iter = this.entries(); return Array.from({ length: this.size }, (): T => { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const [key, value] = iter.next().value; // eslint-disable-next-line @typescript-eslint/no-unsafe-argument return fn(value, key, this); diff --git a/packages/discord.js/.prettierignore b/packages/discord.js/.prettierignore index d5a8d0059..553e0ea6c 100644 --- a/packages/discord.js/.prettierignore +++ b/packages/discord.js/.prettierignore @@ -1,2 +1,8 @@ # Autogenerated CHANGELOG.md +.turbo +dist/ +docs/**/* +!docs/index.yml +!docs/README.md +coverage/ diff --git a/packages/discord.js/package.json b/packages/discord.js/package.json index 4c49278f3..2a794abce 100644 --- a/packages/discord.js/package.json +++ b/packages/discord.js/package.json @@ -3,12 +3,10 @@ "version": "14.0.0-dev", "description": "A powerful library for interacting with the Discord API", "scripts": { - "test": "yarn docs:test && yarn lint:typings && yarn test:typescript", + "test": "yarn docs:test && yarn test:typescript", "test:typescript": "tsc --noEmit && tsd", - "lint": "eslint ./src", - "lint:fix": "eslint ./src --fix", - "lint:typings": "tslint ./typings/index.d.ts", - "format": "prettier --write .", + "lint": "prettier --check . && eslint src && tslint typings/index.d.ts", + "format": "prettier --write . && eslint src --fix", "docs": "docgen --source ./src --custom ./docs/index.yml --output ./docs/docs.json", "docs:test": "docgen --source ./src --custom ./docs/index.yml", "prepublishOnly": "yarn lint && yarn test", diff --git a/packages/discord.js/test/sendtest.js b/packages/discord.js/test/sendtest.js index 621083eb9..089f3fd6a 100644 --- a/packages/discord.js/test/sendtest.js +++ b/packages/discord.js/test/sendtest.js @@ -1,11 +1,11 @@ 'use strict'; +const fetch = require('node-fetch'); const fs = require('node:fs'); const path = require('node:path'); const process = require('node:process'); const { setTimeout: sleep } = require('node:timers/promises'); const util = require('node:util'); -const fetch = require('node-fetch'); const { owner, token } = require('./auth.js'); const { Client, Intents, MessageAttachment, MessageEmbed } = require('../src'); diff --git a/packages/discord.js/test/webhooktest.js b/packages/discord.js/test/webhooktest.js index 55d09bd71..fe5ba5e04 100644 --- a/packages/discord.js/test/webhooktest.js +++ b/packages/discord.js/test/webhooktest.js @@ -1,10 +1,10 @@ 'use strict'; +const fetch = require('node-fetch'); const fs = require('node:fs'); const path = require('node:path'); const { setTimeout: sleep } = require('node:timers/promises'); const util = require('node:util'); -const fetch = require('node-fetch'); const { owner, token, webhookChannel, webhookToken } = require('./auth.js'); const { Client, Intents, MessageAttachment, MessageEmbed, WebhookClient } = require('../src'); diff --git a/packages/rest/.eslintrc.json b/packages/rest/.eslintrc.json index 4abbf4b08..809a8448b 100644 --- a/packages/rest/.eslintrc.json +++ b/packages/rest/.eslintrc.json @@ -7,9 +7,5 @@ "ignorePatterns": ["**/dist/*"], "env": { "jest": true - }, - "rules": { - "no-redeclare": 0, - "@typescript-eslint/naming-convention": 0 } } diff --git a/packages/rest/.prettierignore b/packages/rest/.prettierignore index d5a8d0059..553e0ea6c 100644 --- a/packages/rest/.prettierignore +++ b/packages/rest/.prettierignore @@ -1,2 +1,8 @@ # Autogenerated CHANGELOG.md +.turbo +dist/ +docs/**/* +!docs/index.yml +!docs/README.md +coverage/ diff --git a/packages/rest/__tests__/REST.test.ts b/packages/rest/__tests__/REST.test.ts index 756bd4f25..05bd36f5b 100644 --- a/packages/rest/__tests__/REST.test.ts +++ b/packages/rest/__tests__/REST.test.ts @@ -41,6 +41,7 @@ nock(`${DefaultRestOptions.api}/v${DefaultRestOptions.version}`) .post('/postFile') .times(5) .reply(200, (_, body) => ({ + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call body: body .replace(/\r\n/g, '\n') .replace(/-+\d+-*\n?/g, '') diff --git a/packages/rest/__tests__/RequestHandler.test.ts b/packages/rest/__tests__/RequestHandler.test.ts index 1a8bb47d0..268983603 100644 --- a/packages/rest/__tests__/RequestHandler.test.ts +++ b/packages/rest/__tests__/RequestHandler.test.ts @@ -21,12 +21,31 @@ const sublimitIntervals = { const sublimit = { body: { name: 'newname' } }; const noSublimit = { body: { bitrate: 40000 } }; +function startSublimitIntervals() { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (!sublimitIntervals.reset) { + sublimitResetAfter = Date.now() + 250; + sublimitIntervals.reset = setInterval(() => { + sublimitRequests = 0; + sublimitResetAfter = Date.now() + 250; + }, 250); + } + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (!sublimitIntervals.retry) { + retryAfter = Date.now() + 1000; + sublimitIntervals.retry = setInterval(() => { + sublimitHits = 0; + retryAfter = Date.now() + 1000; + }, 1000); + } +} + nock(`${DefaultRestOptions.api}/v${DefaultRestOptions.version}`) .persist() .replyDate() .get('/standard') .times(3) - .reply(function handler(): nock.ReplyFnResult { + .reply((): nock.ReplyFnResult => { const response = Date.now() >= resetAfter ? 204 : 429; resetAfter = Date.now() + 250; if (response === 204) { @@ -62,8 +81,8 @@ nock(`${DefaultRestOptions.api}/v${DefaultRestOptions.version}`) ]; }) .get('/triggerGlobal') - .reply(function handler(): nock.ReplyFnResult { - return [ + .reply( + (): nock.ReplyFnResult => [ 204, { global: true }, { @@ -71,12 +90,12 @@ nock(`${DefaultRestOptions.api}/v${DefaultRestOptions.version}`) 'retry-after': '1', via: '1.1 google', }, - ]; - }) + ], + ) .get('/regularRequest') .reply(204, { test: true }) .patch('/channels/:id', (body) => ['name', 'topic'].some((key) => Reflect.has(body as Record, key))) - .reply(function handler(): nock.ReplyFnResult { + .reply((): nock.ReplyFnResult => { sublimitHits += 1; sublimitRequests += 1; const response = 2 - sublimitHits >= 0 && 10 - sublimitRequests >= 0 ? 204 : 429; @@ -113,7 +132,7 @@ nock(`${DefaultRestOptions.api}/v${DefaultRestOptions.version}`) .patch('/channels/:id', (body) => ['name', 'topic'].every((key) => !Reflect.has(body as Record, key)), ) - .reply(function handler(): nock.ReplyFnResult { + .reply((): nock.ReplyFnResult => { sublimitRequests += 1; const response = 10 - sublimitRequests >= 0 ? 204 : 429; startSublimitIntervals(); @@ -148,7 +167,7 @@ nock(`${DefaultRestOptions.api}/v${DefaultRestOptions.version}`) }) .get('/unexpected') .times(2) - .reply(function handler(): nock.ReplyFnResult { + .reply((): nock.ReplyFnResult => { if (unexpected429) { unexpected429 = false; return [ @@ -164,7 +183,7 @@ nock(`${DefaultRestOptions.api}/v${DefaultRestOptions.version}`) }) .get('/unexpected-cf') .times(2) - .reply(function handler(): nock.ReplyFnResult { + .reply((): nock.ReplyFnResult => { if (unexpected429cf) { unexpected429cf = false; return [ @@ -179,7 +198,7 @@ nock(`${DefaultRestOptions.api}/v${DefaultRestOptions.version}`) }) .get('/temp') .times(2) - .reply(function handler(): nock.ReplyFnResult { + .reply((): nock.ReplyFnResult => { if (serverOutage) { serverOutage = false; return [500]; @@ -345,22 +364,3 @@ test('Reject on RateLimit', async () => { test('malformedRequest', async () => { expect(await api.get('/malformedRequest')).toBe(null); }); - -function startSublimitIntervals() { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (!sublimitIntervals.reset) { - sublimitResetAfter = Date.now() + 250; - sublimitIntervals.reset = setInterval(() => { - sublimitRequests = 0; - sublimitResetAfter = Date.now() + 250; - }, 250); - } - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (!sublimitIntervals.retry) { - retryAfter = Date.now() + 1000; - sublimitIntervals.retry = setInterval(() => { - sublimitHits = 0; - retryAfter = Date.now() + 1000; - }, 1000); - } -} diff --git a/packages/rest/package.json b/packages/rest/package.json index b95d2bf55..85531a6dd 100644 --- a/packages/rest/package.json +++ b/packages/rest/package.json @@ -5,9 +5,8 @@ "scripts": { "build": "tsup && tsc --emitDeclarationOnly --incremental", "test": "jest --pass-with-no-tests --collect-coverage", - "lint": "eslint src __tests__ --ext mjs,js,ts", - "lint:fix": "eslint src __tests__ --ext mjs,js,ts --fix", - "format": "prettier --write .", + "lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts", + "format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix", "prepublishOnly": "yarn build && yarn lint && yarn test", "changelog": "git cliff --prepend ./CHANGELOG.md -l -c ../../cliff.toml -r ../../ --include-path './*'" }, @@ -60,16 +59,16 @@ "devDependencies": { "@babel/core": "^7.16.7", "@babel/plugin-proposal-decorators": "^7.16.7", - "@babel/preset-env": "^7.16.7", + "@babel/preset-env": "^7.16.8", "@babel/preset-typescript": "^7.16.7", "@types/jest": "^27.4.0", "@types/node-fetch": "^2.5.10", - "@typescript-eslint/eslint-plugin": "^5.9.0", - "@typescript-eslint/parser": "^5.9.0", + "@typescript-eslint/eslint-plugin": "^5.9.1", + "@typescript-eslint/parser": "^5.9.1", "babel-plugin-const-enum": "^1.2.0", "babel-plugin-transform-typescript-metadata": "^0.3.2", "eslint": "^8.5.0", - "eslint-config-marine": "^9.1.0", + "eslint-config-marine": "^9.3.2", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^4.0.0", "jest": "^27.4.7", diff --git a/packages/rest/src/lib/REST.ts b/packages/rest/src/lib/REST.ts index 49892c746..3290dad21 100644 --- a/packages/rest/src/lib/REST.ts +++ b/packages/rest/src/lib/REST.ts @@ -171,20 +171,20 @@ export interface RestEvents { } export interface REST { - on(event: K, listener: (...args: RestEvents[K]) => void): this; - on(event: Exclude, listener: (...args: any[]) => void): this; + on: ((event: K, listener: (...args: RestEvents[K]) => void) => this) & + ((event: Exclude, listener: (...args: any[]) => void) => this); - once(event: K, listener: (...args: RestEvents[K]) => void): this; - once(event: Exclude, listener: (...args: any[]) => void): this; + once: ((event: K, listener: (...args: RestEvents[K]) => void) => this) & + ((event: Exclude, listener: (...args: any[]) => void) => this); - emit(event: K, ...args: RestEvents[K]): boolean; - emit(event: Exclude, ...args: any[]): boolean; + emit: ((event: K, ...args: RestEvents[K]) => boolean) & + ((event: Exclude, ...args: any[]) => boolean); - off(event: K, listener: (...args: RestEvents[K]) => void): this; - off(event: Exclude, listener: (...args: any[]) => void): this; + off: ((event: K, listener: (...args: RestEvents[K]) => void) => this) & + ((event: Exclude, listener: (...args: any[]) => void) => this); - removeAllListeners(event?: K): this; - removeAllListeners(event?: Exclude): this; + removeAllListeners: ((event?: K) => this) & + ((event?: Exclude) => this); } export class REST extends EventEmitter { diff --git a/packages/rest/src/lib/RequestManager.ts b/packages/rest/src/lib/RequestManager.ts index 78d73b9de..d2bd2a657 100644 --- a/packages/rest/src/lib/RequestManager.ts +++ b/packages/rest/src/lib/RequestManager.ts @@ -126,20 +126,20 @@ export interface RouteData { } export interface RequestManager { - on(event: K, listener: (...args: RestEvents[K]) => void): this; - on(event: Exclude, listener: (...args: any[]) => void): this; + on: ((event: K, listener: (...args: RestEvents[K]) => void) => this) & + ((event: Exclude, listener: (...args: any[]) => void) => this); - once(event: K, listener: (...args: RestEvents[K]) => void): this; - once(event: Exclude, listener: (...args: any[]) => void): this; + once: ((event: K, listener: (...args: RestEvents[K]) => void) => this) & + ((event: Exclude, listener: (...args: any[]) => void) => this); - emit(event: K, ...args: RestEvents[K]): boolean; - emit(event: Exclude, ...args: any[]): boolean; + emit: ((event: K, ...args: RestEvents[K]) => boolean) & + ((event: Exclude, ...args: any[]) => boolean); - off(event: K, listener: (...args: RestEvents[K]) => void): this; - off(event: Exclude, listener: (...args: any[]) => void): this; + off: ((event: K, listener: (...args: RestEvents[K]) => void) => this) & + ((event: Exclude, listener: (...args: any[]) => void) => this); - removeAllListeners(event?: K): this; - removeAllListeners(event?: Exclude): this; + removeAllListeners: ((event?: K) => this) & + ((event?: Exclude) => this); } /** diff --git a/packages/rest/src/lib/handlers/IHandler.ts b/packages/rest/src/lib/handlers/IHandler.ts index 074bb4ca4..fc358047b 100644 --- a/packages/rest/src/lib/handlers/IHandler.ts +++ b/packages/rest/src/lib/handlers/IHandler.ts @@ -2,10 +2,10 @@ import type { RequestInit } from 'node-fetch'; import type { InternalRequest, RouteData } from '../RequestManager'; export interface IHandler { - queueRequest( + queueRequest: ( routeId: RouteData, url: string, options: RequestInit, bodyData: Pick, - ): Promise; + ) => Promise; } diff --git a/packages/rest/src/lib/handlers/SequentialHandler.ts b/packages/rest/src/lib/handlers/SequentialHandler.ts index 2e7ed8821..a718c9e15 100644 --- a/packages/rest/src/lib/handlers/SequentialHandler.ts +++ b/packages/rest/src/lib/handlers/SequentialHandler.ts @@ -304,11 +304,12 @@ export class SequentialHandler { try { // node-fetch typings are a bit weird, so we have to cast to any to get the correct signature // Type 'AbortSignal' is not assignable to type 'import("discord.js-modules/node_modules/@types/node-fetch/externals").AbortSignal' + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment res = await fetch(url, { ...options, signal: controller.signal as any }); } catch (error: unknown) { // Retry the specified number of times for possible timed out requests if (error instanceof Error && error.name === 'AbortError' && retries !== this.manager.options.retries) { - return this.runRequest(routeId, url, options, bodyData, ++retries); + return await this.runRequest(routeId, url, options, bodyData, ++retries); } throw error; diff --git a/packages/rest/src/lib/utils/constants.ts b/packages/rest/src/lib/utils/constants.ts index d1a62f69c..d026493b3 100644 --- a/packages/rest/src/lib/utils/constants.ts +++ b/packages/rest/src/lib/utils/constants.ts @@ -1,9 +1,9 @@ import { APIVersion } from 'discord-api-types/v9'; import type { RESTOptions } from '../REST'; -// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports +// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-assignment const Package = require('../../../package.json'); -// eslint-disable-next-line @typescript-eslint/restrict-template-expressions +// eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-member-access export const DefaultUserAgent = `DiscordBot (${Package.homepage}, ${Package.version})`; export const DefaultRestOptions: Required = { diff --git a/packages/voice/.eslintrc.json b/packages/voice/.eslintrc.json index cfff6f7db..0998f03ac 100644 --- a/packages/voice/.eslintrc.json +++ b/packages/voice/.eslintrc.json @@ -8,9 +8,5 @@ "ignorePatterns": ["**/dist/*"], "env": { "jest": true - }, - "rules": { - "no-redeclare": 0, - "@typescript-eslint/naming-convention": 0 } } diff --git a/packages/voice/.prettierignore b/packages/voice/.prettierignore index d5a8d0059..553e0ea6c 100644 --- a/packages/voice/.prettierignore +++ b/packages/voice/.prettierignore @@ -1,2 +1,8 @@ # Autogenerated CHANGELOG.md +.turbo +dist/ +docs/**/* +!docs/index.yml +!docs/README.md +coverage/ diff --git a/packages/voice/__tests__/DataStore.test.ts b/packages/voice/__tests__/DataStore.test.ts index 2eff7def1..d37e8ca88 100644 --- a/packages/voice/__tests__/DataStore.test.ts +++ b/packages/voice/__tests__/DataStore.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unsafe-return */ /* eslint-disable @typescript-eslint/dot-notation */ import { GatewayOpcodes } from 'discord-api-types/v9'; import * as DataStore from '../src/DataStore'; diff --git a/packages/voice/__tests__/VoiceConnection.test.ts b/packages/voice/__tests__/VoiceConnection.test.ts index b4f9a3fba..dffc97d23 100644 --- a/packages/voice/__tests__/VoiceConnection.test.ts +++ b/packages/voice/__tests__/VoiceConnection.test.ts @@ -1,3 +1,6 @@ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ +/* eslint-disable @typescript-eslint/no-unsafe-return */ +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-argument */ /* eslint-disable @typescript-eslint/dot-notation */ import { diff --git a/packages/voice/__tests__/joinVoiceChannel.test.ts b/packages/voice/__tests__/joinVoiceChannel.test.ts index 6c984bd5b..c4b2ef79d 100644 --- a/packages/voice/__tests__/joinVoiceChannel.test.ts +++ b/packages/voice/__tests__/joinVoiceChannel.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unsafe-return */ import { joinVoiceChannel } from '../src/joinVoiceChannel'; import * as VoiceConnection from '../src/VoiceConnection'; diff --git a/packages/voice/package.json b/packages/voice/package.json index 7cfe16c54..c8cd0fa94 100644 --- a/packages/voice/package.json +++ b/packages/voice/package.json @@ -5,9 +5,8 @@ "scripts": { "build": "tsup && node scripts/postbuild.mjs", "test": "jest --pass-with-no-tests --collect-coverage", - "lint": "eslint src --ext mjs,js,ts", - "lint:fix": "eslint src --ext mjs,js,ts --fix", - "format": "prettier --write .", + "lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts", + "format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix", "docs": "typedoc --json docs/typedoc-out.json src/index.ts && node scripts/docs.mjs", "prepublishOnly": "yarn build && yarn lint && yarn test", "changelog": "git cliff --prepend ./CHANGELOG.md -l -c ../../cliff.toml -r ../../ --include-path './*'" @@ -59,15 +58,15 @@ }, "devDependencies": { "@babel/core": "^7.16.0", - "@babel/preset-env": "^7.16.0", + "@babel/preset-env": "^7.16.8", "@babel/preset-typescript": "^7.16.0", "@discordjs/ts-docgen": "^0.3.2", "@types/jest": "^27.0.2", "@types/node": "^16.11.7", - "@typescript-eslint/eslint-plugin": "^5.9.0", - "@typescript-eslint/parser": "^5.9.0", + "@typescript-eslint/eslint-plugin": "^5.9.1", + "@typescript-eslint/parser": "^5.9.1", "eslint": "^8.2.0", - "eslint-config-marine": "^9.0.6", + "eslint-config-marine": "^9.3.2", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^4.0.0", "jest": "^27.4.7", diff --git a/packages/voice/src/DataStore.ts b/packages/voice/src/DataStore.ts index 91db34bc4..9764323d0 100644 --- a/packages/voice/src/DataStore.ts +++ b/packages/voice/src/DataStore.ts @@ -125,6 +125,7 @@ function audioCycleStep() { // eslint-disable-next-line @typescript-eslint/dot-notation available.forEach((player) => player['_stepDispatch']()); + // eslint-disable-next-line @typescript-eslint/no-use-before-define prepareNextAudioFrame(available); } diff --git a/packages/voice/src/VoiceConnection.ts b/packages/voice/src/VoiceConnection.ts index c9a523eac..864a19119 100644 --- a/packages/voice/src/VoiceConnection.ts +++ b/packages/voice/src/VoiceConnection.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/prefer-ts-expect-error */ import type { GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData } from 'discord-api-types/v9'; import type { CreateVoiceConnectionOptions } from '.'; import type { AudioPlayer } from './audio/AudioPlayer'; @@ -261,11 +262,11 @@ export class VoiceConnection extends TypedEmitter { */ public set state(newState: VoiceConnectionState) { const oldState = this._state; - const oldNetworking: Networking | undefined = Reflect.get(oldState, 'networking'); - const newNetworking: Networking | undefined = Reflect.get(newState, 'networking'); + const oldNetworking = Reflect.get(oldState, 'networking') as Networking | undefined; + const newNetworking = Reflect.get(newState, 'networking') as Networking | undefined; - const oldSubscription: PlayerSubscription | undefined = Reflect.get(oldState, 'subscription'); - const newSubscription: PlayerSubscription | undefined = Reflect.get(newState, 'subscription'); + const oldSubscription = Reflect.get(oldState, 'subscription') as PlayerSubscription | undefined; + const newSubscription = Reflect.get(newState, 'subscription') as PlayerSubscription | undefined; if (oldNetworking !== newNetworking) { if (oldNetworking) { @@ -365,6 +366,7 @@ export class VoiceConnection extends TypedEmitter { newUdp?.on('message', this.receiver.onUdpMessage); } + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment this.receiver.connectionData = Reflect.get(newState, 'connectionData') ?? {}; } diff --git a/packages/voice/src/audio/AudioPlayer.ts b/packages/voice/src/audio/AudioPlayer.ts index 29717a316..17feab4de 100644 --- a/packages/voice/src/audio/AudioPlayer.ts +++ b/packages/voice/src/audio/AudioPlayer.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/prefer-ts-expect-error */ import { addAudioPlayer, deleteAudioPlayer } from '../DataStore'; import { Awaited, noop } from '../util/util'; import { VoiceConnection, VoiceConnectionStatus } from '../VoiceConnection'; @@ -163,6 +164,19 @@ export type AudioPlayerEvents = { ) => Awaited; }; +/** + * Stringifies an AudioPlayerState instance. + * + * @param state - The state to stringify + */ +function stringifyState(state: AudioPlayerState) { + return JSON.stringify({ + ...state, + resource: Reflect.has(state, 'resource'), + stepTimeout: Reflect.has(state, 'stepTimeout'), + }); +} + /** * Used to play audio resources (i.e. tracks, streams) to voice connections. * @@ -606,19 +620,6 @@ export class AudioPlayer extends TypedEmitter { } } -/** - * Stringifies an AudioPlayerState instance. - * - * @param state - The state to stringify - */ -function stringifyState(state: AudioPlayerState) { - return JSON.stringify({ - ...state, - resource: Reflect.has(state, 'resource'), - stepTimeout: Reflect.has(state, 'stepTimeout'), - }); -} - /** * Creates a new AudioPlayer to be used. */ diff --git a/packages/voice/src/audio/AudioResource.ts b/packages/voice/src/audio/AudioResource.ts index 294811361..3742cb190 100644 --- a/packages/voice/src/audio/AudioResource.ts +++ b/packages/voice/src/audio/AudioResource.ts @@ -151,7 +151,7 @@ export class AudioResource { this.silenceRemaining--; return SILENCE_FRAME; } - const packet: Buffer | null = this.playStream.read(); + const packet = this.playStream.read() as Buffer | null; if (packet) { this.playbackDuration += 20; } diff --git a/packages/voice/src/audio/__tests__/AudioPlayer.test.ts b/packages/voice/src/audio/__tests__/AudioPlayer.test.ts index cd5164efd..f8cfce1df 100644 --- a/packages/voice/src/audio/__tests__/AudioPlayer.test.ts +++ b/packages/voice/src/audio/__tests__/AudioPlayer.test.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/dot-notation */ import { AudioResource } from '../../audio/AudioResource'; import { createAudioPlayer, AudioPlayerStatus, AudioPlayer, SILENCE_FRAME } from '../AudioPlayer'; @@ -372,7 +374,7 @@ test('play() throws when playing a resource that has already ended', async () => expect(resource.playStream.readableEnded).toBe(true); player.stop(true); expect(player.state.status).toBe(AudioPlayerStatus.Idle); - expect(() => player.play(resource)).toThrow(); + expect(() => player?.play(resource)).toThrow(); }); test('Propagates errors from streams', async () => { diff --git a/packages/voice/src/audio/__tests__/AudioResource.test.ts b/packages/voice/src/audio/__tests__/AudioResource.test.ts index ef90dff80..fc7e1e3ea 100644 --- a/packages/voice/src/audio/__tests__/AudioResource.test.ts +++ b/packages/voice/src/audio/__tests__/AudioResource.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unsafe-return */ import { opus, VolumeTransformer } from 'prism-media'; import { PassThrough, Readable } from 'node:stream'; import { SILENCE_FRAME } from '../AudioPlayer'; diff --git a/packages/voice/src/networking/Networking.ts b/packages/voice/src/networking/Networking.ts index 954f0a87a..00338bfbd 100644 --- a/packages/voice/src/networking/Networking.ts +++ b/packages/voice/src/networking/Networking.ts @@ -157,6 +157,41 @@ export interface NetworkingEvents { close: (code: number) => Awaited; } +/** + * Stringifies a NetworkingState. + * + * @param state - The state to stringify + */ +function stringifyState(state: NetworkingState) { + return JSON.stringify({ + ...state, + ws: Reflect.has(state, 'ws'), + udp: Reflect.has(state, 'udp'), + }); +} + +/** + * Chooses an encryption mode from a list of given options. Chooses the most preferred option. + * + * @param options - The available encryption options + */ +function chooseEncryptionMode(options: string[]): string { + const option = options.find((option) => SUPPORTED_ENCRYPTION_MODES.includes(option)); + if (!option) { + throw new Error(`No compatible encryption modes. Available include: ${options.join(', ')}`); + } + return option; +} + +/** + * Returns a random number that is in the range of n bits. + * + * @param n - The number of bits + */ +function randomNBit(n: number) { + return Math.floor(Math.random() * 2 ** n); +} + /** * Manages the networking required to maintain a voice connection and dispatch audio packets */ @@ -348,12 +383,16 @@ export class Networking extends TypedEmitter { * @param packet - The received packet */ private onWsPacket(packet: any) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access if (packet.op === VoiceOpcodes.Hello && this.state.code !== NetworkingStatusCode.Closed) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access this.state.ws.setHeartbeatInterval(packet.d.heartbeat_interval); + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access } else if (packet.op === VoiceOpcodes.Ready && this.state.code === NetworkingStatusCode.Identifying) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access const { ip, port, ssrc, modes } = packet.d; + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const udp = new VoiceUDPSocket({ ip, port }); udp.on('error', this.onChildError); udp.on('debug', this.onUdpDebug); @@ -387,19 +426,23 @@ export class Networking extends TypedEmitter { code: NetworkingStatusCode.UdpHandshaking, udp, connectionData: { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment ssrc, }, }; } else if ( + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access packet.op === VoiceOpcodes.SessionDescription && this.state.code === NetworkingStatusCode.SelectingProtocol ) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access const { mode: encryptionMode, secret_key: secretKey } = packet.d; this.state = { ...this.state, code: NetworkingStatusCode.Ready, connectionData: { ...this.state.connectionData, + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment encryptionMode, // eslint-disable-next-line @typescript-eslint/no-unsafe-argument secretKey: new Uint8Array(secretKey), @@ -411,6 +454,7 @@ export class Networking extends TypedEmitter { packetsPlayed: 0, }, }; + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access } else if (packet.op === VoiceOpcodes.Resumed && this.state.code === NetworkingStatusCode.Resuming) { this.state = { ...this.state, @@ -557,38 +601,3 @@ export class Networking extends TypedEmitter { return [secretbox.methods.close(opusPacket, nonce, secretKey)]; } } - -/** - * Returns a random number that is in the range of n bits. - * - * @param n - The number of bits - */ -function randomNBit(n: number) { - return Math.floor(Math.random() * 2 ** n); -} - -/** - * Stringifies a NetworkingState. - * - * @param state - The state to stringify - */ -function stringifyState(state: NetworkingState) { - return JSON.stringify({ - ...state, - ws: Reflect.has(state, 'ws'), - udp: Reflect.has(state, 'udp'), - }); -} - -/** - * Chooses an encryption mode from a list of given options. Chooses the most preferred option. - * - * @param options - The available encryption options - */ -function chooseEncryptionMode(options: string[]): string { - const option = options.find((option) => SUPPORTED_ENCRYPTION_MODES.includes(option)); - if (!option) { - throw new Error(`No compatible encryption modes. Available include: ${options.join(', ')}`); - } - return option; -} diff --git a/packages/voice/src/networking/VoiceUDPSocket.ts b/packages/voice/src/networking/VoiceUDPSocket.ts index 18f8e3235..992508c26 100644 --- a/packages/voice/src/networking/VoiceUDPSocket.ts +++ b/packages/voice/src/networking/VoiceUDPSocket.ts @@ -24,6 +24,25 @@ export interface VoiceUDPSocketEvents { message: (message: Buffer) => Awaited; } +/** + * Parses the response from Discord to aid with local IP discovery. + * + * @param message - The received message + */ +export function parseLocalPacket(message: Buffer): SocketConfig { + const packet = Buffer.from(message); + + const ip = packet.slice(8, packet.indexOf(0, 8)).toString('utf-8'); + + if (!isIPv4(ip)) { + throw new Error('Malformed IP address'); + } + + const port = packet.readUInt16BE(packet.length - 2); + + return { ip, port }; +} + /** * The interval in milliseconds at which keep alive datagrams are sent. */ @@ -191,22 +210,3 @@ export class VoiceUDPSocket extends TypedEmitter { }); } } - -/** - * Parses the response from Discord to aid with local IP discovery. - * - * @param message - The received message - */ -export function parseLocalPacket(message: Buffer): SocketConfig { - const packet = Buffer.from(message); - - const ip = packet.slice(8, packet.indexOf(0, 8)).toString('utf-8'); - - if (!isIPv4(ip)) { - throw new Error('Malformed IP address'); - } - - const port = packet.readUInt16BE(packet.length - 2); - - return { ip, port }; -} diff --git a/packages/voice/src/networking/VoiceWebSocket.ts b/packages/voice/src/networking/VoiceWebSocket.ts index 44ce4abf4..0b3beb79a 100644 --- a/packages/voice/src/networking/VoiceWebSocket.ts +++ b/packages/voice/src/networking/VoiceWebSocket.ts @@ -107,6 +107,7 @@ export class VoiceWebSocket extends TypedEmitter { let packet: any; try { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment packet = JSON.parse(event.data); } catch (error) { const e = error as Error; @@ -114,6 +115,7 @@ export class VoiceWebSocket extends TypedEmitter { return; } + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access if (packet.op === VoiceOpcodes.HeartbeatAck) { this.lastHeartbeatAck = Date.now(); this.missedHeartbeats = 0; diff --git a/packages/voice/src/networking/__tests__/VoiceUDPSocket.test.ts b/packages/voice/src/networking/__tests__/VoiceUDPSocket.test.ts index 12a1b523d..ed31c627f 100644 --- a/packages/voice/src/networking/__tests__/VoiceUDPSocket.test.ts +++ b/packages/voice/src/networking/__tests__/VoiceUDPSocket.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unsafe-return */ /* eslint-disable @typescript-eslint/no-empty-function */ /* eslint-disable @typescript-eslint/no-unused-vars */ import { createSocket as _createSocket } from 'node:dgram'; @@ -21,7 +22,6 @@ class FakeSocket extends EventEmitter { } // ip = 91.90.123.93, port = 54148 -// eslint-disable-next-line prettier/prettier const VALID_RESPONSE = Buffer.from([ 0x0, 0x2, 0x0, 0x46, 0x0, 0x4, 0xeb, 0x23, 0x39, 0x31, 0x2e, 0x39, 0x30, 0x2e, 0x31, 0x32, 0x33, 0x2e, 0x39, 0x33, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, diff --git a/packages/voice/src/networking/__tests__/VoiceWebSocket.test.ts b/packages/voice/src/networking/__tests__/VoiceWebSocket.test.ts index bdc81901a..d9c6462ea 100644 --- a/packages/voice/src/networking/__tests__/VoiceWebSocket.test.ts +++ b/packages/voice/src/networking/__tests__/VoiceWebSocket.test.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ import { VoiceOpcodes } from 'discord-api-types/voice/v4'; import EventEmitter, { once } from 'node:events'; import WS from 'jest-websocket-mock'; diff --git a/packages/voice/src/receive/VoiceReceiver.ts b/packages/voice/src/receive/VoiceReceiver.ts index e838a8e88..ea8c8a54a 100644 --- a/packages/voice/src/receive/VoiceReceiver.ts +++ b/packages/voice/src/receive/VoiceReceiver.ts @@ -63,23 +63,34 @@ export class VoiceReceiver { * @internal */ public onWsPacket(packet: any) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access if (packet.op === VoiceOpcodes.ClientDisconnect && typeof packet.d?.user_id === 'string') { - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access this.ssrcMap.delete(packet.d.user_id); } else if ( + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access packet.op === VoiceOpcodes.Speaking && + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access typeof packet.d?.user_id === 'string' && + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access typeof packet.d?.ssrc === 'number' ) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access this.ssrcMap.update({ userId: packet.d.user_id, audioSSRC: packet.d.ssrc }); } else if ( + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access packet.op === VoiceOpcodes.ClientConnect && + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access typeof packet.d?.user_id === 'string' && + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access typeof packet.d?.audio_ssrc === 'number' ) { this.ssrcMap.update({ + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access userId: packet.d.user_id, + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access audioSSRC: packet.d.audio_ssrc, + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access videoSSRC: packet.d.video_ssrc === 0 ? undefined : packet.d.video_ssrc, }); } diff --git a/packages/voice/src/receive/__tests__/SSRCMap.test.ts b/packages/voice/src/receive/__tests__/SSRCMap.test.ts index 61df4e37c..f5586728a 100644 --- a/packages/voice/src/receive/__tests__/SSRCMap.test.ts +++ b/packages/voice/src/receive/__tests__/SSRCMap.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ import EventEmitter, { once } from 'node:events'; import { SSRCMap, VoiceUserData } from '../SSRCMap'; diff --git a/packages/voice/src/receive/__tests__/VoiceReceiver.test.ts b/packages/voice/src/receive/__tests__/VoiceReceiver.test.ts index 0c5007435..44ee8fc33 100644 --- a/packages/voice/src/receive/__tests__/VoiceReceiver.test.ts +++ b/packages/voice/src/receive/__tests__/VoiceReceiver.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/dot-notation */ import { VoiceReceiver } from '../VoiceReceiver'; import { VoiceConnection as _VoiceConnection, VoiceConnectionStatus } from '../../VoiceConnection'; diff --git a/packages/voice/src/util/Secretbox.ts b/packages/voice/src/util/Secretbox.ts index c45469d87..5169cc3b2 100644 --- a/packages/voice/src/util/Secretbox.ts +++ b/packages/voice/src/util/Secretbox.ts @@ -1,28 +1,37 @@ interface Methods { - open(buffer: Buffer, nonce: Buffer, secretKey: Uint8Array): Buffer | null; - close(opusPacket: Buffer, nonce: Buffer, secretKey: Uint8Array): Buffer; - random(bytes: number, nonce: Buffer): Buffer; + open: (buffer: Buffer, nonce: Buffer, secretKey: Uint8Array) => Buffer | null; + close: (opusPacket: Buffer, nonce: Buffer, secretKey: Uint8Array) => Buffer; + random: (bytes: number, nonce: Buffer) => Buffer; } const libs = { sodium: (sodium: any): Methods => ({ + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access open: sodium.api.crypto_secretbox_open_easy, + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access close: sodium.api.crypto_secretbox_easy, random: (n: any, buffer?: Buffer) => { // eslint-disable-next-line @typescript-eslint/no-unsafe-argument if (!buffer) buffer = Buffer.allocUnsafe(n); + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call sodium.api.randombytes_buf(buffer); return buffer; }, }), 'libsodium-wrappers': (sodium: any): Methods => ({ + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access open: sodium.crypto_secretbox_open_easy, + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access close: sodium.crypto_secretbox_easy, + // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call random: (n: any) => sodium.randombytes_buf(n), }), tweetnacl: (tweetnacl: any): Methods => ({ + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access open: tweetnacl.secretbox.open, + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access close: tweetnacl.secretbox, + // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call random: (n: any) => tweetnacl.randomBytes(n), }), } as const; @@ -46,6 +55,7 @@ void (async () => { try { // eslint-disable-next-line const lib = require(libName); + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access if (libName === 'libsodium-wrappers' && lib.ready) await lib.ready; Object.assign(methods, libs[libName](lib)); break; diff --git a/packages/voice/src/util/__tests__/demuxProbe.test.ts b/packages/voice/src/util/__tests__/demuxProbe.test.ts index d23b672fd..e86d05cb5 100644 --- a/packages/voice/src/util/__tests__/demuxProbe.test.ts +++ b/packages/voice/src/util/__tests__/demuxProbe.test.ts @@ -1,3 +1,6 @@ +/* eslint-disable @typescript-eslint/no-unsafe-call */ +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ import { demuxProbe } from '../demuxProbe'; import { opus as _opus } from 'prism-media'; import { Readable } from 'node:stream'; @@ -9,6 +12,10 @@ jest.mock('prism-media'); const WebmDemuxer = _opus.WebmDemuxer as unknown as jest.Mock<_opus.WebmDemuxer>; const OggDemuxer = _opus.OggDemuxer as unknown as jest.Mock<_opus.OggDemuxer>; +function nextTick() { + return new Promise((resolve) => process.nextTick(resolve)); +} + async function* gen(n: number) { for (let i = 0; i < n; i++) { yield Buffer.from([i]); @@ -37,10 +44,6 @@ async function collectStream(stream: Readable): Promise { return output; } -function nextTick() { - return new Promise((resolve) => process.nextTick(resolve)); -} - describe('demuxProbe', () => { const webmWrite: jest.Mock<(buffer: Buffer) => void> = jest.fn(); const oggWrite: jest.Mock<(buffer: Buffer) => void> = jest.fn(); diff --git a/packages/voice/src/util/__tests__/entersState.test.ts b/packages/voice/src/util/__tests__/entersState.test.ts index 8d4d5ea2e..f81e0881e 100644 --- a/packages/voice/src/util/__tests__/entersState.test.ts +++ b/packages/voice/src/util/__tests__/entersState.test.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ import EventEmitter from 'node:events'; import { VoiceConnection, VoiceConnectionStatus } from '../../VoiceConnection'; import { entersState } from '../entersState'; diff --git a/packages/voice/src/util/abortAfter.ts b/packages/voice/src/util/abortAfter.ts index e94307290..4dc2fbf3d 100644 --- a/packages/voice/src/util/abortAfter.ts +++ b/packages/voice/src/util/abortAfter.ts @@ -6,7 +6,8 @@ export function abortAfter(delay: number): [AbortController, AbortSignal] { const ac = new AbortController(); const timeout = setTimeout(() => ac.abort(), delay); - // @ts-ignore + // @ts-expect-error + // eslint-disable-next-line @typescript-eslint/no-unsafe-call ac.signal.addEventListener('abort', () => clearTimeout(timeout)); return [ac, ac.signal]; } diff --git a/packages/voice/src/util/adapter.ts b/packages/voice/src/util/adapter.ts index 118719c1d..a76abb68c 100644 --- a/packages/voice/src/util/adapter.ts +++ b/packages/voice/src/util/adapter.ts @@ -10,17 +10,17 @@ export interface DiscordGatewayAdapterLibraryMethods { * * @param data - The inner data of the VOICE_SERVER_UPDATE payload */ - onVoiceServerUpdate(data: GatewayVoiceServerUpdateDispatchData): void; + onVoiceServerUpdate: (data: GatewayVoiceServerUpdateDispatchData) => void; /** * Call this when you receive a VOICE_STATE_UPDATE payload that is relevant to the adapter. * * @param data - The inner data of the VOICE_STATE_UPDATE payload */ - onVoiceStateUpdate(data: GatewayVoiceStateUpdateDispatchData): void; + onVoiceStateUpdate: (data: GatewayVoiceStateUpdateDispatchData) => void; /** * Call this when the adapter can no longer be used (e.g. due to a disconnect from the main gateway) */ - destroy(): void; + destroy: () => void; } /** @@ -34,12 +34,12 @@ export interface DiscordGatewayAdapterImplementerMethods { * * @returns `false` if the payload definitely failed to send - in this case, the voice connection disconnects */ - sendPayload(payload: any): boolean; + sendPayload: (payload: any) => boolean; /** * This will be called by @discordjs/voice when the adapter can safely be destroyed as it will no * longer be used. */ - destroy(): void; + destroy: () => void; } /** diff --git a/packages/voice/src/util/demuxProbe.ts b/packages/voice/src/util/demuxProbe.ts index ba634ca73..16c5a5a6e 100644 --- a/packages/voice/src/util/demuxProbe.ts +++ b/packages/voice/src/util/demuxProbe.ts @@ -56,8 +56,11 @@ export function demuxProbe( let resolved: StreamType | undefined = undefined; const finish = (type: StreamType) => { + // eslint-disable-next-line @typescript-eslint/no-use-before-define stream.off('data', onData); + // eslint-disable-next-line @typescript-eslint/no-use-before-define stream.off('close', onClose); + // eslint-disable-next-line @typescript-eslint/no-use-before-define stream.off('end', onClose); stream.pause(); resolved = type; diff --git a/packages/voice/src/util/generateDependencyReport.ts b/packages/voice/src/util/generateDependencyReport.ts index e4d7df36f..71817b89f 100644 --- a/packages/voice/src/util/generateDependencyReport.ts +++ b/packages/voice/src/util/generateDependencyReport.ts @@ -3,6 +3,51 @@ import { resolve, dirname } from 'node:path'; import prism from 'prism-media'; +/** + * Tries to find the package.json file for a given module. + * + * @param dir - The directory to look in + * @param packageName - The name of the package to look for + * @param depth - The maximum recursion depth + */ +function findPackageJSON( + dir: string, + packageName: string, + depth: number, +): { name: string; version: string } | undefined { + if (depth === 0) return undefined; + const attemptedPath = resolve(dir, './package.json'); + try { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const pkg = require(attemptedPath); + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + if (pkg.name !== packageName) throw new Error('package.json does not match'); + // eslint-disable-next-line @typescript-eslint/no-unsafe-return + return pkg; + } catch (err) { + return findPackageJSON(resolve(dir, '..'), packageName, depth - 1); + } +} + +/** + * Tries to find the version of a dependency. + * + * @param name - The package to find the version of + */ +function version(name: string): string { + try { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const pkg = + name === '@discordjs/voice' + ? require('../../package.json') + : findPackageJSON(dirname(require.resolve(name)), name, 3); + // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access + return pkg?.version ?? 'not found'; + } catch (err) { + return 'not found'; + } +} + /** * Generates a report of the dependencies used by the \@discordjs/voice module. * Useful for debugging. @@ -41,43 +86,3 @@ export function generateDependencyReport() { return ['-'.repeat(50), ...report, '-'.repeat(50)].join('\n'); } - -/** - * Tries to find the package.json file for a given module. - * - * @param dir - The directory to look in - * @param packageName - The name of the package to look for - * @param depth - The maximum recursion depth - */ -function findPackageJSON( - dir: string, - packageName: string, - depth: number, -): { name: string; version: string } | undefined { - if (depth === 0) return undefined; - const attemptedPath = resolve(dir, './package.json'); - try { - const pkg = require(attemptedPath); - if (pkg.name !== packageName) throw new Error('package.json does not match'); - return pkg; - } catch (err) { - return findPackageJSON(resolve(dir, '..'), packageName, depth - 1); - } -} - -/** - * Tries to find the version of a dependency. - * - * @param name - The package to find the version of - */ -function version(name: string): string { - try { - const pkg = - name === '@discordjs/voice' - ? require('../../package.json') - : findPackageJSON(dirname(require.resolve(name)), name, 3); - return pkg?.version ?? 'not found'; - } catch (err) { - return 'not found'; - } -} diff --git a/packages/voice/tsconfig.json b/packages/voice/tsconfig.json index 463836626..fd8b5e417 100644 --- a/packages/voice/tsconfig.json +++ b/packages/voice/tsconfig.json @@ -1,48 +1,4 @@ { - // Mapped from https://www.typescriptlang.org/tsconfig - "compilerOptions": { - // Type Checking - "allowUnreachableCode": false, - "allowUnusedLabels": false, - // if true: conflicts with discord-api-types - "exactOptionalPropertyTypes": false, - "noFallthroughCasesInSwitch": true, - "noImplicitOverride": true, - "noImplicitReturns": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "strict": true, - "useUnknownInCatchVariables": true, - - // Modules - "module": "CommonJS", - "moduleResolution": "node", - "resolveJsonModule": true, - - // Emit - "declaration": true, - "importHelpers": true, - "importsNotUsedAsValues": "error", - "inlineSources": true, - "newLine": "lf", - "noEmitHelpers": true, - "outDir": "dist", - "preserveConstEnums": true, - "removeComments": false, - "sourceMap": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - - // Language and Environment - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "lib": ["ESNext"], - "target": "ES2020", - "useDefineForClassFields": true, - - // Completeness - "skipLibCheck": true - }, - "include": ["src/**/*.ts"], - "exclude": ["src/**/__tests__"] + "extends": "../../tsconfig.json", + "include": ["src/**/*.ts"] } diff --git a/yarn.lock b/yarn.lock index d79ba525f..a2daff3e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14,6 +14,11 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.4.tgz#081d6bbc336ec5c2435c6346b2ae1fb98b5ac68e" integrity sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q== +"@babel/compat-data@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.8.tgz#31560f9f29fdf1868de8cb55049538a1b9732a60" + integrity sha512-m7OkX0IdKLKPpBlJtF561YJal5y/jyI5fNfWbPxh2D/nbzzGI4qRyrD8xO2jB24u7l+5I2a43scCG2IrfjC50Q== + "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.16.0", "@babel/core@^7.16.5", "@babel/core@^7.16.7", "@babel/core@^7.7.2", "@babel/core@^7.8.0": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.7.tgz#db990f931f6d40cb9b87a0dc7d2adc749f1dcbcf" @@ -44,6 +49,15 @@ jsesc "^2.5.1" source-map "^0.5.0" +"@babel/generator@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.8.tgz#359d44d966b8cd059d543250ce79596f792f2ebe" + integrity sha512-1ojZwE9+lOXzcWdWmO6TbUzDfqLD39CmEhN8+2cX9XkDo5yW1OpgfejfliysR2AWLpMamTiOiAp/mtroaymhpw== + dependencies: + "@babel/types" "^7.16.8" + jsesc "^2.5.1" + source-map "^0.5.0" + "@babel/helper-annotate-as-pure@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz#bb2339a7534a9c128e3102024c60760a3a7f3862" @@ -181,14 +195,14 @@ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz#aa3a8ab4c3cceff8e65eb9e73d87dc4ff320b2f5" integrity sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA== -"@babel/helper-remap-async-to-generator@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.7.tgz#5ce2416990d55eb6e099128338848ae8ffa58a9a" - integrity sha512-C3o117GnP/j/N2OWo+oepeWbFEKRfNaay+F1Eo5Mj3A1SRjyx+qaFhm23nlipub7Cjv2azdUUiDH+VlpdwUFRg== +"@babel/helper-remap-async-to-generator@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.8.tgz#29ffaade68a367e2ed09c90901986918d25e57e3" + integrity sha512-fm0gH7Flb8H51LqJHy3HJ3wnE1+qtYR2A99K06ahwrawLdOFsCEWjZOrYricXJHoPSudNKxrMBUPEIPxiIIvBw== dependencies: "@babel/helper-annotate-as-pure" "^7.16.7" - "@babel/helper-wrap-function" "^7.16.7" - "@babel/types" "^7.16.7" + "@babel/helper-wrap-function" "^7.16.8" + "@babel/types" "^7.16.8" "@babel/helper-replace-supers@^7.16.7": version "7.16.7" @@ -232,15 +246,15 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" integrity sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ== -"@babel/helper-wrap-function@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.16.7.tgz#8ddf9eaa770ed43de4bc3687f3f3b0d6d5ecf014" - integrity sha512-7a9sABeVwcunnztZZ7WTgSw6jVYLzM1wua0Z4HIXm9S3/HC96WKQTkFgGEaj5W06SHHihPJ6Le6HzS5cGOQMNw== +"@babel/helper-wrap-function@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.16.8.tgz#58afda087c4cd235de92f7ceedebca2c41274200" + integrity sha512-8RpyRVIAW1RcDDGTA+GpPAwV22wXCfKOoM9bet6TLkGIFTkRQSkH1nMQ5Yet4MpoXe1ZwHPVtNasc2w0uZMqnw== dependencies: "@babel/helper-function-name" "^7.16.7" "@babel/template" "^7.16.7" - "@babel/traverse" "^7.16.7" - "@babel/types" "^7.16.7" + "@babel/traverse" "^7.16.8" + "@babel/types" "^7.16.8" "@babel/helpers@^7.16.7": version "7.16.7" @@ -265,6 +279,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.7.tgz#d372dda9c89fcec340a82630a9f533f2fe15877e" integrity sha512-sR4eaSrnM7BV7QPzGfEX5paG/6wrZM3I0HDzfIAK06ESvo9oy3xBuVBxE3MbQaKNhvg8g/ixjMWo2CGpzpHsDA== +"@babel/parser@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.8.tgz#61c243a3875f7d0b0962b0543a33ece6ff2f1f17" + integrity sha512-i7jDUfrVBWc+7OKcBzEe5n7fbv3i2fWtxKzzCvOjnzSxMfWMigAhtfJ7qzZNGFNMsCCd67+uz553dYKWXPvCKw== + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.7.tgz#4eda6d6c2a0aa79c70fa7b6da67763dfe2141050" @@ -281,13 +300,13 @@ "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" "@babel/plugin-proposal-optional-chaining" "^7.16.7" -"@babel/plugin-proposal-async-generator-functions@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.7.tgz#739adc1212a9e4892de440cd7dfffb06172df78d" - integrity sha512-TTXBT3A5c11eqRzaC6beO6rlFT3Mo9C2e8eB44tTr52ESXSK2CIc2fOp1ynpAwQA8HhBMho+WXhMHWlAe3xkpw== +"@babel/plugin-proposal-async-generator-functions@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.8.tgz#3bdd1ebbe620804ea9416706cd67d60787504bc8" + integrity sha512-71YHIvMuiuqWJQkebWJtdhQTfd4Q4mF76q2IX37uZPkG9+olBxsX+rH1vkhFto4UeJZ9dPY2s+mDvhDm1u2BGQ== dependencies: "@babel/helper-plugin-utils" "^7.16.7" - "@babel/helper-remap-async-to-generator" "^7.16.7" + "@babel/helper-remap-async-to-generator" "^7.16.8" "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-proposal-class-properties@^7.16.7": @@ -551,14 +570,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-async-to-generator@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.7.tgz#646e1262ac341b587ff5449844d4492dbb10ac4b" - integrity sha512-pFEfjnK4DfXCfAlA5I98BYdDJD8NltMzx19gt6DAmfE+2lXRfPUoa0/5SUjT4+TDE1W/rcxU/1lgN55vpAjjdg== +"@babel/plugin-transform-async-to-generator@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.8.tgz#b83dff4b970cf41f1b819f8b49cc0cfbaa53a808" + integrity sha512-MtmUmTJQHCnyJVrScNzNlofQJ3dLFuobYn3mwOTKHnSCMtbNsqvF71GQmJfFjdrXSsAA7iysFmYWw4bXZ20hOg== dependencies: "@babel/helper-module-imports" "^7.16.7" "@babel/helper-plugin-utils" "^7.16.7" - "@babel/helper-remap-async-to-generator" "^7.16.7" + "@babel/helper-remap-async-to-generator" "^7.16.8" "@babel/plugin-transform-block-scoped-functions@^7.16.7": version "7.16.7" @@ -664,10 +683,10 @@ "@babel/helper-plugin-utils" "^7.16.7" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-commonjs@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.16.7.tgz#fd119e6a433c527d368425b45df361e1e95d3c1a" - integrity sha512-h2RP2kE7He1ZWKyAlanMZrAbdv+Acw1pA8dQZhE025WJZE2z0xzFADAinXA9fxd5bn7JnM+SdOGcndGx1ARs9w== +"@babel/plugin-transform-modules-commonjs@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.16.8.tgz#cdee19aae887b16b9d331009aa9a219af7c86afe" + integrity sha512-oflKPvsLT2+uKQopesJt3ApiaIS2HW+hzHFcwRNtyDGieAeC/dIHZX8buJQ2J2X1rxGPy4eRcUijm3qcSPjYcA== dependencies: "@babel/helper-module-transforms" "^7.16.7" "@babel/helper-plugin-utils" "^7.16.7" @@ -693,10 +712,10 @@ "@babel/helper-module-transforms" "^7.16.7" "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-named-capturing-groups-regex@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.16.7.tgz#749d90d94e73cf62c60a0cc8d6b94d29305a81f2" - integrity sha512-kFy35VwmwIQwCjwrAQhl3+c/kr292i4KdLPKp5lPH03Ltc51qnFlIADoyPxc/6Naz3ok3WdYKg+KK6AH+D4utg== +"@babel/plugin-transform-named-capturing-groups-regex@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.16.8.tgz#7f860e0e40d844a02c9dcf9d84965e7dfd666252" + integrity sha512-j3Jw+n5PvpmhRR+mrgIh04puSANCk/T/UA3m3P1MjJkhlK906+ApHhDIqBQDdOgL/r1UYpz4GNclTXxyZrYGSw== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.16.7" @@ -803,18 +822,18 @@ "@babel/helper-create-regexp-features-plugin" "^7.16.7" "@babel/helper-plugin-utils" "^7.16.7" -"@babel/preset-env@^7.16.0", "@babel/preset-env@^7.16.5", "@babel/preset-env@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.16.7.tgz#c491088856d0b3177822a2bf06cb74d76327aa56" - integrity sha512-urX3Cee4aOZbRWOSa3mKPk0aqDikfILuo+C7qq7HY0InylGNZ1fekq9jmlr3pLWwZHF4yD7heQooc2Pow2KMyQ== +"@babel/preset-env@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.16.8.tgz#e682fa0bcd1cf49621d64a8956318ddfb9a05af9" + integrity sha512-9rNKgVCdwHb3z1IlbMyft6yIXIeP3xz6vWvGaLHrJThuEIqWfHb0DNBH9VuTgnDfdbUDhkmkvMZS/YMCtP7Elg== dependencies: - "@babel/compat-data" "^7.16.4" + "@babel/compat-data" "^7.16.8" "@babel/helper-compilation-targets" "^7.16.7" "@babel/helper-plugin-utils" "^7.16.7" "@babel/helper-validator-option" "^7.16.7" "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.16.7" "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.16.7" - "@babel/plugin-proposal-async-generator-functions" "^7.16.7" + "@babel/plugin-proposal-async-generator-functions" "^7.16.8" "@babel/plugin-proposal-class-properties" "^7.16.7" "@babel/plugin-proposal-class-static-block" "^7.16.7" "@babel/plugin-proposal-dynamic-import" "^7.16.7" @@ -844,7 +863,7 @@ "@babel/plugin-syntax-private-property-in-object" "^7.14.5" "@babel/plugin-syntax-top-level-await" "^7.14.5" "@babel/plugin-transform-arrow-functions" "^7.16.7" - "@babel/plugin-transform-async-to-generator" "^7.16.7" + "@babel/plugin-transform-async-to-generator" "^7.16.8" "@babel/plugin-transform-block-scoped-functions" "^7.16.7" "@babel/plugin-transform-block-scoping" "^7.16.7" "@babel/plugin-transform-classes" "^7.16.7" @@ -858,10 +877,10 @@ "@babel/plugin-transform-literals" "^7.16.7" "@babel/plugin-transform-member-expression-literals" "^7.16.7" "@babel/plugin-transform-modules-amd" "^7.16.7" - "@babel/plugin-transform-modules-commonjs" "^7.16.7" + "@babel/plugin-transform-modules-commonjs" "^7.16.8" "@babel/plugin-transform-modules-systemjs" "^7.16.7" "@babel/plugin-transform-modules-umd" "^7.16.7" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.16.7" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.16.8" "@babel/plugin-transform-new-target" "^7.16.7" "@babel/plugin-transform-object-super" "^7.16.7" "@babel/plugin-transform-parameters" "^7.16.7" @@ -876,11 +895,11 @@ "@babel/plugin-transform-unicode-escapes" "^7.16.7" "@babel/plugin-transform-unicode-regex" "^7.16.7" "@babel/preset-modules" "^0.1.5" - "@babel/types" "^7.16.7" + "@babel/types" "^7.16.8" babel-plugin-polyfill-corejs2 "^0.3.0" - babel-plugin-polyfill-corejs3 "^0.4.0" + babel-plugin-polyfill-corejs3 "^0.5.0" babel-plugin-polyfill-regenerator "^0.3.0" - core-js-compat "^3.19.1" + core-js-compat "^3.20.2" semver "^6.3.0" "@babel/preset-modules@^0.1.5": @@ -935,6 +954,22 @@ debug "^4.1.0" globals "^11.1.0" +"@babel/traverse@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.8.tgz#bab2f2b09a5fe8a8d9cad22cbfe3ba1d126fef9c" + integrity sha512-xe+H7JlvKsDQwXRsBhSnq1/+9c+LlQcCK3Tn/l5sbx02HYns/cn7ibp9+RV1sIUqu7hKg91NWsgHurO9dowITQ== + dependencies: + "@babel/code-frame" "^7.16.7" + "@babel/generator" "^7.16.8" + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-function-name" "^7.16.7" + "@babel/helper-hoist-variables" "^7.16.7" + "@babel/helper-split-export-declaration" "^7.16.7" + "@babel/parser" "^7.16.8" + "@babel/types" "^7.16.8" + debug "^4.1.0" + globals "^11.1.0" + "@babel/types@^7.0.0", "@babel/types@^7.16.0", "@babel/types@^7.16.7", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.7.tgz#4ed19d51f840ed4bd5645be6ce40775fecf03159" @@ -943,15 +978,23 @@ "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" +"@babel/types@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.8.tgz#0ba5da91dd71e0a4e7781a30f22770831062e3c1" + integrity sha512-smN2DQc5s4M7fntyjGtyIPbRJv6wW4rU/94fmYJ7PKQuZkC0qGMHXJbg6sNGt12JmVr4k5YaptI/XtiLJBnmIg== + dependencies: + "@babel/helper-validator-identifier" "^7.16.7" + to-fast-properties "^2.0.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@commitlint/cli@^16.0.1": - version "16.0.1" - resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-16.0.1.tgz#21905c898ebece7da42277209022b1bc80c4fb39" - integrity sha512-61gGRy65WiVDRsqP0dAR2fAgE3qrTBW3fgz9MySv32y5Ib3ZXXDDq6bGyQqi2dSaPuDYzNCRwwlC7mmQM73T/g== +"@commitlint/cli@^16.0.2": + version "16.0.2" + resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-16.0.2.tgz#393b03793fc59b93e5f4dd7dd535a6cc5a7413ca" + integrity sha512-Jt7iaBjoLGC5Nq4dHPTvTYnqPGkElFPBtTXTvBpTgatZApczyjI2plE0oG4GYWPp1suHIS/VdVDOMpPZjGVusg== dependencies: "@commitlint/format" "^16.0.0" "@commitlint/lint" "^16.0.0" @@ -1690,14 +1733,14 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.9.0.tgz#382182d5cb062f52aac54434cfc47c28898c8006" - integrity sha512-qT4lr2jysDQBQOPsCCvpPUZHjbABoTJW8V9ZzIYKHMfppJtpdtzszDYsldwhFxlhvrp7aCHeXD1Lb9M1zhwWwQ== +"@typescript-eslint/eslint-plugin@^5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.9.1.tgz#e5a86d7e1f9dc0b3df1e6d94feaf20dd838d066c" + integrity sha512-Xv9tkFlyD4MQGpJgTo6wqDqGvHIRmRgah/2Sjz1PUnJTawjHWIwBivUE9x0QtU2WVii9baYgavo/bHjrZJkqTw== dependencies: - "@typescript-eslint/experimental-utils" "5.9.0" - "@typescript-eslint/scope-manager" "5.9.0" - "@typescript-eslint/type-utils" "5.9.0" + "@typescript-eslint/experimental-utils" "5.9.1" + "@typescript-eslint/scope-manager" "5.9.1" + "@typescript-eslint/type-utils" "5.9.1" debug "^4.3.2" functional-red-black-tree "^1.0.1" ignore "^5.1.8" @@ -1705,69 +1748,69 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.9.0.tgz#652762d37d6565ef07af285021b8347b6c79a827" - integrity sha512-ZnLVjBrf26dn7ElyaSKa6uDhqwvAi4jBBmHK1VxuFGPRAxhdi18ubQYSGA7SRiFiES3q9JiBOBHEBStOFkwD2g== +"@typescript-eslint/experimental-utils@5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.9.1.tgz#8c407c4dd5ffe522329df6e4c9c2b52206d5f7f1" + integrity sha512-cb1Njyss0mLL9kLXgS/eEY53SZQ9sT519wpX3i+U457l2UXRDuo87hgKfgRazmu9/tQb0x2sr3Y0yrU+Zz0y+w== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.9.0" - "@typescript-eslint/types" "5.9.0" - "@typescript-eslint/typescript-estree" "5.9.0" + "@typescript-eslint/scope-manager" "5.9.1" + "@typescript-eslint/types" "5.9.1" + "@typescript-eslint/typescript-estree" "5.9.1" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/parser@^5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.9.0.tgz#fdbb08767a4caa6ca6ccfed5f9ffe9387f0c7d97" - integrity sha512-/6pOPz8yAxEt4PLzgbFRDpZmHnXCeZgPDrh/1DaVKOjvn/UPMlWhbx/gA96xRi2JxY1kBl2AmwVbyROUqys5xQ== +"@typescript-eslint/parser@^5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.9.1.tgz#b114011010a87e17b3265ca715e16c76a9834cef" + integrity sha512-PLYO0AmwD6s6n0ZQB5kqPgfvh73p0+VqopQQLuNfi7Lm0EpfKyDalchpVwkE+81k5HeiRrTV/9w1aNHzjD7C4g== dependencies: - "@typescript-eslint/scope-manager" "5.9.0" - "@typescript-eslint/types" "5.9.0" - "@typescript-eslint/typescript-estree" "5.9.0" + "@typescript-eslint/scope-manager" "5.9.1" + "@typescript-eslint/types" "5.9.1" + "@typescript-eslint/typescript-estree" "5.9.1" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.9.0.tgz#02dfef920290c1dcd7b1999455a3eaae7a1a3117" - integrity sha512-DKtdIL49Qxk2a8icF6whRk7uThuVz4A6TCXfjdJSwOsf+9ree7vgQWcx0KOyCdk0i9ETX666p4aMhrRhxhUkyg== +"@typescript-eslint/scope-manager@5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.9.1.tgz#6c27be89f1a9409f284d95dfa08ee3400166fe69" + integrity sha512-8BwvWkho3B/UOtzRyW07ffJXPaLSUKFBjpq8aqsRvu6HdEuzCY57+ffT7QoV4QXJXWSU1+7g3wE4AlgImmQ9pQ== dependencies: - "@typescript-eslint/types" "5.9.0" - "@typescript-eslint/visitor-keys" "5.9.0" + "@typescript-eslint/types" "5.9.1" + "@typescript-eslint/visitor-keys" "5.9.1" -"@typescript-eslint/type-utils@5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.9.0.tgz#fd5963ead04bc9b7af9c3a8e534d8d39f1ce5f93" - integrity sha512-uVCb9dJXpBrK1071ri5aEW7ZHdDHAiqEjYznF3HSSvAJXyrkxGOw2Ejibz/q6BXdT8lea8CMI0CzKNFTNI6TEQ== +"@typescript-eslint/type-utils@5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.9.1.tgz#c6832ffe655b9b1fec642d36db1a262d721193de" + integrity sha512-tRSpdBnPRssjlUh35rE9ug5HrUvaB9ntREy7gPXXKwmIx61TNN7+l5YKgi1hMKxo5NvqZCfYhA5FvyuJG6X6vg== dependencies: - "@typescript-eslint/experimental-utils" "5.9.0" + "@typescript-eslint/experimental-utils" "5.9.1" debug "^4.3.2" tsutils "^3.21.0" -"@typescript-eslint/types@5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.9.0.tgz#e5619803e39d24a03b3369506df196355736e1a3" - integrity sha512-mWp6/b56Umo1rwyGCk8fPIzb9Migo8YOniBGPAQDNC6C52SeyNGN4gsVwQTAR+RS2L5xyajON4hOLwAGwPtUwg== +"@typescript-eslint/types@5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.9.1.tgz#1bef8f238a2fb32ebc6ff6d75020d9f47a1593c6" + integrity sha512-SsWegWudWpkZCwwYcKoDwuAjoZXnM1y2EbEerTHho19Hmm+bQ56QG4L4jrtCu0bI5STaRTvRTZmjprWlTw/5NQ== -"@typescript-eslint/typescript-estree@5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.0.tgz#0e5c6f03f982931abbfbc3c1b9df5fbf92a3490f" - integrity sha512-kxo3xL2mB7XmiVZcECbaDwYCt3qFXz99tBSuVJR4L/sR7CJ+UNAPrYILILktGj1ppfZ/jNt/cWYbziJUlHl1Pw== +"@typescript-eslint/typescript-estree@5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.1.tgz#d5b996f49476495070d2b8dd354861cf33c005d6" + integrity sha512-gL1sP6A/KG0HwrahVXI9fZyeVTxEYV//6PmcOn1tD0rw8VhUWYeZeuWHwwhnewnvEMcHjhnJLOBhA9rK4vmb8A== dependencies: - "@typescript-eslint/types" "5.9.0" - "@typescript-eslint/visitor-keys" "5.9.0" + "@typescript-eslint/types" "5.9.1" + "@typescript-eslint/visitor-keys" "5.9.1" debug "^4.3.2" globby "^11.0.4" is-glob "^4.0.3" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@5.9.0": - version "5.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.0.tgz#7585677732365e9d27f1878150fab3922784a1a6" - integrity sha512-6zq0mb7LV0ThExKlecvpfepiB+XEtFv/bzx7/jKSgyXTFD7qjmSu1FoiS0x3OZaiS+UIXpH2vd9O89f02RCtgw== +"@typescript-eslint/visitor-keys@5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.1.tgz#f52206f38128dd4f675cf28070a41596eee985b7" + integrity sha512-Xh37pNz9e9ryW4TVdwiFzmr4hloty8cFj8GTWMXh3Z8swGwyQWeCcNgF0hm6t09iZd6eiZmIf4zHedQVP6TVtg== dependencies: - "@typescript-eslint/types" "5.9.0" + "@typescript-eslint/types" "5.9.1" eslint-visitor-keys "^3.0.0" JSONStream@^1.0.4: @@ -2131,13 +2174,13 @@ babel-plugin-polyfill-corejs2@^0.3.0: "@babel/helper-define-polyfill-provider" "^0.3.0" semver "^6.1.1" -babel-plugin-polyfill-corejs3@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.4.0.tgz#0b571f4cf3d67f911512f5c04842a7b8e8263087" - integrity sha512-YxFreYwUfglYKdLUGvIF2nJEsGwj+RhWSX/ije3D2vQPOXuyMLMtg/cCGMDpOA7Nd+MwlNdnGODbd2EwUZPlsw== +babel-plugin-polyfill-corejs3@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.0.tgz#f81371be3fe499d39e074e272a1ef86533f3d268" + integrity sha512-Hcrgnmkf+4JTj73GbK3bBhlVPiLL47owUAnoJIf69Hakl3q+KfodbDXiZWGMM7iqCZTxCG3Z2VRfPNYES4rXqQ== dependencies: "@babel/helper-define-polyfill-provider" "^0.3.0" - core-js-compat "^3.18.0" + core-js-compat "^3.20.0" babel-plugin-polyfill-regenerator@^0.3.0: version "0.3.0" @@ -2867,7 +2910,7 @@ convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: dependencies: safe-buffer "~5.1.1" -core-js-compat@^3.18.0, core-js-compat@^3.19.1: +core-js-compat@^3.20.0, core-js-compat@^3.20.2: version "3.20.2" resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.20.2.tgz#d1ff6936c7330959b46b2e08b122a8b14e26140b" integrity sha512-qZEzVQ+5Qh6cROaTPFLNS4lkvQ6mBzE3R6A6EEpssj7Zr2egMHgsy4XapdifqJDGC9CBiNv7s+ejI96rLNQFdg== @@ -3431,17 +3474,17 @@ escodegen@^2.0.0: optionalDependencies: source-map "~0.6.1" -eslint-config-aqua@^9.0.2: - version "9.0.2" - resolved "https://registry.yarnpkg.com/eslint-config-aqua/-/eslint-config-aqua-9.0.2.tgz#bc26093dd2292b0dfe9aa9ed6bac5247994d0a22" - integrity sha512-WqV4EYX3pXoL0TkUBH9VVHoWjR3eJ0ud1p5OmSfbRoyjDbUJURs78fpeU4H8t88pO8mFB4SHTZM95DJEwKG/MQ== - -eslint-config-marine@^9.0.6, eslint-config-marine@^9.1.0: +eslint-config-aqua@^9.1.0: version "9.1.0" - resolved "https://registry.yarnpkg.com/eslint-config-marine/-/eslint-config-marine-9.1.0.tgz#3d6f917c1de47f3d922fe19403e5fc712b5bbb68" - integrity sha512-27gCRgmWB1XL+DIa3+RX0qSVVk4UZP36fG72loDxkt71M4sl6TUE/w8NqsbF+G3S72jGY0fHIpXBVDMvTJIbDA== + resolved "https://registry.yarnpkg.com/eslint-config-aqua/-/eslint-config-aqua-9.1.0.tgz#c56241f4d7c4f4113508c558fc9864966bb1281a" + integrity sha512-l3ry74+qkpyy8JGkmoMZdgIeiQuxc/tjm5lzJQtrgE9a6VYzrQH2ZSkRw1q/zrDQH2v0PZc8PWvVITbApRuE0w== + +eslint-config-marine@^9.3.2: + version "9.3.2" + resolved "https://registry.yarnpkg.com/eslint-config-marine/-/eslint-config-marine-9.3.2.tgz#225728b0033486fdc266ccafe192f0eefae43a55" + integrity sha512-MlddXjkZ1h/XqyN2/5nDqrwKGtD1lVVFvTRSNWCnjsJeyHA4GgUhNQoV14BMk5D5tx0AN1A0bTcAuPckOpFvjw== dependencies: - eslint-config-aqua "^9.0.2" + eslint-config-aqua "^9.1.0" eslint-config-prettier@^8.3.0: version "8.3.0" @@ -7667,7 +7710,7 @@ turbo-windows-64@1.0.24: resolved "https://registry.yarnpkg.com/turbo-windows-64/-/turbo-windows-64-1.0.24.tgz#5dd30b10110f2bb69caa479ddd72b4c471fb0dea" integrity sha512-YHAWha5XkW0Ate1HtwhzFD32kZFXtC8KB4ReEvHc9GM2inQob1ZinvktS0xi5MC5Sxl9+bObOWmsxeZPOgNCFA== -turbo@^1.0.24: +turbo@1.0.24: version "1.0.24" resolved "https://registry.yarnpkg.com/turbo/-/turbo-1.0.24.tgz#5efdeb44aab2f5e97b24a3e0ed4a159bfcd0a877" integrity sha512-bfOr7iW48+chDl+yKiZ5FIWzXOF6xOIyrAGPaWI+I5CdD27IZCEGvqvTV/weaHvjLbV7otybHQ56XCybBlVjoA==