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
This commit is contained in:
Ruslan Kabalin 2022-02-01 09:34:00 +00:00
parent 80a111d25e
commit 99897b81ec

View File

@ -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 ===