Skip to content

Commit d2c5750

Browse files
authored
Properly resolve base config (#545)
1 parent e9c96a1 commit d2c5750

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/options-manager.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ resolveFrom.silent = (moduleId, fromDirectory) => {
5252
} catch { }
5353
};
5454

55+
// TODO: Use `resolveModule(normalizePackageName(name), import.meta.url);` when moving to ESM then to `import.meta.resolve(normalizePackageName(name))` when supported
56+
const resolveLocalConfig = name => resolveModule(normalizePackageName(name, 'eslint-config'), require.main.filename);
57+
5558
const nodeVersion = process && process.version;
5659
const cacheLocation = findCacheDir({name: CACHE_DIR_NAME}) || path.join(os.homedir() || os.tmpdir(), '.xo-cache/');
5760

@@ -62,7 +65,7 @@ const DEFAULT_CONFIG = {
6265
globInputPaths: false,
6366
baseConfig: {
6467
extends: [
65-
resolveFrom('eslint-config-xo'),
68+
resolveLocalConfig('xo'),
6669
path.join(__dirname, '../config/overrides.js'),
6770
path.join(__dirname, '../config/plugins.js')
6871
]

0 commit comments

Comments
 (0)