-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[explicit-function-return-type] Is type inference not allowed? #434
Comments
Check out the options for the rule: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-function-return-type.md#options I believe you'll want |
This might be a dumb question but I am trying to understand how I use these rules for [explicit-function-return-type] inside my React Typescript application on Create-React-App 3.0.
This is my .eslintrc.json file. I am wondering how I add those rules like
|
Check out the eslint docs for configuring rules. The available options for this rule are listed here Let me know if you need more help. |
@bradzacher I just figured it out, thanks for the resources though. For anyone working with React and wondering about this, see the example below. |
Repro
Expected Result
Expect no error because these functions are inferred to return string.
Actual Result
Error. (Missing return type on function.)
Additional Info
Versions
@typescript-eslint/eslint-plugin
1.6.0
@typescript-eslint/parser
1.6.0
TypeScript
3.4.3
ESLint
5.16.0
node
10.15.3
npm
6.4.1
The text was updated successfully, but these errors were encountered: