diff --git a/lib/options-manager.js b/lib/options-manager.js index 6ba60ceb..0c81dc46 100644 --- a/lib/options-manager.js +++ b/lib/options-manager.js @@ -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/'); @@ -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') ]