Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: apply ignorePresets when resolving the globalExtends array #32845

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
ignore global presets
  • Loading branch information
Gabriel-Ladzaretti committed Dec 2, 2024
commit 1dd8d9545fe7d599cd4298275373b7a616c51441
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)) {
viceice marked this conversation as resolved.
Show resolved Hide resolved
// resolve global presets immediately
config = mergeChildConfig(
await resolveGlobalExtends(config.globalExtends),
await resolveGlobalExtends(
config.globalExtends,
config.ignorePresets,
),
config,
);
}
Expand Down