Skip to content

fix(lint): skip useJsxKeyInIterable in Astro templates#9651

Closed
raashish1601 wants to merge 2 commits intobiomejs:mainfrom
raashish1601:fix-9572-no-jsx-key-astro-template
Closed

fix(lint): skip useJsxKeyInIterable in Astro templates#9651
raashish1601 wants to merge 2 commits intobiomejs:mainfrom
raashish1601:fix-9572-no-jsx-key-astro-template

Conversation

@raashish1601
Copy link
Copy Markdown

Summary

  • skip useJsxKeyInIterable for Astro template expressions, where keyed JSX elements are not required
  • add a regression spec for the reported .astro case
  • cover the Astro guard with a focused analyzer unit test and keep the existing JSX behavior checked

Testing

  • cargo test -p biome_js_analyze --lib use_jsx_key_in_iterable::tests
  • cargo test -p biome_js_analyze --test spec_tests valid_issue_9572
  • cargo test -p biome_js_analyze --test spec_tests use_jsx_key_in_iterable

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 29, 2026

🦋 Changeset detected

Latest commit: 520bd2c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Mar 29, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1612cbf5-a834-4845-8b6b-2d6a7bfa1f3e

📥 Commits

Reviewing files that changed from the base of the PR and between 278fd4b and 520bd2c.

📒 Files selected for processing (1)
  • crates/biome_js_analyze/src/lint/correctness/use_jsx_key_in_iterable.rs

Walkthrough

This change updates the useJsxKeyInIterable correctness lint to detect Astro template-expression embeddings and return immediately (no diagnostics) when analysing those contexts. It adds unit tests exercising Astro template-expression arrow-mapped JSX and JSX element arrays (expecting 0 diagnostics) and a TSX mapping case (expecting 1 diagnostic). A new Astro spec file asserting no diagnostics for an iterable-rendered <div> without key was also added, and a changeset marks a patch release for @biomejs/biome.

Possibly related PRs

Suggested reviewers

  • siketyan
  • dyc3
  • ematipico
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: skipping the useJsxKeyInIterable lint rule in Astro templates, which directly aligns with the primary objective of the PR.
Description check ✅ Passed The description provides relevant context about the changeset, including the motivation (keyed JSX not required in Astro), the additions (regression spec and unit tests), and specific testing commands.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 29, 2026

Merging this PR will not alter performance

✅ 58 untouched benchmarks
⏩ 168 skipped benchmarks1


Comparing raashish1601:fix-9572-no-jsx-key-astro-template (520bd2c) with main (c17e08e)2

Open in CodSpeed

Footnotes

  1. 168 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (cc6f2f6) during the generation of this report, so c17e08e was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@Conaclos Conaclos added the M-Likely Agent This was likely an automated PR without a human in the loop label Mar 29, 2026
@ematipico ematipico closed this Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter L-JavaScript Language: JavaScript and super languages M-Likely Agent This was likely an automated PR without a human in the loop

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants