Skip to content

Commit

Permalink
[eslint-module-utils]: when parser settings are not an array, throw a…
Browse files Browse the repository at this point in the history
… better error message

Fixes #1149.
  • Loading branch information
ljharb committed Aug 2, 2018
1 parent 0336ef9 commit 2d4f651
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions utils/ignore.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ function makeValidExtensionSet(settings) {
// all alternate parser extensions are also valid
if ('import/parsers' in settings) {
for (let parser in settings['import/parsers']) {
settings['import/parsers'][parser]
.forEach(ext => exts.add(ext))
const parserSettings = settings['import/parsers'][parser]
if (!Array.isArray(parserSettings)) {
throw new TypeError('"settings" for ' + parser + ' must be an array')
}
parserSettings.forEach(ext => exts.add(ext))
}
}

Expand Down

0 comments on commit 2d4f651

Please sign in to comment.