Skip to content

Commit

Permalink
fix: add assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
azu committed Dec 22, 2018
1 parent a4ada89 commit 698b850
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/textlint-rule-morpheme-match.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ const reporter = (context, options) => {
`)
}

if (!Array.isArray(options.dictionaryPathList)) {
throw new Error(`"dictionaryPathList" option should be array.
{
dictionaryPathList: ["./path/to/dictionary.js", "./path/to/dictionary.json"]
}
`)
}

const textlintRcDir = context.getConfigBaseDir() || process.cwd();
const dictionaryList = loadDictionaries(textlintRcDir, options.dictionaryPathList);
const matchAll = createMatchAll(dictionaryList);
Expand Down

0 comments on commit 698b850

Please sign in to comment.