Skip to content

Commit

Permalink
Silenced a bunch of linting errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
lancegliser committed Sep 18, 2024
1 parent 334a608 commit 09cb4bd
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 28 deletions.
15 changes: 11 additions & 4 deletions src/client/wasm/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import { batcher, BatchOptions, CacheMap, isNode } from "../utilities/index";
import { AmalgamCoreResponse, prepareCoreRequest, prepareCoreResponse } from "./core";
import { FileSystemClient } from "./files";

/* eslint-disable-next-line @typescript-eslint/no-empty-object-type */
export interface TraineeCache extends TraineeBaseCache {}

export interface ClientOptions {
Expand Down Expand Up @@ -469,9 +470,12 @@ export class WasmClient extends BaseClient implements ITraineeClient, ISessionCl

/**
* Update a trainee's properties.
* @param _trainee The trainee identifier.
* @param trainee The trainee identifier.
*/
public async updateTrainee(_trainee: Trainee): Promise<Trainee> {
public async updateTrainee(
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
trainee: Trainee,
): Promise<Trainee> {
throw new Error("Method not implemented.");
}

Expand Down Expand Up @@ -505,9 +509,12 @@ export class WasmClient extends BaseClient implements ITraineeClient, ISessionCl

/**
* List existing trainees.
* @param _keywords Keywords to filter the list of trainees by.
* @param keywords Keywords to filter the list of trainees by.
*/
public async listTrainees(_keywords: string | string[]): Promise<TraineeIdentity[]> {
public async listTrainees(
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
keywords: string | string[],
): Promise<TraineeIdentity[]> {
throw new Error("Method not implemented.");
}

Expand Down
10 changes: 2 additions & 8 deletions src/client/wasm/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ export interface AmalgamCoreResponse<R = unknown> {
* @param payload The core payload.
* @returns The updated core payload.
*/
export function prepareCoreRequest(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
payload: any,
) {
export function prepareCoreRequest(payload: any) {
if (!payload) {
return payload;
}
Expand All @@ -44,10 +41,7 @@ export function prepareCoreRequest(
* @param data The core response.
* @returns The updated core response.
*/
export function prepareCoreResponse<R = unknown>(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
data: any,
): AmalgamCoreResponse<R> {
export function prepareCoreResponse<R = unknown>(data: any): AmalgamCoreResponse<R> {
if (!data) {
throw new AmalgamError("Null or empty response received from core.");
}
Expand Down
50 changes: 39 additions & 11 deletions src/features/abstract/arrays.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,48 @@ export class InferFeatureAttributesFromArray extends InferFeatureAttributesBase
}
}

protected async inferBoolean(_featureName: string): Promise<FeatureAttributes> {
protected async inferBoolean(
/* eslint-disable-next-line @typescript-eslint/no-unused-vars*/
featureName: string,
): Promise<FeatureAttributes> {
return {
type: "nominal",
data_type: "boolean",
};
}

protected async inferTimedelta(_featureName: string): Promise<FeatureAttributes> {
protected async inferTimedelta(
/* eslint-disable-next-line @typescript-eslint/no-unused-vars*/
featureName: string,
): Promise<FeatureAttributes> {
return {
type: "continuous",
};
}

protected async inferTime(_featureName: string): Promise<FeatureAttributes> {
protected async inferTime(
/* eslint-disable-next-line @typescript-eslint/no-unused-vars*/
featureName: string,
): Promise<FeatureAttributes> {
return {
type: "continuous",
};
}

protected async inferDate(_featureName: string): Promise<FeatureAttributes> {
protected async inferDate(
/* eslint-disable-next-line @typescript-eslint/no-unused-vars*/
featureName: string,
): Promise<FeatureAttributes> {
return {
type: "continuous",
date_time_format: "%Y-%m-%d",
};
}

protected async inferDatetime(_featureName: string): Promise<FeatureAttributes> {
protected async inferDatetime(
/* eslint-disable-next-line @typescript-eslint/no-unused-vars*/
featureName: string,
): Promise<FeatureAttributes> {
return {
type: "continuous",
date_time_format: "%Y-%m-%dT%H:%M:%SZ",
Expand Down Expand Up @@ -99,7 +114,10 @@ export class InferFeatureAttributesFromArray extends InferFeatureAttributesBase
}
}

protected async inferString(_featureName: string): Promise<FeatureAttributes> {
protected async inferString(
/* eslint-disable-next-line @typescript-eslint/no-unused-vars*/
featureName: string,
): Promise<FeatureAttributes> {
return {
type: "nominal",
};
Expand Down Expand Up @@ -187,15 +205,21 @@ export class InferFeatureAttributesFromArray extends InferFeatureAttributesBase
}

public async inferTimeSeries(
_attributes: Readonly<FeatureAttributes>,
_featureName: string,
_options: InferFeatureTimeSeriesOptions,
/* eslint-disable-next-line @typescript-eslint/no-unused-vars*/
attributes: Readonly<FeatureAttributes>,
/* eslint-disable-next-line @typescript-eslint/no-unused-vars*/
featureName: string,
/* eslint-disable-next-line @typescript-eslint/no-unused-vars*/
options: InferFeatureTimeSeriesOptions,
): Promise<Partial<FeatureAttributes>> {
// TODO - infer time series
throw new Error("Method not implemented.");
}

protected async inferUnique(_featureName: string): Promise<boolean> {
protected async inferUnique(
/* eslint-disable-next-line @typescript-eslint/no-unused-vars*/
featureName: string,
): Promise<boolean> {
// Arrays don't support unique constraints
return false;
}
Expand Down Expand Up @@ -247,7 +271,11 @@ export class InferFeatureAttributesFromArray extends InferFeatureAttributesBase
}

export class FeatureSerializerArrayData extends FeatureSerializerBase {
public async serialize(data: ArrayData, _features: Record<string, FeatureAttributes>): Promise<any[][]> {
public async serialize(
data: ArrayData,
/* eslint-disable-next-line @typescript-eslint/no-unused-vars*/
features: Record<string, FeatureAttributes>,
): Promise<any[][]> {
return data.data;
}

Expand Down
6 changes: 5 additions & 1 deletion src/features/abstract/parsed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ export class InferFeatureAttributesFromParsedArray extends InferFeatureAttribute
}

export class FeatureSerializerParsedArrayData extends FeatureSerializerBase {
public async serialize(data: ParsedArrayData, _features: Record<string, FeatureAttributes>): Promise<any[][]> {
public async serialize(
data: ParsedArrayData,
/* eslint-disable-next-line @typescript-eslint/no-unused-vars*/
features: Record<string, FeatureAttributes>,
): Promise<any[][]> {
return parsedDataToArrayData(data).data;
}

Expand Down
5 changes: 4 additions & 1 deletion src/features/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ export abstract class InferFeatureAttributesBase {
protected abstract inferString(featureName: string): Promise<FeatureAttributes>;
protected abstract inferInteger(featureName: string): Promise<FeatureAttributes>;
protected abstract inferFloat(featureName: string): Promise<FeatureAttributes>;
protected async inferUnknown(_featureName: string): Promise<FeatureAttributes> {
protected async inferUnknown(
/* eslint-disable-next-line @typescript-eslint/no-unused-vars*/
featureName: string,
): Promise<FeatureAttributes> {
return { type: "nominal" };
}

Expand Down
1 change: 0 additions & 1 deletion src/features/serializer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type * as base from "./base";

import { ProblemError } from "../client/errors";
Expand Down
2 changes: 0 additions & 2 deletions src/features/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-explicit-any */

/**
* Get the precision of a number.
* @param x The number.
Expand Down

0 comments on commit 09cb4bd

Please sign in to comment.