Skip to content

fix(biome-js-analyze): detect json import attribute with trimmed text value instead of plain text value#6618

Merged
arendjr merged 2 commits intobiomejs:mainfrom
Shinyaigeek:useJsonImportAttribute-with-newline
Jun 29, 2025
Merged

fix(biome-js-analyze): detect json import attribute with trimmed text value instead of plain text value#6618
arendjr merged 2 commits intobiomejs:mainfrom
Shinyaigeek:useJsonImportAttribute-with-newline

Conversation

@Shinyaigeek
Copy link
Copy Markdown
Contributor

Summary

Fixes: #6610

When detecting JSON import attributes, we were previously using text(). However, text() includes newlines and other whitespace, leading to issues like #6610. To resolve this, we will now detect JSON import attributes by referring to the trimmed text value instead.

This is my first pull request to biome, so Please feel free to point out anything I might have missed!

Test Plan

I believe added test cases covers that

@github-actions github-actions Bot added A-Linter Area: linter A-Parser Area: parser L-JavaScript Language: JavaScript and super languages labels Jun 29, 2025
@Shinyaigeek Shinyaigeek changed the title Detect json import attribute with trimmed text value instead of plain text value fix(biome-js-analyze): Detect json import attribute with trimmed text value instead of plain text value Jun 29, 2025
@Shinyaigeek Shinyaigeek changed the title fix(biome-js-analyze): Detect json import attribute with trimmed text value instead of plain text value fix(biome-js-analyze): detect json import attribute with trimmed text value instead of plain text value Jun 29, 2025
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jun 29, 2025

CodSpeed Performance Report

Merging #6618 will not alter performance

Comparing Shinyaigeek:useJsonImportAttribute-with-newline (4db140d) with main (c13fc60)

Summary

✅ 115 untouched benchmarks

Copy link
Copy Markdown
Contributor

@arendjr arendjr 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, looks good!

Would you like to add a changeset still?

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 29, 2025

🦋 Changeset detected

Latest commit: 4db140d

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

@Shinyaigeek
Copy link
Copy Markdown
Contributor Author

Would you like to add a changeset still?

Oh, I missed that, Thank you! I added a changeset in
4db140d 👍

Copy link
Copy Markdown
Contributor

@arendjr arendjr 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!

@arendjr arendjr merged commit 6174869 into biomejs:main Jun 29, 2025
29 checks passed
@github-actions github-actions Bot mentioned this pull request Jun 29, 2025
@risu729
Copy link
Copy Markdown
Contributor

risu729 commented Jun 29, 2025

Thanks for the fix!

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

Labels

A-Linter Area: linter A-Parser Area: parser L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💅 useJsonImportAttribute cannot detect type: json in another line

3 participants