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

Destructuring Inside an Async Function or Class Method Isn't Warned #1885

Closed
trisys3 opened this issue Jul 15, 2018 · 1 comment
Closed

Destructuring Inside an Async Function or Class Method Isn't Warned #1885

trisys3 opened this issue Jul 15, 2018 · 1 comment

Comments

@trisys3
Copy link

trisys3 commented Jul 15, 2018

I added a GitHub repo illustrating the bug: trisys3/prop-types-async-issue.

Basically, when I have an async function, whether class method or a function by itself, and I destructure this.props, I am not warned about the props, even if they aren't in the prop-types. If I do have those props inside prop-types and I have the rule about unused prop-types on,

I found that if I use a destructured prop I stop getting warned about that prop being unused. This indicates that the bug is with the using, but not with the un-using, at least in classes.

This only applies to class methods, though. I never get warned about props in an async function declaration/statement, whether undeclared or unused, whether I use them or not, whether I declare them or not, or neither, or both. Also, this applies whether or not I'm destructuring. Basically, async functions seem un-implemented.

I tried to be as simple as possible. I added as few ESLint rules & plugins as I needed to illustrate the issue, and I didn't even add babel, though I did add babel-eslint. I also tried to be short & succinct with my function/variable/class names, though I may have been a little too cute. If you're still confused, please tell me.

@ljharb
Copy link
Member

ljharb commented Oct 16, 2018

Fixed in #1939.

@ljharb ljharb closed this as completed Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants