Hacker News new | ask | show | jobs
by jwolfe 241 days ago
If you use the standard typescript linter, it will fail if you pass a Promise to an if statement.

https://typescript-eslint.io/rules/no-misused-promises/

1 comments

The problem was the framework's bundler was transforming those functions to return promises, a linter would need to understand next.js's specific transforms to catch this.