Skip to content

Commit

Permalink
fix(plugin): Rename rules according to plugin name
Browse files Browse the repository at this point in the history
  • Loading branch information
ta2edchimp committed Mar 20, 2016
1 parent 80ef25d commit 81e1b47
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ function getCurrentRules(conf) {
return rules
}

function mapPluginRuleNames(plugin) {
return function mapPluginNames(rule) {
return plugin + '/' + rule
}
}

function getPluginRules(conf) {
var rules = []
var plugins = conf.plugins
Expand All @@ -66,7 +72,7 @@ function getPluginRules(conf) {
var thisPluginsConfig = require('eslint-plugin-' + plugin)
var thisPluginsRules = thisPluginsConfig.rules
if (typeof thisPluginsRules === 'object') {
rules = rules.concat(Object.keys(thisPluginsRules))
rules = rules.concat(Object.keys(thisPluginsRules).map(mapPluginRuleNames(plugin)))
}
})
}
Expand Down

0 comments on commit 81e1b47

Please sign in to comment.