Skip to content

🐛 Astro dynamic redirects fail biome(parse) #2232

@AdoryVo

Description

@AdoryVo

Environment information

CLI:
  Version:                      1.6.3
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           windows

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         unset
  JS_RUNTIME_VERSION:           "v20.10.0"
  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. Add an Astro dynamic redirect to a .astro file. This involves adding return Astro.redirect('/url') to your Astro component script.
  2. Observe "Illegal return statement outside of a function" from biome(parse) in syntax highlighting as well as biome check output. See Biome playground snippet and picture.

image

Expected result

The return statement is legal in Astro files, as shown in the Astro docs, so an error should not be thrown.

Code of Conduct

  • I agree to follow Biome's Code of Conduct

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