Skip to content

Commit 8a2169f

Browse files
committed
fix: add one more missing type guard
1 parent f1ce3c5 commit 8a2169f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

@commitlint/load/src/load.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,15 @@ export default async function load(
7171
}
7272

7373
let plugins: PluginRecords = {};
74-
uniq(extended.plugins || []).forEach((plugin) => {
75-
if (typeof plugin === 'string') {
76-
plugins = loadPlugin(plugins, plugin, process.env.DEBUG === 'true');
77-
} else {
78-
plugins.local = plugin;
79-
}
80-
});
74+
if (Array.isArray(extended.plugins)) {
75+
uniq(extended.plugins || []).forEach((plugin) => {
76+
if (typeof plugin === 'string') {
77+
plugins = loadPlugin(plugins, plugin, process.env.DEBUG === 'true');
78+
} else {
79+
plugins.local = plugin;
80+
}
81+
});
82+
}
8183

8284
const rules = (
8385
await Promise.all(

0 commit comments

Comments
 (0)