orval-labs / orval

orval is able to generate client with appropriate type-signatures (TypeScript) from any valid OpenAPI v3 or Swagger v2 specification, either in yaml or json formats. 🍺
https://orval.dev
MIT License
3.01k stars 329 forks source link

Add option for @ts-nocheck for all files in config #1615

Closed master8848 closed 1 month ago

master8848 commented 1 month ago

What happens?

I am getting some errors due to how my api docs are setup but code would work but typechecking is not letting me push changes

Running typecheck is giving issue and cannot exclude that folder in tsconfig

Any other comments?

Give option to add "@ts-nocheck" in config file

What versions are you using?

System: OS: macOS 14.6.1 CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Memory: 319.69 MB / 16.00 GB Shell: 5.9 - /bin/zsh npmPackages: @tanstack/react-query: ^5.51.23 => 5.51.23 orval: ^7.0.1 => 7.0.1 react: ^18.3.1 => 18.3.1 zod: ^3.23.8 => 3.23.8

melloware commented 1 month ago

I think you might be able to do this with headers option.

petstore: {
    output: {
      override: {
        header: (info: InfoObject): String[] => [
          `Generated by orval 🍺`,
          `Do not edit manually.`,
          ...(info.title ? [info.title] : []),
          ...(info.description ? [info.description] : []),
          ...(info.version ? [`OpenAPI spec version: ${info.version}`] : []),
        ],
      },
    },

That is how you can override the header generation you should be able to add @ts-nocheck