Skip to content

TypeScript File with GraphQL and gql`` crashes #9484

@JUSTIVE

Description

@JUSTIVE

Environment information

Details
CLI:
  Version:                      2.4.7
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_PATH:                    unset
  BIOME_LOG_PREFIX_NAME:             unset
  BIOME_LOG_LEVEL:                   unset
  BIOME_LOG_KIND:                    unset
  BIOME_CONFIG_PATH:                 unset
  BIOME_THREADS:                     unset
  BIOME_WATCHER_KIND:                unset
  BIOME_WATCHER_POLLING_INTERVAL:    unset
  NO_COLOR:                     unset
  TERM:                         xterm-256color
  JS_RUNTIME_VERSION:           v20.19.0
  JS_RUNTIME_NAME:              node
  NODE_PACKAGE_MANAGER:         pnpm/10.7.0

Biome Configuration:
  Error:                        The configuration schema version does not match the CLI version 2.4.7
  Status:                       Loaded with errors
  Path:                         biome.json
  Formatter enabled:            true
  Linter enabled:               false
  Assist enabled:               true
  VCS enabled:                  true
  HTML full support enabled:    unset

Formatter:
  Format with errors:           unset
  Indent style:                 Space
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Attribute position:           unset
  Bracket spacing:              unset
  Includes:                     unset

JavaScript Formatter:
  Enabled:                      true
  JSX quote style:              unset
  Quote properties:             unset
  Trailing commas:              ES5
  Semicolons:                   unset
  Arrow parentheses:            unset
  Bracket spacing:              unset
  Bracket same line:            unset
  Quote style:                  Single Quotes
  Indent style:                 Space
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   120
  Attribute position:           unset

JSON Formatter:
  Enabled:                      unset
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Trailing Commas:              unset
  Expand lists:                 unset

CSS Formatter:
  Enabled:                      unset
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Quote style:                  Single Quotes

GraphQL Formatter:
  Enabled:                      true
  Indent style:                 Space
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   120
  Bracket spacing:              unset
  Quote style:                  Single Quotes

Workspace:
  Open Documents:               0

after supporting graphql embedded tags, biome formatter started emitting errors such as
Invalid document: Expected end tag of kind Embedded but found Indent, Invalid document: Expected end tag of kind Embedded but found Group..

I made a minimum reproduction case below, shows Invalid document: Expected end tag of kind Embedded but found Indent on biome 2.4.7

Configuration

{
  "$schema": "https://biomejs.dev/schemas/2.4.7/schema.json",
  "vcs": {
    "enabled": true,
    "clientKind": "git",
    "useIgnoreFile": true
  },
  "files": {
    "includes": [
      "src/**/*.{ts,tsx}",
      "!src/.relay",
      "!dist",
      "!src/lib/graphql/enums.ts",
      "e2e/**/*.{ts,tsx}"
    ],
    "ignoreUnknown": false
  },
  "formatter": {
    "enabled": true,
    "indentStyle": "space"
  },
  "linter": {
    "enabled": false
  },
  "css": {
    "formatter": {
      "quoteStyle": "single"
    }
  },
  "javascript": {
    "experimentalEmbeddedSnippetsEnabled": true,
    "formatter": {
      "enabled": true,
      "indentStyle": "space",
      "lineWidth": 120,
      "quoteStyle": "single",
      "trailingCommas": "es5",
      "attributePosition": null,
      "bracketSameLine": null,
      "arrowParentheses": null
    }
  },
  "graphql": {
    "formatter": {
      "enabled": true,
      "indentStyle": "space",
      "lineWidth": 120,
      "quoteStyle": "single"
    }
  },

  "assist": {
    "enabled": true,
    "actions": {
      "source": {
        "organizeImports": "off"
      }
    }
  }
}

Playground link

https://biomejs.dev/playground/?lintRules=useExhaustiveDependencies&code=aQBtAHAAbwByAHQAIAB7ACAAZwByAGEAcABoAHEAbAAsACAAdQBzAGUATABhAHoAeQBMAG8AYQBkAFEAdQBlAHIAeQAgAH0AIABmAHIAbwBtACAAJwByAGUAYQBjAHQALQByAGUAbABhAHkAJwA7AAoACgBlAHgAcABvAHIAdAAgAGMAbwBuAHMAdAAgAFAAYQBnAGUAIAA9ACAAKAApACAAPQA%2BACAAewAKACAAIAByAGUAdAB1AHIAbgAgACgAPABkAGkAdgA%2BADwALwBkAGkAdgA%2BACkAOwAgAC8ALwBjAGgAYQBuAGcAZQAgAHQAbwAgAGAAcgBlAHQAdQByAG4AIAA8AGQAaQB2AD4APAAvAGQAaQB2AD4AYAAgAGYAaQB4AGUAcwAgAGUAcgByAG8AcgAKAH0AOwAKAAoAYwBvAG4AcwB0ACAAVABhAGIAbABlACAAPQAgACgAKQAgAD0APgAgAHsACgAgACAAYwBvAG4AcwB0ACAAcQB1AGUAcgB5ACAAPQAgAHUAcwBlAEwAYQB6AHkATABvAGEAZABRAHUAZQByAHkAKABnAHIAYQBwAGgAcQBsAGAACgAgACAAIAAgACAAIABxAHUAZQByAHkAIABRACAAewAKACAAIAAgACAAIAAgACAAIABmAGkAZQBsAGQACgAgACAAIAAgACAAIAB9AAoAIAAgACAAIABgACwAIAB7AH0AKQA7AAoAIAAgAHIAZQB0AHUAcgBuACAAPABkAGkAdgA%2BADwALwBkAGkAdgA%2BADsACgB9ADsACgA%3D

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-CoreArea: coreA-FormatterArea: formatterS-Bug-confirmedStatus: report has been confirmed as a valid bug

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions