Skip to content

Respect user .theme-check.yml in theme app extension builds#7391

Open
erikmay wants to merge 1 commit intoShopify:mainfrom
erikmay:feat/theme-check-respect-user-config
Open

Respect user .theme-check.yml in theme app extension builds#7391
erikmay wants to merge 1 commit intoShopify:mainfrom
erikmay:feat/theme-check-respect-user-config

Conversation

@erikmay
Copy link
Copy Markdown

@erikmay erikmay commented Apr 24, 2026

Summary

runThemeCheck in packages/app/src/cli/services/build/theme-check.ts hardcodes the config identifier 'theme-check:theme-app-extension', which bypasses theme-check-node's user-config discovery (findConfigPath). As a result, a .theme-check.yml placed in the theme app extension root is ignored during shopify app dev and shopify app deploy, even though the standalone shopify theme check command respects it.

This PR makes runThemeCheck check for .theme-check.yml in the extension directory and pass undefined to check() when present, letting theme-check-node auto-discover the user config. When absent, the existing bundled theme-check:theme-app-extension defaults are applied exactly as before — no behavior change for extensions without a user config.

Motivation

Theme app extensions only allow a fixed set of top-level directories (assets/, blocks/, snippets/, locales/, config/). Authors who want a separate source directory (e.g. uncompiled Liquid / TS / Tailwind that gets built into blocks/ + assets/) currently have two options:

  1. Dot-prefix the source dir (.src/) so theme-check's **/*.{liquid,json} glob skips it.
  2. Fork the CLI.

Option 1 works but is surprising and fragile. Option 2 is heavy. With this change, a plain src/ source directory works as expected:

# extensions/my-extension/.theme-check.yml
extends: theme-check:theme-app-extension
ignore:
  - "src/**"
  - "node_modules/**"

Changes

  • packages/app/src/cli/services/build/theme-check.ts: check for .theme-check.yml and fall through to user-config discovery when present.
  • Added a changeset (@shopify/app patch).

Test plan

  • Theme app extension without .theme-check.ymlshopify app dev and shopify app deploy produce identical theme-check output to before (uses bundled theme-app-extension defaults).
  • Theme app extension with .theme-check.yml extending theme-check:theme-app-extension and adding ignore: ['src/**']shopify app dev skips src/** offenses.
  • Same .theme-check.yml with a custom check severity override — shopify app dev reflects the override.

@erikmay erikmay requested review from a team as code owners April 24, 2026 08:03
`runThemeCheck` hardcoded `theme-check:theme-app-extension`, which
bypassed theme-check-node's user-config discovery. Users who wanted to
`ignore:` source directories had to fork the CLI or rely on the
dot-prefix trick (hidden dirs are skipped by theme-check's glob).

When `.theme-check.yml` exists in the extension root, pass `undefined`
so theme-check-node auto-discovers the user config. When absent, keep
the existing bundled `theme-app-extension` defaults.
@erikmay erikmay force-pushed the feat/theme-check-respect-user-config branch from 8d0081f to fce73a5 Compare April 24, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant