You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.
Did you ever forget to await something and it made you loose a lot of time? Or perhaps you forgot to handle a promise rejection and it made you want to quit JavaScript? I bet you did at some point, and maybe you still do to this date. It feels like a design flaw in JavaScript, and I thought that TypeScript couldn't do anything about it, until...
... I've found out that there is a way to prevent unhandledPromiseRejections. I noticed that your project doesn't seem to have it configured so I couldn't help but open this issue.
module.exports={env: {es2021: true,node: true,},extends: ["eslint:recommended","plugin:@typescript-eslint/recommended"],parser: "@typescript-eslint/parser",parserOptions: {// you need to have this for `no-floating-promises` to workecmaVersion: 12,sourceType: "module",project: "tsconfig.json",},plugins: ["@typescript-eslint"],rules: {"@typescript-eslint/no-floating-promises": "error",// holy rule},};
You have to try it.
The text was updated successfully, but these errors were encountered:
Did you ever forget to
await
something and it made you loose a lot of time? Or perhaps you forgot to handle a promise rejection and it made you want to quit JavaScript? I bet you did at some point, and maybe you still do to this date. It feels like a design flaw in JavaScript, and I thought that TypeScript couldn't do anything about it, until...... I've found out that there is a way to prevent
unhandledPromiseRejections
. I noticed that your project doesn't seem to have it configured so I couldn't help but open this issue.What I'm talking about is the
no-floating-promises
rule.Here is my
.eslintrc.js
for reference:You have to try it.
The text was updated successfully, but these errors were encountered: