Skip to content

fix(no-unsafe-return): preserve deferred indexed return type - #1248

Merged
graphite-app[bot] merged 1 commit into
mainfrom
codex/fix-no-unsafe-return-deferred-type
Sep 28, 2026
Merged

graphite-app[bot] merged 1 commit into
mainfrom
codex/fix-no-unsafe-return-deferred-type

Conversation

@camc314

@camc314 camc314 commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

no-unsafe-return reported a return typed as Infer<S> when its base constraint was any, even though the declared return type was also Infer<S>. typescript-eslint allows that return while still reporting a direct return of schema._output, whose type is any.

Compare the expression's original type with the explicit return type, matching typescript-eslint's rule. Keep the constrained type for diagnostic text, and add regression cases for both returns.

Fixes #1244

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T10:48:36.916681Z 099a6f6 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d8433f221f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@camc314 camc314 self-assigned this Sep 28, 2026

camc314 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Merge activity

`no-unsafe-return` reported a return typed as `Infer<S>` when its base constraint was `any`, even though the declared return type was also `Infer<S>`. typescript-eslint allows that return while still reporting a direct return of `schema._output`, whose type is `any`.

Compare the expression's original type with the explicit return type, matching typescript-eslint's rule. Keep the constrained type for diagnostic text, and add regression cases for both returns.

Fixes #1244
@graphite-app
graphite-app Bot force-pushed the codex/fix-no-unsafe-return-deferred-type branch from 099a6f6 to b71f3df Compare September 28, 2026 11:02
@graphite-app
graphite-app Bot merged commit b71f3df into main Sep 28, 2026
9 checks passed
@graphite-app graphite-app Bot removed the 0-merge label Sep 28, 2026
@graphite-app
graphite-app Bot deleted the codex/fix-no-unsafe-return-deferred-type branch September 28, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

no-unsafe-return: returning a value typed as the declared deferred indexed-access type (e.g. z.infer<T>) is reported as any

1 participant