diff --git a/run.js b/run.js index ac36a94..ead6296 100644 --- a/run.js +++ b/run.js @@ -86,13 +86,27 @@ function getHistoryCommits(from, to) { }) } +function getOptsFromConfig(config) { + return { + parserOpts: + config.parserPreset != null && config.parserPreset.parserOpts != null + ? config.parserPreset.parserOpts + : {}, + plugins: config.plugins != null ? config.plugins : {}, + ignores: config.ignores != null ? config.ignores : [], + defaultIgnores: + config.defaultIgnores != null ? config.defaultIgnores : true, + } +} + const showLintResults = async ([from, to]) => { const commits = await getHistoryCommits(from, to) const config = existsSync(configPath) ? await load({}, { file: configPath }) : {} + const opts = getOptsFromConfig(config) const results = await Promise.all( - commits.map(commit => lint(commit, config.rules)), + commits.map(commit => lint(commit, config.rules, opts)), ) const formattedResults = format( { results },