Skip to content

Commit c1cb555

Browse files
committed
feat: support opts for lint
1 parent dbcd202 commit c1cb555

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

run.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,27 @@ function getHistoryCommits(from, to) {
6060
})
6161
}
6262

63+
function getOptsFromConfig(config) {
64+
return {
65+
parserOpts:
66+
config.parserPreset != null && config.parserPreset.parserOpts != null
67+
? config.parserPreset.parserOpts
68+
: {},
69+
plugins: config.plugins != null ? config.plugins : {},
70+
ignores: config.ignores != null ? config.ignores : [],
71+
defaultIgnores:
72+
config.defaultIgnores != null ? config.defaultIgnores : true,
73+
}
74+
}
75+
6376
const showLintResults = async ([from, to]) => {
6477
const commits = await getHistoryCommits(from, to)
6578
const config = existsSync(configPath)
6679
? await load({}, { file: configPath })
6780
: {}
81+
const opts = getOptsFromConfig(config)
6882
const results = await Promise.all(
69-
commits.map(commit => lint(commit, config.rules)),
83+
commits.map(commit => lint(commit, config.rules, opts)),
7084
)
7185
const formattedResults = format(
7286
{ results },

0 commit comments

Comments
 (0)