mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-14 14:34:13 +00:00
Enable various eslint rules (#1773)
## Description: Enable various eslint rules. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced
This commit is contained in:
+11
-11
@@ -8,39 +8,39 @@ const log = logger.child({
|
||||
module: "cloudflare",
|
||||
});
|
||||
|
||||
export interface TunnelConfig {
|
||||
export type TunnelConfig = {
|
||||
domain: string;
|
||||
subdomain: string;
|
||||
subdomainToService: Map<string, string>;
|
||||
}
|
||||
};
|
||||
|
||||
interface TunnelResponse {
|
||||
type TunnelResponse = {
|
||||
result: {
|
||||
id: string;
|
||||
token: string;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
interface ZoneResponse {
|
||||
type ZoneResponse = {
|
||||
result: Array<{
|
||||
id: string;
|
||||
}>;
|
||||
}
|
||||
};
|
||||
|
||||
interface DNSRecordResponse {
|
||||
type DNSRecordResponse = {
|
||||
result: Array<{
|
||||
id: string;
|
||||
}>;
|
||||
}
|
||||
};
|
||||
|
||||
interface CloudflaredConfig {
|
||||
type CloudflaredConfig = {
|
||||
tunnel: string;
|
||||
"credentials-file": string;
|
||||
ingress: Array<{
|
||||
hostname?: string;
|
||||
service: string;
|
||||
}>;
|
||||
}
|
||||
};
|
||||
|
||||
const CloudflareTunnelConfigSchema = z.object({
|
||||
a: z.string(),
|
||||
@@ -63,7 +63,7 @@ export class Cloudflare {
|
||||
|
||||
private async makeRequest<T>(
|
||||
url: string,
|
||||
method: string = "GET",
|
||||
method = "GET",
|
||||
data?: any,
|
||||
): Promise<T> {
|
||||
const response = await fetch(url, {
|
||||
|
||||
@@ -12,7 +12,7 @@ export enum LimiterType {
|
||||
WebSocket = "websocket",
|
||||
}
|
||||
|
||||
export interface Gatekeeper {
|
||||
export type Gatekeeper = {
|
||||
// The wrapper for request handlers with optional rate limiting
|
||||
httpHandler: (
|
||||
limiterType: LimiterType,
|
||||
@@ -24,7 +24,7 @@ export interface Gatekeeper {
|
||||
req: http.IncomingMessage | string,
|
||||
fn: (message: string) => Promise<void>,
|
||||
) => (message: string) => Promise<void>;
|
||||
}
|
||||
};
|
||||
|
||||
let gk: Gatekeeper | null = null;
|
||||
|
||||
|
||||
@@ -49,10 +49,10 @@ const frequency: Partial<Record<GameMapName, number>> = {
|
||||
Yenisei: 1,
|
||||
};
|
||||
|
||||
interface MapWithMode {
|
||||
type MapWithMode = {
|
||||
map: GameMapType;
|
||||
mode: GameMode;
|
||||
}
|
||||
};
|
||||
|
||||
const TEAM_COUNTS = [
|
||||
2,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Cosmetics, Pattern } from "../core/CosmeticSchemas";
|
||||
import { PatternDecoder } from "../core/PatternDecoder";
|
||||
|
||||
export interface PrivilegeChecker {
|
||||
export type PrivilegeChecker = {
|
||||
isPatternAllowed(
|
||||
base64: string,
|
||||
flares: readonly string[] | undefined,
|
||||
@@ -10,7 +10,7 @@ export interface PrivilegeChecker {
|
||||
flag: string,
|
||||
flares: readonly string[] | undefined,
|
||||
): true | "restricted" | "invalid";
|
||||
}
|
||||
};
|
||||
|
||||
export class PrivilegeCheckerImpl implements PrivilegeChecker {
|
||||
private b64ToPattern: Record<string, Pattern> = {};
|
||||
|
||||
Reference in New Issue
Block a user