Skip to content

Commit

Permalink
feat: apply ignorePresets when resolving the globalExtends array (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel-Ladzaretti authored Dec 2, 2024
1 parent bd8a187 commit 0a60dc1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/workers/global/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,11 @@ export async function validatePresets(config: AllConfig): Promise<void> {

export async function resolveGlobalExtends(
globalExtends: string[],
ignorePresets?: string[],
): Promise<AllConfig> {
try {
// Make a "fake" config to pass to resolveConfigPresets and resolve globalPresets
const config = { extends: globalExtends };
const config = { extends: globalExtends, ignorePresets };
const resolvedConfig = await resolveConfigPresets(config);
return resolvedConfig;
} catch (err) {
Expand Down Expand Up @@ -133,10 +134,13 @@ export async function start(): Promise<number> {
await instrument('config', async () => {
// read global config from file, env and cli args
config = await getGlobalConfig();
if (config?.globalExtends) {
if (is.nonEmptyArray(config?.globalExtends)) {
// resolve global presets immediately
config = mergeChildConfig(
await resolveGlobalExtends(config.globalExtends),
await resolveGlobalExtends(
config.globalExtends,
config.ignorePresets,
),
config,
);
}
Expand Down

0 comments on commit 0a60dc1

Please sign in to comment.