openapi-ts icon indicating copy to clipboard operation
openapi-ts copied to clipboard

Using `lint: "eslint"` with @typescript-eslint/consistent-type-definitions is breaking types

Open trevorpfiz opened this issue 1 year ago • 0 comments
trafficstars

Description

When my eslint is running, it changes type to interface, breaking types for body.

this works:

export type PredictRequest = {
  inputs: string;
};

export type HfPredictData = {
  body: PredictRequest;
};

export const hfPredict = <ThrowOnError extends boolean = false>(
  options: Options<HfPredictData, ThrowOnError>,
) => {
  return (options?.client ?? client).post<
    HfPredictResponse,
    HfPredictError,
    ThrowOnError
  >({
    ...options,
    url: "/api/v1/hf/predict",
  });
};

this breaks it:

export interface PredictRequest {
  inputs: string;
}

image

image

Reproducible example or configuration

No response

OpenAPI specification (optional)

No response

System information (optional)

No response

trevorpfiz avatar Oct 04 '24 21:10 trevorpfiz