mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
refactor: use eslint-config-neon for packages. (#8579)
Co-authored-by: Noel <buechler.noel@outlook.com>
This commit is contained in:
@@ -1,11 +1,18 @@
|
||||
import { URL } from 'node:url';
|
||||
import { DiscordAPIError, HTTPError, RateLimitError, RequestMethod, REST, RouteLike } from '@discordjs/rest';
|
||||
import {
|
||||
DiscordAPIError,
|
||||
HTTPError,
|
||||
RateLimitError,
|
||||
type RequestMethod,
|
||||
type REST,
|
||||
type RouteLike,
|
||||
} from '@discordjs/rest';
|
||||
import {
|
||||
populateAbortErrorResponse,
|
||||
populateGeneralErrorResponse,
|
||||
populateSuccessfulResponse,
|
||||
populateRatelimitErrorResponse,
|
||||
} from '../util/responseHelpers';
|
||||
} from '../util/responseHelpers.js';
|
||||
import type { RequestHandler } from '../util/util';
|
||||
|
||||
/**
|
||||
@@ -25,6 +32,7 @@ export function proxyRequests(rest: REST): RequestHandler {
|
||||
|
||||
// The 2nd parameter is here so the URL constructor doesn't complain about an "invalid url" when the origin is missing
|
||||
// we don't actually care about the origin and the value passed is irrelevant
|
||||
// eslint-disable-next-line prefer-named-capture-group, unicorn/no-unsafe-regex
|
||||
const fullRoute = new URL(url, 'http://noop').pathname.replace(/^\/api(\/v\d+)?/, '') as RouteLike;
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user