diff --git a/lib/rules/index.js b/lib/rules/index.js index d7e78ab8..b5ca69d8 100644 --- a/lib/rules/index.js +++ b/lib/rules/index.js @@ -67,15 +67,13 @@ function coreRules(meta) { ] } -function loadPlugin(pluginName, { reporter, config, inputSrc, fileName }) { +function loadPlugin(pluginPath, { reporter, config, inputSrc, fileName }) { let plugins try { - plugins = require(`solhint-plugin-${pluginName}`) + plugins = require(`${pluginPath}`) } catch (e) { console.error( - chalk.red( - `[solhint] Error: Could not load solhint-plugin-${pluginName}, make sure it's installed.` - ) + chalk.red(`[solhint] Error: Could not load ${pluginPath}, make sure it's installed.`) ) process.exit(1) } @@ -83,7 +81,7 @@ function loadPlugin(pluginName, { reporter, config, inputSrc, fileName }) { if (!Array.isArray(plugins)) { console.warn( chalk.yellow( - `[solhint] Warning: Plugin solhint-plugin-${pluginName} doesn't export an array of rules. Ignoring it.` + `[solhint] Warning: Plugin ${pluginPath} doesn't export an array of rules. Ignoring it.` ) ) return [] @@ -92,7 +90,7 @@ function loadPlugin(pluginName, { reporter, config, inputSrc, fileName }) { return plugins .map((Plugin) => new Plugin(reporter, config, inputSrc, fileName)) .map((plugin) => { - plugin.ruleId = `${pluginName}/${plugin.ruleId}` + plugin.ruleId = `${pluginPath}/${plugin.ruleId}` return plugin }) }