From 99897b81ec9542cccc5ee062654fdf4818f8810f Mon Sep 17 00:00:00 2001 From: Ruslan Kabalin Date: Tue, 1 Feb 2022 09:34:00 +0000 Subject: [PATCH] MDL-74301 eslint: Use 'plugin:promise/recommended' This enables recommended rules and brings back related rules. Without reducing level to warn for some of them, this gives numerous (about 88) issues mainly catch-or-return. Recommended set is defined in node_modules/eslint-plugin-promise/index.js --- .eslintrc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.eslintrc b/.eslintrc index 0e981527035..ac74a7d7f64 100644 --- a/.eslintrc +++ b/.eslintrc @@ -5,7 +5,8 @@ 'jsdoc' ], 'extends': [ - 'eslint:recommended' + 'eslint:recommended', + 'plugin:promise/recommended' ], 'env': { 'browser': true, @@ -184,14 +185,12 @@ 'unicode-bom': 'error', 'wrap-regex': 'off', - // === Promises === + // === Promises (override plugin:promise/recommended) === 'promise/always-return': 'warn', 'promise/no-return-wrap': 'warn', 'promise/param-names': 'warn', 'promise/catch-or-return': ['warn', {terminationMethod: ['catch', 'fail', 'always'], allowFinally: true}], 'promise/no-native': 'warn', - 'promise/no-promise-in-callback': 'warn', - 'promise/no-callback-in-promise': 'warn', 'promise/avoid-new': 'warn', // === Deprecations ===