Skip to content

🐛 Astro: useValidAnchor does not recognize shorthand properties ({href}) inside expressions. #11496

Description

@PFiS1737

Environment information

Details
CLI:
  Version:                      2.5.10
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_DISTRIBUTION:                npm
  BIOME_LOG_FILE:                    unset
  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
  BIOME_BINARY:                      unset
  RUST_BACKTRACE:                    unset
  NO_COLOR:                     unset
  TERM:                         xterm-kitty
  JS_RUNTIME_VERSION:           v26.7.0
  JS_RUNTIME_NAME:              node
  NODE_PACKAGE_MANAGER:         pnpm/11.3.0

Biome Configuration:
  Status:                       Loaded successfully.
  Path:                         biome.jsonc
  Formatter enabled:            true
  Linter enabled:               true
  Assist enabled:               true
  VCS enabled:                  true
  HTML full support enabled:    true

Workspace:
  Open Documents:               0

What happened?

Note that shorthand properties inside <a> tags in the template are recognized correctly, whereas those inside expressions are not.

https://next.biomejs.dev/playground/?lintRules=useValidAnchor&analyzerFixMode=safeAndUnsafeFixes&tab=formatter&pane=Console&language=astro#code=LQAtAC0ACgBjAG8AbgBzAHQAIABoAHIAZQBmACAAPQAgACIAaAB0AHQAcAA6AC8ALwBlAHgAYQBtAHAAbABlAC4AYwBvAG0AIgAKAC0ALQAtAAoACgA8AGEAIABoAHIAZQBmAD0AIgBoAHQAdABwADoALwAvAGUAeABhAG0AcABsAGUALgBjAG8AbQAiAD4AZgBvAG8APAAvAGEAPgAKAAoAPABhACAAewBoAHIAZQBmAH0APgBmAG8AbwA8AC8AYQA%2BAAoACgB7AAoAIAAgACgACgAgACAAIAAgADwAPgAKACAAIAAgACAAIAAgADwAYQAgAGgAcgBlAGYAPQAiAGgAdAB0AHAAOgAvAC8AZQB4AGEAbQBwAGwAZQAuAGMAbwBtACIAPgBmAG8AbwA8AC8AYQA%2BAAoAIAAgACAAIAAgACAAPABhACAAewBoAHIAZQBmAH0APgBmAG8AbwA8AC8AYQA%2BAAoAIAAgACAAIAA8AC8APgAKACAAIAApAAoAfQAKAA%3D%3D

Expected result

It should not throw an error.

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LinterArea: linterL-HTMLLanguage: HTML and super languagesS-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