Skip to content

feat: add DeprecatedFontsOnSettingsData check for config/settings_data.json#1174

Open
SinhSinhAn wants to merge 1 commit intoShopify:mainfrom
SinhSinhAn:feat/deprecated-fonts-settings-data
Open

feat: add DeprecatedFontsOnSettingsData check for config/settings_data.json#1174
SinhSinhAn wants to merge 1 commit intoShopify:mainfrom
SinhSinhAn:feat/deprecated-fonts-settings-data

Conversation

@SinhSinhAn
Copy link
Copy Markdown

Summary

  • Add new DeprecatedFontsOnSettingsData JSON check that warns on deprecated font handles in config/settings_data.json

This complements the existing DeprecatedFontsOnSectionsAndBlocks (sections/blocks {% schema %} tags) and DeprecatedFontsOnSettingsSchema (config/settings_schema.json) checks by covering the remaining unchecked surface: saved preset values in settings_data.json.

How it works

The check walks all string literal Property values in config/settings_data.json and flags any that match the shared DEPRECATED_FONT_HANDLES set. This covers:

  • current settings (live theme values)
  • presets (theme demo presets)
  • Deeply nested block settings within presets

Implementation details

  • Reuses the shared DEPRECATED_FONT_HANDLES set from deprecated-fonts-data.ts
  • Follows the same pattern as DeprecatedFontsOnSettingsSchema
  • Registered in allChecks with recommended: true

Tests

6 test cases covering:

  • Deprecated font in current settings
  • Deprecated fonts in presets
  • No warnings for non-deprecated fonts
  • No warnings for non-string values
  • File targeting (only config/settings_data.json)
  • Deeply nested block settings

All existing tests continue to pass (21 tests across the other two deprecated font checks).

Closes #1008

Add a new theme check that warns when `config/settings_data.json`
contains deprecated font handles. This complements the existing
`DeprecatedFontsOnSectionsAndBlocks` and `DeprecatedFontsOnSettingsSchema`
checks by covering the saved preset values in settings_data.json,
which was the remaining unchecked surface for deprecated fonts.

The check walks all string literal values in the JSON and flags any
that match the shared DEPRECATED_FONT_HANDLES set.

Closes Shopify#1008
@SinhSinhAn SinhSinhAn requested a review from a team as a code owner April 10, 2026 07:33
docs: {
description: 'Warns on deprecated fonts in settings_data settings values.',
recommended: true,
url: 'https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/deprecated-fonts-on-settings-data',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can go make this documentation once this is merged

Copy link
Copy Markdown
Contributor

@aswamy aswamy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SinhSinhAn I ran your code and it looks good!
Image

Can you create a patch changeset file? You can do that by running yarn changeset. It should look something like in this PR.

@aswamy
Copy link
Copy Markdown
Contributor

aswamy commented Apr 17, 2026

Also run yarn build on the project. Adding new theme check should have modified theme-check-node/configs/all.yml and theme-check-node/configs/recommended.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check for deprecated fonts

2 participants