From dce032567578424df4797cdcf51668762c1868d5 Mon Sep 17 00:00:00 2001 From: Daniel Bankhead Date: Wed, 9 Oct 2024 22:05:54 -0700 Subject: [PATCH] feat!: Set `no-floating-promises` to `error` --- .eslintrc.json | 19 ++++++------------- src/cli.ts | 13 ++++++++++--- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index cfae847c..33bdcd55 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,13 +1,6 @@ { - "extends": [ - "eslint:recommended", - "plugin:n/recommended", - "prettier" - ], - "plugins": [ - "n", - "prettier" - ], + "extends": ["eslint:recommended", "plugin:n/recommended", "prettier"], + "plugins": ["n", "prettier"], "rules": { "prettier/prettier": "error", "block-scoped-var": "error", @@ -17,7 +10,7 @@ "eol-last": "error", "prefer-arrow-callback": "error", "no-trailing-spaces": "error", - "quotes": ["warn", "single", { "avoidEscape": true }], + "quotes": ["warn", "single", {"avoidEscape": true}], "no-restricted-properties": [ "error", { @@ -34,11 +27,10 @@ { "files": ["**/*.ts", "**/*.tsx"], "parser": "@typescript-eslint/parser", - "extends": [ - "plugin:@typescript-eslint/recommended" - ], + "extends": ["plugin:@typescript-eslint/recommended"], "rules": { "@typescript-eslint/ban-ts-comment": "warn", + "@typescript-eslint/no-floating-promises": "error", "@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/no-use-before-define": "off", "@typescript-eslint/no-warning-comments": "off", @@ -58,6 +50,7 @@ }, "parserOptions": { "ecmaVersion": 2018, + "project": "./tsconfig.json", "sourceType": "module" } } diff --git a/src/cli.ts b/src/cli.ts index 8ce93753..c8676530 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -169,9 +169,16 @@ if (cli.input.length < 1) { usage(); } -run(cli.input[0], cli.input.slice(1)).then(success => { - if (!success) { +run(cli.input[0], cli.input.slice(1)).then( + success => { + if (!success) { + // eslint-disable-next-line n/no-process-exit + process.exit(1); + } + }, + e => { + console.error(e); // eslint-disable-next-line n/no-process-exit process.exit(1); } -}); +);