-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
Implement arrow-parens to support type parameters #417
Conversation
"flowtype/require-return-type": 0, | ||
"flowtype/require-valid-file-annotation": 0, | ||
"flowtype/require-readonly-react-props": 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a post-commit hook modified this file?
// can therefore be safely ignored. | ||
if (node.typeParameters) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the relevant bit. My assumption is that if the arrow function has type parameters, then we can safely ignore it because any arrow function with type parameters and no parens is always a parse error.
|
||
Enforces the consistent use of parentheses in arrow functions. | ||
|
||
This rule has a string option and an object one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grabbed all this stuff from the eslint
documentation here.
Thank you. LGTM |
🎉 This PR is included in version 3.12.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This should resolve #344.
I did this quick and dirty, and I'm not sure if it's the correct approach. What I did was:
arrow-parens
rule and tests intoeslint-plugin-flowtype
fromeslint
,eslint-plugin-flowtype
environment,arrow-parens
rule so that the tests passed.Let me know if there's a better way to override an eslint rule. Also, I'm not sure if this should go into the recommended config or whatever.
This may also be of interest to typescript-eslint/typescript-eslint#14.