MDL-57139 eslint: enable eslint-plugin-promise rules

For promise best practices
This commit is contained in:
Dan Poltawski
2017-06-01 10:27:58 +01:00
parent 78ab4f741b
commit 66a91ddada
3 changed files with 21 additions and 0 deletions
+14
View File
@@ -1,4 +1,7 @@
{
'plugins': [
'promise',
],
'env': {
'browser': true,
'amd': true
@@ -170,11 +173,22 @@
'unicode-bom': 'error',
'wrap-regex': 'off',
// === Promises ===
'promise/always-return': 'warn',
'promise/no-return-wrap': 'warn',
'promise/param-names': 'warn',
'promise/catch-or-return': ['warn', {terminationMethod: ['catch', 'fail']}],
'promise/no-native': 'warn',
'promise/no-promise-in-callback': 'warn',
'promise/no-callback-in-promise': 'warn',
'promise/avoid-new': 'warn',
// === Deprecations ===
"no-restricted-properties": ['warn', {
'object': 'M',
'property': 'str',
'message': 'Use AMD module "core/str" or M.util.get_string()'
}],
}
}
+6
View File
@@ -821,6 +821,12 @@
"integrity": "sha1-f6qEWZ4P6kIvBLwy20kFQFGj8Ro=",
"dev": true
},
"eslint-plugin-promise": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.5.0.tgz",
"integrity": "sha1-ePu2/+BHIBYnVp6FpsU3OvKmj8o=",
"dev": true
},
"espree": {
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/espree/-/espree-3.4.3.tgz",
+1
View File
@@ -5,6 +5,7 @@
"devDependencies": {
"async": "1.5.2",
"eslint": "3.7.1",
"eslint-plugin-promise": "3.5.0",
"gherkin-lint": "1.1.3",
"grunt": "1.0.1",
"grunt-contrib-less": "1.3.0",