chore: Adds initial support for eslint.
This commit is contained in:
parent
d57a2a4a1d
commit
ba245d2987
34 changed files with 3441 additions and 649 deletions
|
@ -1,3 +1,5 @@
|
|||
// @eslint-ignore-file
|
||||
|
||||
export type ParameterReturnedValue = {
|
||||
success: boolean;
|
||||
message?: string;
|
||||
|
|
|
@ -10,4 +10,4 @@ export const backendProviders: Record<string, typeof BackendBaseClass> = {
|
|||
|
||||
if (process.env.NODE_ENV != "production") {
|
||||
backendProviders["dummy"] = BackendBaseClass;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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),
|
||||
);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ export function route(routeOptions: RouteOptions) {
|
|||
},
|
||||
},
|
||||
async (req, res) => {
|
||||
// @ts-ignore
|
||||
// @ts-expect-error
|
||||
const body: {
|
||||
token: string;
|
||||
name: string;
|
||||
|
|
|
@ -33,7 +33,7 @@ export function route(routeOptions: RouteOptions) {
|
|||
},
|
||||
},
|
||||
async (req, res) => {
|
||||
// @ts-ignore
|
||||
// @ts-expect-error
|
||||
const body: {
|
||||
token: string;
|
||||
id?: number;
|
||||
|
|
|
@ -30,7 +30,7 @@ export function route(routeOptions: RouteOptions) {
|
|||
},
|
||||
},
|
||||
async (req, res) => {
|
||||
// @ts-ignore
|
||||
// @ts-expect-error
|
||||
const body: {
|
||||
token: string;
|
||||
id: number;
|
||||
|
|
|
@ -27,7 +27,7 @@ export function route(routeOptions: RouteOptions) {
|
|||
},
|
||||
},
|
||||
async (req, res) => {
|
||||
// @ts-ignore
|
||||
// @ts-expect-error
|
||||
const body: {
|
||||
token: string;
|
||||
id: number;
|
||||
|
|
|
@ -50,7 +50,7 @@ export function route(routeOptions: RouteOptions) {
|
|||
},
|
||||
},
|
||||
async (req, res) => {
|
||||
// @ts-ignore
|
||||
// @ts-expect-error
|
||||
const body: {
|
||||
token: string;
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ export function route(routeOptions: RouteOptions) {
|
|||
},
|
||||
},
|
||||
async (req, res) => {
|
||||
// @ts-ignore
|
||||
// @ts-expect-error
|
||||
const body: {
|
||||
token: string;
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ export function route(routeOptions: RouteOptions) {
|
|||
},
|
||||
},
|
||||
async (req, res) => {
|
||||
// @ts-ignore
|
||||
// @ts-expect-error
|
||||
const body: {
|
||||
token: string;
|
||||
id: number;
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -22,7 +22,7 @@ export function route(routeOptions: RouteOptions) {
|
|||
},
|
||||
},
|
||||
async (req, res) => {
|
||||
// @ts-ignore
|
||||
// @ts-expect-error
|
||||
const body: {
|
||||
token: string;
|
||||
} = req.body;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ export function route(routeOptions: RouteOptions) {
|
|||
},
|
||||
},
|
||||
async (req, res) => {
|
||||
// @ts-ignore
|
||||
// @ts-expect-error
|
||||
const body: {
|
||||
email?: string;
|
||||
username?: string;
|
||||
|
|
|
@ -31,7 +31,7 @@ export function route(routeOptions: RouteOptions) {
|
|||
},
|
||||
},
|
||||
async (req, res) => {
|
||||
// @ts-ignore
|
||||
// @ts-expect-error
|
||||
const body: {
|
||||
token: string;
|
||||
id?: number;
|
||||
|
|
|
@ -30,7 +30,7 @@ export function route(routeOptions: RouteOptions) {
|
|||
},
|
||||
},
|
||||
async (req, res) => {
|
||||
// @ts-ignore
|
||||
// @ts-expect-error
|
||||
const body: {
|
||||
token: string;
|
||||
uid: number;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue