Skip to content

Commit

Permalink
fix: if rules is undefined, it skip
Browse files Browse the repository at this point in the history
  • Loading branch information
yutak23 committed Oct 1, 2024
1 parent eb37422 commit 87315f9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/lib/rule-finder.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ function _getPluginRules(config) {
const pluginConfig = normalized ? require(normalized.module) : null;
const rules = pluginConfig ? pluginConfig.rules : plugins[plugin].rules;

Object.keys(rules).forEach(ruleName =>
pluginRules.set(`${normalized ? normalized.prefix : plugin}/${ruleName}`, rules?.[ruleName])
);
if (rules) {
Object.keys(rules).forEach(ruleName =>
pluginRules.set(`${normalized ? normalized.prefix : plugin}/${ruleName}`, rules[ruleName])
);
}
});
}
return pluginRules;
Expand Down

0 comments on commit 87315f9

Please sign in to comment.