chore: remove usage of the prefer-global rules (#11279)

This commit is contained in:
Denis-Adrian Cristea
2025-12-10 16:05:29 +02:00
committed by GitHub
parent 548d75258b
commit 9bf1f739e0
43 changed files with 64 additions and 66 deletions

View File

@@ -1,6 +1,5 @@
/* eslint-disable id-length */
/* eslint-disable promise/prefer-await-to-then */
import { performance } from 'node:perf_hooks';
import { MockAgent, setGlobalDispatcher } from 'undici';
import type { Interceptable, MockInterceptor } from 'undici/types/mock-interceptor';
import { beforeEach, afterEach, test, expect } from 'vitest';

View File

@@ -1,4 +1,3 @@
import { URLSearchParams } from 'node:url';
import { test, expect } from 'vitest';
import { DiscordAPIError } from '../src/index.js';

View File

@@ -1,5 +1,4 @@
import { Buffer, File } from 'node:buffer';
import { URLSearchParams } from 'node:url';
import { Buffer } from 'node:buffer';
import { DiscordSnowflake } from '@sapphire/snowflake';
import type { Snowflake } from 'discord-api-types/v10';
import { Routes } from 'discord-api-types/v10';

View File

@@ -1,7 +1,5 @@
/* eslint-disable id-length */
/* eslint-disable promise/prefer-await-to-then */
import { performance } from 'node:perf_hooks';
import { setInterval, clearInterval } from 'node:timers';
import { MockAgent, setGlobalDispatcher } from 'undici';
import type { Interceptable, MockInterceptor } from 'undici/types/mock-interceptor.js';
import { beforeEach, afterEach, test, expect, vitest } from 'vitest';

View File

@@ -1,5 +1,4 @@
import { Blob, Buffer } from 'node:buffer';
import { URLSearchParams } from 'node:url';
import { MockAgent, setGlobalDispatcher, FormData as UndiciFormData } from 'undici';
import type { Interceptable, MockInterceptor } from 'undici/types/mock-interceptor.js';
import { beforeEach, afterEach, test, expect, vitest } from 'vitest';

View File

@@ -1,3 +1,5 @@
/* eslint-disable n/prefer-global/process */
import type { RequestInit } from 'undici';
import type { REST } from '../REST.js';
import type { DiscordErrorData, OAuthErrorData } from '../errors/DiscordAPIError.js';

View File

@@ -1,3 +1,4 @@
import type { Buffer } from 'node:buffer';
import type { RESTPatchAPIChannelJSONBody, Snowflake } from 'discord-api-types/v10';
import type { REST } from '../REST.js';
import { RateLimitError } from '../errors/RateLimitError.js';

View File

@@ -1,5 +1,5 @@
import { Buffer } from 'node:buffer';
import { STATUS_CODES } from 'node:http';
import { URLSearchParams } from 'node:url';
import { types } from 'node:util';
import { type RequestInit, request, Headers, FormData as UndiciFormData, Agent } from 'undici';
import type { HeaderRecord } from 'undici/types/header.js';