How to warn when you forget to `await` an async function in Javascript?
The no-floating-promises ESLint rule requires you to explicitly handle any promises (e.g. with await or void). Here’s a minimal .eslintrc for use with TypeScript. Note that parserOptions is required for this rule: { “root”: true, “parser”: “@typescript-eslint/parser”, “parserOptions”: { “project”: “./tsconfig.json” }, “plugins”: [“@typescript-eslint”], “extends”: [“eslint:recommended”, “plugin:@typescript-eslint/recommended”], “rules”: { “@typescript-eslint/no-floating-promises”: [“error”] } } (ESLint is … Read more