diff --git a/lib/config/config-file.js b/lib/config/config-file.js index f101d8ff..3ae3c1d1 100644 --- a/lib/config/config-file.js +++ b/lib/config/config-file.js @@ -1,4 +1,5 @@ const fs = require('fs') +const path = require('path') const _ = require('lodash') const { cosmiconfigSync } = require('cosmiconfig') const { ConfigMissingError } = require('../common/errors') @@ -64,8 +65,15 @@ const loadConfig = (configFile) => { return searchedFor.config || createEmptyConfig() } -const configGetter = (path) => - path.startsWith('solhint:') ? getSolhintCoreConfig(path) : require(`solhint-config-${path}`) +const isAbsolute = path.isAbsolute +const configGetter = (path) => { + if (isAbsolute(path)) { + return require(path) + } + return path.startsWith('solhint:') + ? getSolhintCoreConfig(path) + : require(`solhint-config-${path}`) +} const applyExtends = (config, getter = configGetter) => { if (!config.extends) {