Skip to content

Commit

Permalink
feat!: Set no-floating-promises to error (#901)
Browse files Browse the repository at this point in the history
Co-authored-by: Tony Coconate <[email protected]>
  • Loading branch information
danielbankhead and tonycoco authored Oct 10, 2024
1 parent 71972dc commit 1d28f92
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
19 changes: 6 additions & 13 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
{
Expand All @@ -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",
Expand All @@ -58,6 +50,7 @@
},
"parserOptions": {
"ecmaVersion": 2018,
"project": "./tsconfig.json",
"sourceType": "module"
}
}
Expand Down
13 changes: 10 additions & 3 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
);

0 comments on commit 1d28f92

Please sign in to comment.