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

fix: add explicit type annotations to `Interceptors`

Open SimenB opened this issue 1 year ago β€’ 5 comments

This is to make the generated code work with TS's new isolatedDeclarations config.

https://devblogs.microsoft.com/typescript/announcing-typescript-5-5-beta/#isolated-declarations

src/api/requests/core/OpenAPI.ts:14:3 - error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations.

14   eject(fn: Middleware<T>) {
     ~~~~~

  src/api/requests/core/OpenAPI.ts:14:3
    14   eject(fn: Middleware<T>) {
         ~~~~~
    Add a return type to the method

src/api/requests/core/OpenAPI.ts:21:3 - error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations.

21   use(fn: Middleware<T>) {
     ~~~

  src/api/requests/core/OpenAPI.ts:21:3
    21   use(fn: Middleware<T>) {
         ~~~
    Add a return type to the method

SimenB avatar May 19 '24 05:05 SimenB

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

πŸ¦‹ Changeset detected

Latest commit: ac966fe794cd8a8e6a65879361499615a86c387d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hey-api/openapi-ts Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar May 19 '24 05:05 changeset-bot[bot]

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
hey-api-docs βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback May 24, 2024 3:30pm

vercel[bot] avatar May 19 '24 05:05 vercel[bot]

Note: I should add tsconfig tests because this is too easy to break and hard to see what it actually fixes

mrlubos avatar May 19 '24 08:05 mrlubos

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 75.45%. Comparing base (3c97054) to head (ac966fe).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #594   +/-   ##
=======================================
  Coverage   75.45%   75.45%           
=======================================
  Files          75       75           
  Lines        7312     7312           
  Branches      663      663           
=======================================
  Hits         5517     5517           
  Misses       1792     1792           
  Partials        3        3           
Flag Coverage Ξ”
unittests 75.45% <ΓΈ> (ΓΈ)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 19 '24 22:05 codecov[bot]

Can this land in the meantime? πŸ™‚ I agree tests to prevent regressions is ideal, but this doesn't hurt on its own, and allows me to drop a floated patch

SimenB avatar May 24 '24 15:05 SimenB

Merged, thanks! Is it okay if it's released on Monday/weekend?

mrlubos avatar May 24 '24 15:05 mrlubos

Yeah, no rush at all πŸ‘

Thanks!

SimenB avatar May 24 '24 16:05 SimenB