Skip to content

Commit

Permalink
Fix TypeError when file is configured to be ignored
Browse files Browse the repository at this point in the history
Fixes #214.
  • Loading branch information
sonicdoe committed Dec 18, 2017
1 parent 2f20dc3 commit f553b49
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/utils/linter.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ module.exports = function (err, output) {
return this.deferred.reject(err)
}

// If the file is configured to be ignored, `results` will be empty.
// See https://eslint.org/docs/developer-guide/nodejs-api#executeontext.
if (output.results.length === 0) {
return this.deferred.resolve([])
}

var self = this
var config = atom.config.get('linter-js-standard')
var msgs = output.results[0].messages
Expand Down

0 comments on commit f553b49

Please sign in to comment.