Skip to content

Enforce explicit return types and ban implicit any on functions #5192

@bootcodes

Description

@bootcodes

Problem

Functions across the codebase are missing explicit return types and in some cases use implicit or explicit any, which undermines TypeScript's type safety guarantees and makes refactoring risky.
Missing return types allow silent regressions - a function can change what it returns without a compile error at the call site

Solution

  • Enable noImplicitAny in tsconfig.json
  • Enable @typescript-eslint/explicit-function-return-type ESLint rule (or @typescript-eslint/explicit-module-boundary-types) to enforce return types on all exported and public functions
  • Ban explicit any usage via @typescript-eslint/no-explicit-any
  • Fix all existing violations

Alternatives

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Team PromotedIssues to be triaged and discussed by committers, maintainers, to be worked on the following sprintenhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions