diff --git a/src/textlint-rule-morpheme-match.js b/src/textlint-rule-morpheme-match.js index b996312..46ff902 100644 --- a/src/textlint-rule-morpheme-match.js +++ b/src/textlint-rule-morpheme-match.js @@ -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);