chore: Adds initial support for eslint.

This commit is contained in:
greysoh 2024-05-10 11:46:22 -04:00
parent d57a2a4a1d
commit ba245d2987
No known key found for this signature in database
GPG key ID: FE0F173B8FC01571
34 changed files with 3441 additions and 649 deletions

View file

@ -1,3 +1,5 @@
// @eslint-ignore-file
export type ParameterReturnedValue = {
success: boolean;
message?: string;

View file

@ -10,4 +10,4 @@ export const backendProviders: Record<string, typeof BackendBaseClass> = {
if (process.env.NODE_ENV != "production") {
backendProviders["dummy"] = BackendBaseClass;
}
}

View file

@ -216,7 +216,7 @@ export class PassyFireBackendProvider implements BackendBaseClass {
static checkParametersBackendInstance(data: string): ParameterReturnedValue {
try {
parseBackendProviderString(data);
// @ts-ignore
// @ts-expect-error
} catch (e: Error) {
return {
success: false,

View file

@ -69,7 +69,7 @@ export function route(instance: PassyFireBackendProvider) {
},
},
(req, res) => {
// @ts-ignore
// @ts-expect-error
const body: {
username: string;
password: string;
@ -115,7 +115,7 @@ export function route(instance: PassyFireBackendProvider) {
},
},
async (req, res) => {
// @ts-ignore
// @ts-expect-error
const body: {
token: string;
} = req.body;
@ -132,7 +132,7 @@ export function route(instance: PassyFireBackendProvider) {
req.hostname.indexOf(":") + 1,
);
// @ts-ignore
// @ts-expect-error
// parseInt(...) can take a number just fine, at least in Node.JS
const port = parseInt(unparsedPort == "" ? proxiedPort : unparsedPort);

View file

@ -57,7 +57,7 @@ export function requestHandler(
let state: "authentication" | "data" = "authentication";
let socket: dgram.Socket | net.Socket | undefined;
// @ts-ignore
// @ts-expect-error
let connectedClient: ConnectedClientExt = {};
ws.on("close", () => {

View file

@ -92,7 +92,7 @@ export class SSHBackendProvider implements BackendBaseClass {
this.logs.push(`Failed to start SSHBackendProvider! Error: '${e}'`);
this.state = "stopped";
// @ts-ignore
// @ts-expect-error
this.sshInstance = null;
return false;
@ -112,7 +112,7 @@ export class SSHBackendProvider implements BackendBaseClass {
this.sshInstance.dispose();
// @ts-ignore
// @ts-expect-error
this.sshInstance = null;
this.logs.push("Successfully stopped SSHBackendProvider.");
@ -255,7 +255,7 @@ export class SSHBackendProvider implements BackendBaseClass {
static checkParametersBackendInstance(data: string): ParameterReturnedValue {
try {
parseBackendProviderString(data);
// @ts-ignore
// @ts-expect-error
} catch (e: Error) {
return {
success: false,

View file

@ -27,7 +27,7 @@ export const permissionListDisabled: Record<string, boolean> = {
};
// FIXME: This solution fucking sucks.
export let permissionListEnabled: Record<string, boolean> = JSON.parse(
export const permissionListEnabled: Record<string, boolean> = JSON.parse(
JSON.stringify(permissionListDisabled),
);

View file

@ -35,7 +35,7 @@ export function route(routeOptions: RouteOptions) {
},
},
async (req, res) => {
// @ts-ignore
// @ts-expect-error
const body: {
token: string;
name: string;

View file

@ -33,7 +33,7 @@ export function route(routeOptions: RouteOptions) {
},
},
async (req, res) => {
// @ts-ignore
// @ts-expect-error
const body: {
token: string;
id?: number;

View file

@ -30,7 +30,7 @@ export function route(routeOptions: RouteOptions) {
},
},
async (req, res) => {
// @ts-ignore
// @ts-expect-error
const body: {
token: string;
id: number;

View file

@ -27,7 +27,7 @@ export function route(routeOptions: RouteOptions) {
},
},
async (req, res) => {
// @ts-ignore
// @ts-expect-error
const body: {
token: string;
id: number;

View file

@ -50,7 +50,7 @@ export function route(routeOptions: RouteOptions) {
},
},
async (req, res) => {
// @ts-ignore
// @ts-expect-error
const body: {
token: string;

View file

@ -41,7 +41,7 @@ export function route(routeOptions: RouteOptions) {
},
},
async (req, res) => {
// @ts-ignore
// @ts-expect-error
const body: {
token: string;

View file

@ -30,7 +30,7 @@ export function route(routeOptions: RouteOptions) {
},
},
async (req, res) => {
// @ts-ignore
// @ts-expect-error
const body: {
token: string;
id: number;

View file

@ -30,7 +30,7 @@ export function route(routeOptions: RouteOptions) {
},
},
async (req, res) => {
// @ts-ignore
// @ts-expect-error
const body: {
token: string;
id: number;
@ -59,7 +59,7 @@ export function route(routeOptions: RouteOptions) {
});
// Other restrictions in place make it so that it MUST be either TCP or UDP
// @ts-ignore
// @ts-expect-error
const protocol: "tcp" | "udp" = forward.protocol;
backends[forward.destProviderID].addConnection(

View file

@ -30,7 +30,7 @@ export function route(routeOptions: RouteOptions) {
},
},
async (req, res) => {
// @ts-ignore
// @ts-expect-error
const body: {
token: string;
id: number;
@ -59,7 +59,7 @@ export function route(routeOptions: RouteOptions) {
});
// Other restrictions in place make it so that it MUST be either TCP or UDP
// @ts-ignore
// @ts-expect-error
const protocol: "tcp" | "udp" = forward.protocol;
backends[forward.destProviderID].removeConnection(

View file

@ -22,7 +22,7 @@ export function route(routeOptions: RouteOptions) {
},
},
async (req, res) => {
// @ts-ignore
// @ts-expect-error
const body: {
token: string;
} = req.body;

View file

@ -29,7 +29,7 @@ export function route(routeOptions: RouteOptions) {
},
},
async (req, res) => {
// @ts-ignore
// @ts-expect-error
const body: {
name: string;
email: string;
@ -87,9 +87,9 @@ export function route(routeOptions: RouteOptions) {
}
if (options.allowUnsafeGlobalTokens) {
// @ts-ignore
// @ts-expect-error
userData.rootToken = generateRandomData();
// @ts-ignore
// @ts-expect-error
userData.isRootServiceAccount = true;
}

View file

@ -26,7 +26,7 @@ export function route(routeOptions: RouteOptions) {
},
},
async (req, res) => {
// @ts-ignore
// @ts-expect-error
const body: {
email?: string;
username?: string;

View file

@ -31,7 +31,7 @@ export function route(routeOptions: RouteOptions) {
},
},
async (req, res) => {
// @ts-ignore
// @ts-expect-error
const body: {
token: string;
id?: number;

View file

@ -30,7 +30,7 @@ export function route(routeOptions: RouteOptions) {
},
},
async (req, res) => {
// @ts-ignore
// @ts-expect-error
const body: {
token: string;
uid: number;