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

Disable unicorn/no-await-expression-member #185

Open
leroykorterink opened this issue Nov 10, 2023 · 0 comments
Open

Disable unicorn/no-await-expression-member #185

leroykorterink opened this issue Nov 10, 2023 · 0 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@leroykorterink
Copy link
Collaborator

You're forced to assign the result of a promise to a new variable, according to the unicorn rule documentation this makes code more "readable" but I don't agree with that statement.

return (await response.json()).title;
const result = await response.json();
return result.title;

https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v47.0.0/docs/rules/no-await-expression-member.md

@leroykorterink leroykorterink added good first issue Good for newcomers help wanted Extra attention is needed labels Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant