Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/eslint-config-godaddy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ module.exports = {
'no-shadow': 1,
'no-sparse-arrays': 2,
'no-sync': 2,
'no-throw-literal': 1,
'no-throw-literal': 2,
'no-undef-init': 2,
'no-undefined': 2,
'no-underscore-dangle': 0,
Expand All @@ -112,6 +112,7 @@ module.exports = {
'strict': [2, 'global'],
'use-isnan': 2,
'valid-jsdoc': [2, { prefer: { return: 'returns' }, requireReturn: false }],
'prefer-promise-reject-errors': 2,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest relaxing this new rule by adding allowEmptyReject: true to allow Promise.reject() to still work, but Promise.reject("no") to error

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, after thinking about it a bit more, disregard. the following code would still produce a catch w/ undefined which I would not want. so even Promise.reject should always be called with an error object.

async function example() {
  return Promise.reject();
}
(async () => {
  try {
  	const res = await example();
  } catch (e) {
    console.log('err', e); // undefined
  }
})();

//
// Whitespace or other stylistic rules. No --fix option exists in eslint,
// but previously existed in jscs
Expand Down