Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider enabling the allowExpressions option for @typescript-eslint/explicit-function-return-type #51

Closed
codybrouwers opened this issue Oct 3, 2022 · 1 comment
Labels

Comments

@codybrouwers
Copy link
Member

After enabling the @typescript-eslint/explicit-function-return-type rule, we saw lot's of return types added within expressions that already have a required return type, for example:

<btn
  onClick={(): void => onClick()}
>

Typescript will catch this usually which makes the void return type redundant. The rule has this allowExpressions option that allows for not requiring return types in this example that we should look into enabling since it is false by default.

The downside to this rule is it will allow you to skip specifying the return type in functions like map that you might want to only return a single type from.

mrmckeb added a commit that referenced this issue Aug 29, 2023
…it-function-return-type`

Resolves #51

BREAKING CHANGE: Types are no longer required in expressions (callbacks), as the parent will flag
unexpected return types.
mrmckeb added a commit that referenced this issue Aug 29, 2023
…it-function-return-type`

Resolves #51

BREAKING CHANGE: Types are no longer required in expressions (callbacks), as the parent will flag
unexpected return types.
mrmckeb added a commit that referenced this issue Aug 29, 2023
…it-function-return-type`

Resolves #51

BREAKING CHANGE: Types are no longer required in expressions (callbacks), as the parent will flag
unexpected return types.
mrmckeb added a commit that referenced this issue Aug 29, 2023
…it-function-return-type`

Resolves #51

BREAKING CHANGE: Types are no longer required in expressions (callbacks), as the parent will flag
unexpected return types.
mrmckeb added a commit that referenced this issue Aug 29, 2023
…it-function-return-type`

Resolves #51

BREAKING CHANGE: Types are no longer required in expressions (callbacks), as the parent will flag
unexpected return types.
mrmckeb added a commit that referenced this issue Aug 29, 2023
…it-function-return-type`

Resolves #51

BREAKING CHANGE: Types are no longer required in expressions (callbacks), as the parent will flag
unexpected return types.
@mrmckeb
Copy link
Contributor

mrmckeb commented Aug 29, 2023

🎉 This PR is included in version 5.0.0 🎉

The release is available on:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants