Skip to content

tools: enable no-return-await lint rule #17265

Closed
Trott wants to merge 2 commits into
nodejs:masterfrom
Trott:no-return-await
Closed

tools: enable no-return-await lint rule #17265
Trott wants to merge 2 commits into
nodejs:masterfrom
Trott:no-return-await

Conversation

@Trott
Copy link
Copy Markdown
Member

@Trott Trott commented Nov 23, 2017

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

tools doc test

@nodejs-github-bot nodejs-github-bot added the tools Issues and PRs related to the tools directory. label Nov 23, 2017
Comment thread doc/api/util.md Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quoting https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function

(...) because the return value of an async function is implicitly wrapped in Promise.resolve.

So I assume you can drop the Promise.resolve here and in below occurences

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Florian-R Done. Thanks for the suggestion!

Remove unnecessary `await` in combination with `return` in preparation
for enabling lint rule.
Enable lint rule that prohibits unnecessary use of `await` with
`return`.
@Trott
Copy link
Copy Markdown
Member Author

Trott commented Nov 29, 2017

@Trott
Copy link
Copy Markdown
Member Author

Trott commented Dec 1, 2017

@Trott
Copy link
Copy Markdown
Member Author

Trott commented Dec 1, 2017

Landed in 929f343 and 3327ce0.

@Trott Trott closed this Dec 1, 2017
Trott added a commit to Trott/io.js that referenced this pull request Dec 1, 2017
Remove unnecessary `await` in combination with `return` in preparation
for enabling lint rule.

PR-URL: nodejs#17265
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Trott added a commit to Trott/io.js that referenced this pull request Dec 1, 2017
Enable lint rule that prohibits unnecessary use of `await` with
`return`.

PR-URL: nodejs#17265
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
Remove unnecessary `await` in combination with `return` in preparation
for enabling lint rule.

PR-URL: #17265
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
Enable lint rule that prohibits unnecessary use of `await` with
`return`.

PR-URL: #17265
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
Remove unnecessary `await` in combination with `return` in preparation
for enabling lint rule.

PR-URL: #17265
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
Enable lint rule that prohibits unnecessary use of `await` with
`return`.

PR-URL: #17265
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Dec 12, 2017
gibfahn pushed a commit that referenced this pull request Dec 19, 2017
Remove unnecessary `await` in combination with `return` in preparation
for enabling lint rule.

PR-URL: #17265
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
gibfahn pushed a commit that referenced this pull request Dec 19, 2017
Enable lint rule that prohibits unnecessary use of `await` with
`return`.

PR-URL: #17265
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
@gibfahn
Copy link
Copy Markdown
Member

gibfahn commented Dec 19, 2017

@Trott would you mind backporting to 6.x?

@Trott
Copy link
Copy Markdown
Member Author

Trott commented Dec 19, 2017

@Trott would you mind backporting to 6.x?

According to http://node.green/#ES2017-features-async-functions-await, await did not appear until 7.x, so I think we can skip backporting this to 6.x. Do correct me if I'm wrong!

@gibfahn gibfahn mentioned this pull request Dec 20, 2017
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
Remove unnecessary `await` in combination with `return` in preparation
for enabling lint rule.

PR-URL: #17265
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
Enable lint rule that prohibits unnecessary use of `await` with
`return`.

PR-URL: #17265
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
@gibfahn gibfahn mentioned this pull request Dec 20, 2017
@Trott Trott deleted the no-return-await branch January 13, 2022 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools Issues and PRs related to the tools directory.

10 participants