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

Add a strict-mode configuration to error on unnecessary awaits #35674

Closed
4 of 5 tasks
MLoughry opened this issue Dec 13, 2019 · 2 comments
Closed
4 of 5 tasks

Add a strict-mode configuration to error on unnecessary awaits #35674

MLoughry opened this issue Dec 13, 2019 · 2 comments

Comments

@MLoughry
Copy link

Search Terms

TS80007, unnecessary await

Suggestion

Currently, the tsserver gives a warning/quick fix about unnecessary awaits (TS80007). However, there is no configuration to cause the build to error on such cases.

Use Cases

This would allow PR/CI builds to catch cases where an await is used unnecessarily, which can cause significant added code weight when targeting ES versions that do not support native async/await.

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
    • Depending on how you define added restrictions to strict mode, this could be considered breaking
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.
@MartinJohns
Copy link
Contributor

Duplicate of #35419?

@MLoughry
Copy link
Author

Duplicate of #35419?

Seems like it, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants