-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: tweak ESLint config, small refactors (#422)
* ci: update eslint config to warn about console.log calls also adding an explanatory comment * refactor: disable ESLint, slight refactors to make it more readable
- Loading branch information
1 parent
3d03bb8
commit f842480
Showing
2 changed files
with
21 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,25 +3,20 @@ const chalk = require('chalk'); | |
|
||
require('../src')(process.argv.slice(2)) | ||
.then(msg => { | ||
// eslint-disable-next-line no-console | ||
if (msg) console.log(msg); | ||
process.exit(0); | ||
return process.exit(0); | ||
}) | ||
.catch(e => { | ||
if (e) { | ||
const err = e; | ||
.catch(err => { | ||
let message = `Yikes, something went wrong! Please try again and if the problem persists, get in touch with our support team at ${chalk.underline( | ||
'[email protected]' | ||
)}.`; | ||
|
||
if ('message' in err) { | ||
console.error(chalk.red(`\n${err.message}\n`)); | ||
} else { | ||
console.error( | ||
chalk.red( | ||
`Yikes, something went wrong! Please try again and if the problem persists, get in touch with our support team at ${chalk.underline( | ||
'[email protected]' | ||
)}.\n` | ||
) | ||
); | ||
} | ||
if (err && 'message' in err) { | ||
message = err.message; | ||
} | ||
|
||
// eslint-disable-next-line no-console | ||
console.error(chalk.red(`\n${message}\n`)); | ||
return process.exit(1); | ||
}); |