Skip to content

Unused @ts-expect-error causes errorsΒ #2979

@fiftyy

Description

@fiftyy

Description

Hi, while i generate my client i get the following errors from the generated files:

src/api/client/client/client.gen.ts:61:3 - error TS2578: Unused '@ts-expect-error' directive.

61   // @ts-expect-error
        const { opts, url } = await beforeRequest(options);
     ~~~~~~~~~~~~~~~~~~~

Reproducible example or configuration

Config

import { defineConfig } from '@hey-api/openapi-ts';

export default defineConfig({
	input: './scripts/openapi-spec.json',
	output: { format: 'prettier', lint: 'eslint', path: './src/api/client', importFileExtension: '.js' },
	plugins: [
		'@hey-api/schemas',
		{
			name: '@hey-api/typescript',
			topType: "any",
			enums: {
				case: 'preserve',
				enabled: true,
				mode: 'typescript'
			}
		},
		{
			name: '@hey-api/sdk',
			asClass: true,
			responseStyle: 'data',
			paramsStructure: 'flat',
			classNameBuilder: (name) => `${name}Service`
		}
	]
});

OpenAPI specification (optional)

No response

System information (optional)

Node: v24.11.0

typescript: 5.9.3
@hey-api/openapi-ts: 0.87.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug πŸ”₯Something isn't workingclientClient package relatedjavascriptPull requests that update Javascript codeneeds info ⏳Further information is required

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions