@typescript-eslint/explicit-function-return-type#465
@typescript-eslint/explicit-function-return-type#465ScriptedAlchemy wants to merge 7 commits intoweb-infra-dev:mainfrom
Conversation
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
…ion-return-type-ce2b Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Summary of ChangesHello @ScriptedAlchemy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request implements the @typescript-eslint/explicit-function-return-type rule. The implementation is comprehensive, including handling for all rule options, Go unit tests, documentation, and enabling the original JavaScript-based test suite. The code is well-structured. I've found one potential issue in the logic for inferring return types from ancestor functions which I've commented on. Overall, this is a great contribution.
...rnal/plugins/typescript/rules/explicit_function_return_type/explicit_function_return_type.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f4cb0f53f0
ℹ️ 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".
...rnal/plugins/typescript/rules/explicit_function_return_type/explicit_function_return_type.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Adds the @typescript-eslint/explicit-function-return-type rule to the TypeScript plugin, wiring it into the global rule registry and enabling the upstream TS-ESLint rule test suite in rslint-test-tools.
Changes:
- Implement
explicit-function-return-typerule logic in Go, including option parsing and function-head range reporting. - Add Go unit tests for core behaviors and enable the upstream TypeScript-ESLint rule tests + snapshot.
- Register the rule and add basic rule documentation.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
internal/plugins/typescript/rules/explicit_function_return_type/explicit_function_return_type.go |
New Go implementation of the rule + option handling + diagnostic range calculation. |
internal/plugins/typescript/rules/explicit_function_return_type/explicit_function_return_type_test.go |
Go unit tests for key options / ranges. |
internal/plugins/typescript/rules/explicit_function_return_type/explicit_function_return_type.md |
New rule documentation page. |
internal/config/config.go |
Registers the rule in the TS-ESLint plugin rule registry. |
packages/rslint-test-tools/rstest.config.mts |
Enables the upstream rule test file. |
packages/rslint-test-tools/tests/typescript-eslint/rules/__snapshots__/explicit-function-return-type.test.ts.snap |
New snapshot output for the enabled upstream test suite. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...rnal/plugins/typescript/rules/explicit_function_return_type/explicit_function_return_type.go
Show resolved
Hide resolved
...rnal/plugins/typescript/rules/explicit_function_return_type/explicit_function_return_type.md
Show resolved
Hide resolved
Simplify allow-expression checks to satisfy staticcheck and disable the rule in dogfooding config. Co-authored-by: Cursor <cursoragent@cursor.com>
Apply review feedback for ancestor checks, option gating, and document available options. Co-authored-by: Cursor <cursoragent@cursor.com>
Skip object literal wrappers when walking for return-typed ancestors and avoid spellcheck warnings. Co-authored-by: Cursor <cursoragent@cursor.com>
Treat array literal containers as typed contexts for object literal properties. Co-authored-by: Cursor <cursoragent@cursor.com>
Limit the report scope and missing list to @typescript-eslint rules only. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Implements the
@typescript-eslint/explicit-function-return-typerule, including full option handling, correct function-head range reporting, Go unit tests, and documentation. The existing JavaScript rule tests have also been enabled.Related Links
Checklist
Made with Cursor