Skip to content

🐛 In Svelte context=module Scripts error "import { type x ident }' are a TypeScript only feature." #2245

@minht11

Description

@minht11

Environment information

CLI:
  Version:                      1.6.3
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.11.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "pnpm/8.15.5"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

Workspace:
  Open Documents:               0

What happened?

  1. Have a Svelte component with code below
<script context="module" lang="ts">
	import { timeline, type TimelineSegment } from 'motion'
</script>
  1. Observe that type imports produce "import { type x ident }' are a TypeScript only feature". If imports are moved into regular svelte block, things work correctly.

Expected result

No error

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AnalyzerArea: analyzerS-Bug-confirmedStatus: report has been confirmed as a valid bugS-Help-wantedStatus: you're familiar with the code base and want to help the project

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions