Skip to content

fix: treat Sanity blueprint files as convention entries - #1748

Draft
skoshx wants to merge 2 commits into
mainfrom
cursor/triage-1747-5bd6
Draft

fix: treat Sanity blueprint files as convention entries#1748
skoshx wants to merge 2 commits into
mainfrom
cursor/triage-1747-5bd6

Conversation

@skoshx

@skoshx skoshx commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Root Cause

sanity.blueprint.ts is a Sanity Studio convention file that the Sanity CLI loads by filename (via sanity blueprints deploy), similar to how it loads sanity.config.ts and sanity.cli.ts. The Blueprints feature was introduced in Sanity Studio v3 and is documented at https://www.sanity.io/docs/compute-and-ai/blueprints.

The file was incorrectly reported as unused by react-doctor/unused-file because it was not included in the alwaysUsed array in FRAMEWORK_PATTERNS for Sanity.

Scope Decision

What was changed:

  • Added sanity.blueprint.{ts,js} to the alwaysUsed list in the Sanity framework pattern definition
  • Added a regression test that verifies blueprint files and their regular imports are not reported as unused

What was deliberately not changed:

  • No changes to string-based module references within blueprint files (e.g., src: "./functions/auto-redirect" in defineDocumentFunction). These are runtime paths resolved by the Sanity CLI and are outside the scope of this fix.
  • No changes to other Sanity convention files (they're already correctly recognized)

Expected impact:
This fix will only affect Sanity Studio projects (with sanity or @sanity/* dependencies) that have a sanity.blueprint.ts or sanity.blueprint.js file. Those files will no longer be incorrectly flagged as unused.

Testing

  • ✅ Unit test added: treats Sanity blueprint configuration as a convention entry
  • ✅ All 136 project-analysis tests pass
  • ✅ Lint and typecheck pass
  • ✅ Changeset added (patch)

Closes #1747

Open in Web Open in Cursor 

cursoragent and others added 2 commits September 2, 2026 07:33
Fixes #1747

sanity.blueprint.ts is a Sanity Studio convention file loaded by
filename by the Sanity CLI (sanity blueprints deploy), similar to
sanity.config.ts and sanity.cli.ts. It was incorrectly reported as
unused by react-doctor/unused-file.

Added sanity.blueprint.{ts,js} to the alwaysUsed list in
FRAMEWORK_PATTERNS for Sanity, with a regression test.

Co-authored-by: Skosh <skoshx@users.noreply.github.com>
Co-authored-by: Skosh <skoshx@users.noreply.github.com>
@pkg-pr-new

pkg-pr-new Bot commented Sep 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/eslint-plugin-react-doctor@1748
npm i https://pkg.pr.new/oxlint-plugin-react-doctor@1748
npm i https://pkg.pr.new/react-doctor@1748

commit: e2c486a

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Interactive terminal E2E

Terminal Control verified the built CLI at e2c486a in a real PTY:

  • selected a project interactively and observed Scanning... before the three-second Git delay completed
  • waited for the clean result and exercised the compact report
  • opened copy context and the GitHub Actions confirmation, then cancelled safely

Download the edited MP4 and PNG evidence

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.

unused-file: sanity.blueprint.ts is a Sanity convention entry (patch + branch ready)

2 participants