Navigation Menu

Skip to content

Commit

Permalink
reafctor: Remove impossible case handling from makeErr
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Okonetchnikov committed Oct 28, 2018
1 parent 2bd723a commit f570d60
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/resolveTaskFn.js
Expand Up @@ -65,21 +65,15 @@ function throwError(message) {
function makeErr(linter, result, context = {}) {
// Indicate that some linter will fail so we don't update the index with formatting changes
context.hasErrors = true // eslint-disable-line no-param-reassign
const { stdout, stderr, failed, killed, signal } = result
if (failed) {
return throwError(dedent`${symbols.error} ${chalk.redBright(
`${linter} found some errors. Please fix them and try committing again.`
)}
${stdout}
${stderr}
`)
}
const { stdout, stderr, killed, signal } = result
if (killed || (signal && signal !== '')) {
return throwError(
`${symbols.warning} ${chalk.yellow(`${linter} was terminated with ${signal}`)}`
)
}
return throwError(dedent`${symbols.error} ${chalk.redBright('Unexpected error occured')}
return throwError(dedent`${symbols.error} ${chalk.redBright(
`${linter} found some errors. Please fix them and try committing again.`
)}
${stdout}
${stderr}
`)
Expand Down

0 comments on commit f570d60

Please sign in to comment.