OpenAPITools / OpenAPITools/openapi-generator

[REQ] add `@ts-nocheck` option for typescript generator

Open
#10,844 2 comments 35 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Is your feature request related to a problem? Please describe.

We are using openapi-generator for generating typescript api client.
And we have a strict rule setting in tsconfig for rest of the project.

As mentioned in https://github.com/OpenAPITools/openapi-generator/issues/8961#issuecomment-962473353, https://github.com/OpenAPITools/openapi-generator/issues/1880#issuecomment-891689205 we are also facing to the situation where type-check will fail.

And we need to add // @ts-nocheck to every file which is generated.

Describe the solution you'd like

It would be much better to have an option to generate with // @ts-nocheck in all files.

Describe alternatives you've considered

Nothing else.

Additional context

Since it is auto-generated, it is sometimes redundant to keep these files clean and obey the strict rules.
So it would be nice to have a choice for developers how generated files are treated.

Anyway thanks for maintaining this wonderful tools and this is saving our project to go faster.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the TypeScript generator's option handling and the code paths that assemble generated files. Check how an option can apply the // @ts-nocheck header to every generated file, then verify that generated TypeScript clients include it without changing other generator behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.