Skip to content

Commit

Permalink
MDL-57139 eslint: enable eslint-plugin-promise rules
Browse files Browse the repository at this point in the history
For promise best practices
  • Loading branch information
danpoltawski committed Jun 1, 2017
1 parent 78ab4f7 commit 66a91dd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
'plugins': [
'promise',
],
'env': {
'browser': true,
'amd': true
Expand Down Expand Up @@ -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 changes: 6 additions & 0 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 66a91dd

Please sign in to comment.