Skip to content

Define "internalGroqTypeReferenceTo" at the top of the "sanity.types.ts" file generated with TypeGen #24

@eigilnikolajsen

Description

@eigilnikolajsen

The Biome linter displays errors in the "sanity.types.ts" generated by TypeGen because the "internalGroqReferenceTo" type is defined further down the file.
It's a small issue which I humbly believe can be resolved fairly easily.

To Reproduce

Steps to reproduce the behavior:

  1. Generate types using Sanity TypeGen. I personally run these commands:
{
    "scripts": {
        "extract": "sanity schema extract --path './src/studio/typegen/schema.json'",
        "generate": "sanity typegen generate --config-path './src/studio/typegen/sanity-typegen.json'"
    }
{

Expected behavior

The generated sanity.types.ts should define export declare const internalGroqTypeReferenceTo: unique symbol at the top of the file.

Screenshots

Screenshot 2024-08-29 at 12 52 41

Which versions of Sanity are you using?

- @sanity/cli (global)                   3.56.0 (up to date)
- @sanity/astro                           3.1.5 (latest: 3.1.6)
- @sanity/document-internationalization   3.0.1 (up to date)
- @sanity/image-url                       1.0.2 (up to date)
- @sanity/vision                         3.56.0 (up to date)
- sanity                                 3.56.0 (up to date)

What operating system are you using?

macOS Sonoma 14.5

Which versions of Node.js / npm are you running?

10.8.2
v20.17.0

Additional context

This is my sanity-typegen.json:

{
    "path": ["./src/studio/schemas/*.{ts,tsx,js,jsx}", "./src/scripts/queries.ts"],
    "schema": "./src/studio/typegen/schema.json",
    "generates": "./src/studio/typegen/sanity.types.ts",
    "overloadClientMethods": true
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions