Skip to content

Commit 1fcdb20

Browse files
committed
🔧
fix: use @ts-expect-error instead of @ts-ignore Addresses coderabbitai feedback on PR elysiajs#300. Changed from @ts-ignore to @ts-expect-error for better type safety. This ensures the suppression is still necessary - if the error goes away in the future (e.g., after types are updated), @ts-expect-error will fail the build, alerting us to remove it. Also improved the comment to be more descriptive about why the suppression is needed.
1 parent 9095926 commit 1fcdb20

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/openapi.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,9 @@ export function toOpenAPISchema(
294294
// @ts-ignore
295295
const definitions = app.getGlobalDefinitions?.().type
296296

297-
// @ts-ignore private property
298297
// Use getFlattenedRoutes() if available (Elysia 1.4.16+) to get guard() schemas
299298
// Falls back to getGlobalRoutes() for older versions
300-
// @ts-ignore
299+
// @ts-expect-error - getFlattenedRoutes is a protected method not in public types
301300
const routes = app.getFlattenedRoutes?.() ?? app.getGlobalRoutes()
302301

303302
if (references) {

0 commit comments

Comments
 (0)