From d2c57507cdc2a77bb8f3a40cbb7858272c4fbecf Mon Sep 17 00:00:00 2001 From: Richie Bendall Date: Wed, 12 May 2021 00:11:45 +1200 Subject: [PATCH] Properly resolve base config (#545) --- lib/options-manager.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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') ]