Skip to content

Commit

Permalink
Exit on fatal ESLint errors
Browse files Browse the repository at this point in the history
Closes #26
  • Loading branch information
samuelmeuli committed Mar 28, 2020
1 parent 53da281 commit cba6524
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/linters/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,15 @@ class ESLint {
for (const violation of outputJson) {
const { filePath, messages } = violation;
const path = filePath.substring(dir.length + 1);

for (const msg of messages) {
const { line, message, ruleId, severity } = msg;
const { fatal, line, message, ruleId, severity } = msg;

// Exit if a fatal ESLint error occurred
if (fatal) {
throw Error(`ESLint error: ${message}`);
}

const entry = {
path,
firstLine: line,
Expand Down

0 comments on commit cba6524

Please sign in to comment.