mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 08:22:07 +02:00
MDL-57139 eslint: enable eslint-plugin-promise rules
For promise best practices
This commit is contained in:
parent
78ab4f741b
commit
66a91ddada
14
.eslintrc
14
.eslintrc
@ -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
npm-shrinkwrap.json
generated
6
npm-shrinkwrap.json
generated
@ -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",
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user