Skip to content

Commit

Permalink
Properly resolve base config (#545)
Browse files Browse the repository at this point in the history
  • Loading branch information
Richienb committed May 11, 2021
1 parent e9c96a1 commit d2c5750
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/options-manager.js
Expand Up @@ -52,6 +52,9 @@ resolveFrom.silent = (moduleId, fromDirectory) => {
} catch { }
};

// TODO: Use `resolveModule(normalizePackageName(name), import.meta.url);` when moving to ESM then to `import.meta.resolve(normalizePackageName(name))` when supported
const resolveLocalConfig = name => resolveModule(normalizePackageName(name, 'eslint-config'), require.main.filename);

const nodeVersion = process && process.version;
const cacheLocation = findCacheDir({name: CACHE_DIR_NAME}) || path.join(os.homedir() || os.tmpdir(), '.xo-cache/');

Expand All @@ -62,7 +65,7 @@ const DEFAULT_CONFIG = {
globInputPaths: false,
baseConfig: {
extends: [
resolveFrom('eslint-config-xo'),
resolveLocalConfig('xo'),
path.join(__dirname, '../config/overrides.js'),
path.join(__dirname, '../config/plugins.js')
]
Expand Down

0 comments on commit d2c5750

Please sign in to comment.