Skip to content

Commit bc5d390

Browse files
committed
fix: handle unhandled promise rejections in whitespace-async.js
Add .catch() handlers to promise chains in whitespace-async.js files to prevent unhandled rejections and provide clear error messages.
1 parent 05aabc4 commit bc5d390

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

packages/eslint-config-airbnb-base/whitespace-async.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,7 @@ async function onlyErrorOnRules(rulesToError, config) {
4646
return errorsOnly;
4747
}
4848

49-
onlyErrorOnRules(whitespaceRules, baseConfig).then((config) => console.log(JSON.stringify(config)));
49+
onlyErrorOnRules(whitespaceRules, baseConfig).then((config) => console.log(JSON.stringify(config))).catch((error) => {
50+
console.error(error);
51+
process.exit(1);
52+
});

packages/eslint-config-airbnb/whitespace-async.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,7 @@ async function onlyErrorOnRules(rulesToError, config) {
4646
return errorsOnly;
4747
}
4848

49-
onlyErrorOnRules(whitespaceRules, baseConfig).then((config) => console.log(JSON.stringify(config)));
49+
onlyErrorOnRules(whitespaceRules, baseConfig).then((config) => console.log(JSON.stringify(config))).catch((error) => {
50+
console.error(error);
51+
process.exit(1);
52+
});

0 commit comments

Comments
 (0)