Skip to content

fix(biome_js_analyze): produce diagnogstics for top-level useless fragment that is in a return statement#6544

Merged
ematipico merged 6 commits intobiomejs:mainfrom
tidefield:fix-6530
Jun 26, 2025
Merged

fix(biome_js_analyze): produce diagnogstics for top-level useless fragment that is in a return statement#6544
ematipico merged 6 commits intobiomejs:mainfrom
tidefield:fix-6530

Conversation

@tidefield
Copy link
Copy Markdown
Contributor

Fixes #6530

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 25, 2025

🦋 Changeset detected

Latest commit: 3792258

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 Jun 25, 2025
@tidefield tidefield changed the title fix(biome_js_analyze): generate dianogstics for top-level useless fragment [WIP] fix(biome_js_analyze): generate dianogstics for top-level useless fragment Jun 25, 2025
@tidefield tidefield marked this pull request as draft June 25, 2025 05:35
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jun 25, 2025

CodSpeed Performance Report

Merging #6544 will create unknown performance changes

Comparing daivinhtran:fix-6530 (3792258) with main (f28b075)

Summary

🆕 115 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 deserialize_from_json_str[biome.json] N/A 362.5 µs N/A
🆕 css_analyzer[bootstrap_18416142857265205439.css] N/A 487.4 ms N/A
🆕 css_analyzer[bulma_5641719244145477318.css] N/A 1.1 s N/A
🆕 css_analyzer[foundation_11602414662825430680.css] N/A 177.1 ms N/A
🆕 css_analyzer[pure_9395922602181450299.css] N/A 18.9 ms N/A
🆕 css_analyzer[tachyons_11778168428173736564.css] N/A 133.2 ms N/A
🆕 css_formatter[bootstrap_18416142857265205439.css] N/A 116.2 ms N/A
🆕 css_formatter[bulma_5641719244145477318.css] N/A 366.9 ms N/A
🆕 css_formatter[foundation_11602414662825430680.css] N/A 77.3 ms N/A
🆕 css_formatter[full_5814491140539129161.css] N/A 1.3 s N/A
🆕 css_formatter[materialize_5526761731747548557.css] N/A 84.2 ms N/A
🆕 css_formatter[pure_9395922602181450299.css] N/A 9.5 ms N/A
🆕 css_formatter[semantic_4685287698740288120.css] N/A 370.5 ms N/A
🆕 css_formatter[tachyons_11778168428173736564.css] N/A 37 ms N/A
🆕 bootstrap_18416142857265205439.css[cached] N/A 35.7 ms N/A
🆕 bootstrap_18416142857265205439.css[uncached] N/A 38.9 ms N/A
🆕 bulma_5641719244145477318.css[cached] N/A 111.3 ms N/A
🆕 bulma_5641719244145477318.css[uncached] N/A 118.3 ms N/A
🆕 foundation_11602414662825430680.css[cached] N/A 23 ms N/A
🆕 foundation_11602414662825430680.css[uncached] N/A 25.4 ms N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Comment on lines +8 to +10
const str = "str";
// should trigger
return <>{str}</>;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one can actually be unsafe (returning string instead of JSX.Element) so it can be a regression (see #4059 and #6508)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put the PR back to draft so I can fix it. I'll let you know when I'm done.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR is ready for review. Thanks for pointing out the regressions.

@tidefield tidefield changed the title [WIP] fix(biome_js_analyze): generate dianogstics for top-level useless fragment fix(biome_js_analyze): generate dianogstics for top-level useless fragment Jun 25, 2025
@tidefield tidefield force-pushed the fix-6530 branch 6 times, most recently from 6d16d4a to 3816991 Compare June 25, 2025 20:15
@tidefield tidefield marked this pull request as ready for review June 25, 2025 21:03
@tidefield tidefield requested a review from Loskir June 25, 2025 21:03
Copy link
Copy Markdown
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A changeset is missing. You can check our contribution guide for creating one

@tidefield tidefield changed the title fix(biome_js_analyze): generate dianogstics for top-level useless fragment fix(biome_js_analyze): produce diagnogstics for top-level useless fragment that is in a return statement Jun 26, 2025
@tidefield
Copy link
Copy Markdown
Contributor Author

tidefield commented Jun 26, 2025

A changeset is missing. You can check our contribution guide for creating one

@ematipico Thanks! PTAL. It's always a joy to contribute on this codebase.

Comment thread .changeset/slick-toes-yawn.md Outdated
Copy link
Copy Markdown
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @daivinhtran

@ematipico ematipico merged commit f28b075 into biomejs:main Jun 26, 2025
27 checks passed
@github-actions github-actions Bot mentioned this pull request Jun 26, 2025
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💅 noUselessFragments does not run for top-level fragments

3 participants