From 0c199fa998f1d416116d4f8cebe2b9dde590c4f6 Mon Sep 17 00:00:00 2001 From: gonzaloriestra <14979109+gonzaloriestra@users.noreply.github.com> Date: Wed, 3 Jun 2026 00:32:30 +0000 Subject: [PATCH] [Refactor] Use uniq helper in theme check Replace manual `Set` spreads with the `uniq` helper in `packages/theme/src/cli/services/check.ts` for better consistency and readability. Added nullish coalescing to handle potentially undefined `ignore` patterns. --- packages/theme/src/cli/services/check.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/theme/src/cli/services/check.ts b/packages/theme/src/cli/services/check.ts index 090eb9ec370..c7f74076327 100644 --- a/packages/theme/src/cli/services/check.ts +++ b/packages/theme/src/cli/services/check.ts @@ -2,6 +2,7 @@ import {fileExists, readFileSync, writeFile} from '@shopify/cli-kit/node/fs' import {outputResult, outputInfo, outputSuccess} from '@shopify/cli-kit/node/output' import {joinPath} from '@shopify/cli-kit/node/path' import {renderInfo} from '@shopify/cli-kit/node/ui' +import {uniq} from '@shopify/cli-kit/common/array' import { Severity, applyFixToString, @@ -292,7 +293,7 @@ export async function outputActiveConfig(themeRoot: string, configPath?: string, // Depending on how the configs were merged during loadConfig, there may be // duplicate patterns to ignore. We can clean them before outputting. - ignore: [...new Set(ignore)], + ignore: uniq(ignore ?? []), rootUri, @@ -307,7 +308,7 @@ export async function outputActiveChecks(root: string, configPath?: string, envi const {settings, ignore, checks} = await loadConfig(configPath, root) // Depending on how the configs were merged during loadConfig, there may be // duplicate patterns to ignore. We can clean them before outputting. - const ignorePatterns = [...new Set(ignore)] + const ignorePatterns = uniq(ignore ?? []) const checkCodes = Object.keys(settings)