+
Skip to content

Conversation

JeetuSuthar
Copy link
Contributor

This PR fixes a false positive in the lint/correctness/noUnknownProperty rule for CSS.

->Adds "navigation" to the list of known CSS properties, following the CSS View Transitions spec.
->Adds a test to ensure navigation: auto is not flagged as unknown.
Why:
The navigation property is valid for view transitions, but was previously not recognized by the linter, causing a false positive.

Test:
A test case is added to valid.css to confirm that navigation: auto is accepted.

Fixes #7340

…tic message

Fixed missing 'is' in the diagnostic message for the noDuplicateObjectKeys rule when applied to JSON files. The message now correctly reads 'This is where a duplicated key was declared again.' instead of 'This where a duplicated key was declared again.'

Fixes biomejs#7307
…s#7340)

- Adds 'navigation' to known CSS properties
- Adds test to ensure 'navigation: auto' is not flagged as unknown
- Follows CSS View Transitions spec: https://www.w3.org/TR/css-view-transitions-2/#view-transition-navigation-descriptor
Copy link

changeset-bot bot commented Aug 28, 2025

🦋 Changeset detected

Latest commit: ff39272

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

Copy link
Contributor

coderabbitai bot commented Aug 28, 2025

Walkthrough

Adds "navigation" to KNOWN_PROPERTIES in crates/biome_css_analyze/src/keywords.rs and appends a @view-transition block using navigation: auto to crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.css. Removes the JSON lint rule implementation file crates/biome_json_analyze/src/lint/suspicious/no_duplicate_object_keys.rs.

Assessment against linked issues

Objective Addressed Explanation
Recognise navigation: auto as a valid CSS property for @view-transition, avoiding false positives (#7340)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Deletion of JSON lint rule (crates/biome_json_analyze/src/lint/suspicious/no_duplicate_object_keys.rs) This removes a JSON-specific lint rule unrelated to the CSS noUnknownProperty objective (#7340).

Possibly related PRs

Suggested reviewers

  • ematipico
  • dyc3

Short, precise, and mildly delightful — thanks for the patch!

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added A-CLI Area: CLI A-Linter Area: linter L-CSS Language: CSS L-JSON Language: JSON and super languages labels Aug 28, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
crates/biome_json_analyze/src/lint/suspicious/no_duplicate_object_keys.rs (1)

86-86: Tiny wording polish for the diagnostic.

“duplicated key … again” is a tad clunky. Consider this crisper phrasing.

-                    "This is where a duplicated key was declared again."
+                    "This is where the duplicate key was redeclared."
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4a2bd2f and faeedc7.

⛔ Files ignored due to path filters (3)
  • crates/biome_cli/tests/snapshots/main_commands_check/check_json_files.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_lint/check_json_files.snap is excluded by !**/*.snap and included by **
  • crates/biome_json_analyze/tests/specs/suspicious/noDuplicateObjectKeys/invalid.json.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (3)
  • crates/biome_css_analyze/src/keywords.rs (1 hunks)
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.css (1 hunks)
  • crates/biome_json_analyze/src/lint/suspicious/no_duplicate_object_keys.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{rs,toml}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Format Rust and TOML files before committing (use just f/just format).

Files:

  • crates/biome_json_analyze/src/lint/suspicious/no_duplicate_object_keys.rs
  • crates/biome_css_analyze/src/keywords.rs
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

📄 CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_json_analyze/src/lint/suspicious/no_duplicate_object_keys.rs
  • crates/biome_css_analyze/src/keywords.rs
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.css
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_json_analyze/src/lint/suspicious/no_duplicate_object_keys.rs
  • crates/biome_css_analyze/src/keywords.rs
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.css
**/tests/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place test files under a tests/ directory in each crate

Files:

  • crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.css
🧠 Learnings (1)
📚 Learning: 2025-08-11T11:46:05.836Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:46:05.836Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Most diagnostic attributes may be specified only once (either on the type or a single field); #[advice] and #[verbose_advice] may appear multiple times and are recorded in declaration order

Applied to files:

  • crates/biome_json_analyze/src/lint/suspicious/no_duplicate_object_keys.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (25)
  • GitHub Check: Test Node.js API
  • GitHub Check: Documentation
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Bench (biome_html_parser)
  • GitHub Check: Bench (biome_html_formatter)
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Bench (biome_module_graph)
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: Bench (biome_package)
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: End-to-end tests
🔇 Additional comments (1)
crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.css (1)

71-74: LGTM: fixture proves the false positive is gone.

The case is clear and minimal; thanks for adding it.

@github-actions github-actions bot added A-Project Area: project L-JavaScript Language: JavaScript and super languages labels Aug 28, 2025
Copy link

codspeed-hq bot commented Aug 28, 2025

CodSpeed Performance Report

Merging #7351 will not alter performance

Comparing JeetuSuthar:fix-grammar-duplicate-object-keys (faeedc7) with main (1d2d4b1)1

Summary

✅ 133 untouched benchmarks

Footnotes

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

@JeetuSuthar JeetuSuthar reopened this Aug 28, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 18

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
crates/biome_js_analyze/src/lint/style/use_exponentiation_operator.rs (2)

154-159: Don't treat “unknown” as “no parens”; bail out instead

If does_exponentiation_expression_need_parens returns None (unable to decide), we currently emit the fix without parens, which risks changing semantics in tricky parents (e.g. extends/in). Prefer bailing out of the fix when the decision is unknown.

-        let new_node = if let Some(true) = does_exponentiation_expression_need_parens(node) {
-            make::parenthesized(new_node).into()
-        } else {
-            new_node
-        };
+        let needs_parens = does_exponentiation_expression_need_parens(node)?;
+        let new_node = if needs_parens {
+            make::parenthesized(new_node).into()
+        } else {
+            new_node
+        };

124-135: Trivia transfer bug: duplicate leading trivia, trailing lost

separator.leading_trivia() is used twice, so trailing trivia on the comma is dropped. This can misplace or lose comments.

-            .append_trivia_pieces(chain_trivia_pieces(
-                separator.leading_trivia().pieces(),
-                separator.leading_trivia().pieces(),
-            ))?;
+            .append_trivia_pieces(chain_trivia_pieces(
+                separator.leading_trivia().pieces(),
+                separator.trailing_trivia().pieces(),
+            ))?;
.github/workflows/main.yml (1)

22-27: Duplicate checkout step — remove the second one.

There are two consecutive “Checkout repository” steps; the second is redundant.

Apply this diff:

       - name: Checkout repository
         uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
-      - name: Support longpaths
+      - name: Support longpaths
         run: git config core.longpaths true
-      - name: Checkout repository
-        uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
.github/workflows/release_cli.yml (1)

249-256: Exclude the new private plugin-api package from npm publish

The publish loop excludes only js-api. With the addition of packages/@biomejs/plugin-api (private: true), this workflow will attempt to publish it and fail. Exclude it explicitly.

Apply this diff:

-      - name: Publish npm packages as latest
-        run: for package in packages/@biomejs/*; do if [ $package != "packages/@biomejs/js-api" ]; then npm publish $package --tag latest --access public --provenance; fi; done
+      - name: Publish npm packages as latest
+        run: for package in packages/@biomejs/*; do name=$(basename "$package"); if [ "$name" != "js-api" ] && [ "$name" != "plugin-api" ]; then npm publish "$package" --tag latest --access public --provenance; fi; done
         if: needs.build.outputs.prerelease != 'true'
         env:
           NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
-      - name: Publish npm packages as nightly
-        run: for package in packages/@biomejs/*; do if [ $package != "packages/@biomejs/js-api" ]; then npm publish $package --tag nightly --access public --provenance; fi; done
+      - name: Publish npm packages as nightly
+        run: for package in packages/@biomejs/*; do name=$(basename "$package"); if [ "$name" != "js-api" ] && [ "$name" != "plugin-api" ]; then npm publish "$package" --tag nightly --access public --provenance; fi; done
         if: needs.build.outputs.prerelease == 'true'
         env:
           NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
crates/biome_plugin_loader/src/lib.rs (1)

41-45: Update docs to reflect new Arc ownership

Call sites have been updated to use the new signature (e.g. biome_service/src/workspace/server.rs:507; plugin_loader tests in crates/biome_plugin_loader/src/lib.rs). Add or update the section in crates/biome_plugin_loader/README.md to document that BiomePlugin::load now takes Arc and explain the ownership model.

🧹 Nitpick comments (19)
crates/biome_js_analyze/src/lint/style/use_exponentiation_operator.rs (1)

173-176: Doc comment doesn’t match behaviour

The function inspects the parent context of the call to decide whether the resulting exponentiation expression needs wrapping, not whether “the given parent node needs parens as an exponent”.

-/// Determines whether the given parent node needs parens if used as the exponent in an exponentiation binary expression.
+/// Determines whether the exponentiation expression produced from this `Math.pow(...)` call
+/// needs parentheses in its parent context.
 fn does_exponentiation_expression_need_parens(node: &JsCallExpression) -> Option<bool> {
biome.json (1)

27-27: Scope creep: why include plugins/*.js in this CSS-only fix?

This widens the scanned set and seems unrelated to “noUnknownProperty/navigation”. If intentional, confirm it’s required here; otherwise, split into a separate PR. If you do keep it, consider whether you actually want plugins/**/*.js for nested plugins and ensure it won’t sweep test fixtures.

package.json (1)

21-25: New devDependency @biomejs/plugin-api (workspace) — intended in this PR?

Looks unrelated to the CSS property fix. Confirm it’s required; otherwise, move to a plugins-focused PR. If kept, ensure the workspace package exists and won’t be published accidentally. The @types/node bump is fine.

crates/biome_service/Cargo.toml (1)

55-56: Optional: consider disabling default features on biome_plugin_loader.

If biome_plugin_loader has heavy default features, you can keep builds lean and make js_plugin opt-in only. Validate before changing to avoid breakage.

Possible tweak:

- biome_plugin_loader     = { workspace = true }
+ biome_plugin_loader     = { workspace = true, default-features = false }
.changeset/keep-jsxeverywhere-variant.md (1)

1-7: Add a changeset for the CSS “navigation” property fix (issue #7340).

This PR’s headline is the CSS false positive; please include a dedicated changeset describing that user-facing fix and linking #7340.

Example skeleton:

---
"@biomejs/biome": patch
---
Fixes [#7340](https://github.com/biomejs/biome/issues/7340). The linter now recognises `navigation` as a valid CSS property for View Transitions, so `navigation: auto` is no longer flagged by `lint/correctness/noUnknownProperty`.
packages/@biomejs/plugin-api/index.d.ts (1)

1-3: API surface is minimal and clear; add quick JSDoc for DX

A tiny JSDoc helps plugin authors and keeps the public contract crisp.

Apply this diff:

-export type Severity = "fatal" | "error" | "warning" | "information" | "hint";
+/** Severity levels recognised by Biome plugin diagnostics. */
+export type Severity = "fatal" | "error" | "warning" | "information" | "hint";
 
-export function registerDiagnostic(severity: Severity, message: string): void;
+/**
+ * Record a diagnostic emitted by a JS plugin.
+ * @param severity Diagnostic severity.
+ * @param message Human-readable message.
+ */
+export function registerDiagnostic(severity: Severity, message: string): void;
packages/@biomejs/plugin-api/package.json (1)

6-11: Include index.js in published files (future-proofing)

If this package is ever made public, files should include index.js; otherwise the export resolves to a missing file.

Apply this diff:

   "files": [
     "README.md",
     "LICENSE-APACHE",
     "LICENSE-MIT",
-    "index.d.ts"
+    "index.d.ts",
+    "index.js"
   ],
crates/biome_plugin_loader/src/diagnostics.rs (3)

54-64: JS compile error: consider preserving the original error as source

You embed the JS error text in the message but drop the source. If feasible, attach it to source to keep richer context/stack traces.

Apply this diff (adjust if Error::from isn’t implemented for boa_engine::JsError):

-        Self::Compile(CompileDiagnostic {
-            message: MessageAndDescription::from(
-                markup! {"Failed to compile the JS plugin: "{value.to_string()}}.to_owned(),
-            ),
-            source: None,
-        })
+        Self::Compile(CompileDiagnostic {
+            message: MessageAndDescription::from(
+                markup! {"Failed to compile the JS plugin: "{value.to_string()}}.to_owned(),
+            ),
+            // Prefer preserving the original error if convertible; otherwise keep None.
+            source: None,
+        })

If boa_engine::JsError isn’t convertible, we can wrap the string in a generic error type and store it.


148-151: Message used for both message and description

Using the same content for both is acceptable. If you’d like a shorter headline and a detailed body, split them (short title in message, full details in description).


209-252: Add a JS error conversion test behind feature flag

Consider a small test under #[cfg(feature = "js_plugin")] that constructs a boa_engine::JsError and asserts it becomes PluginDiagnostic::Compile.

I can sketch the test scaffold if helpful.

crates/biome_js_runtime/src/module_loader.rs (2)

54-55: Follow-through on specifier variable change.

-        match resolve(&specifier, &base_dir, self.fs.as_ref(), &options) {
+        match resolve(&specifier_str, &base_dir, self.fs.as_ref(), &options) {

61-73: Optional: guard against pathological file sizes.

If plugins can load arbitrary files, consider a size cap before read_file_from_path to avoid loading huge blobs into memory. A simple stat + max bytes check suffices.

crates/biome_plugin_loader/src/thread_local.rs (1)

93-101: Docs: clarify drop behaviour.

With destructors registered, the “not dropped on thread exit” comment is outdated; update to reflect the new behaviour (or explicitly justify keeping None destructors if you choose not to implement them).

packages/@biomejs/plugin-api/index.js (1)

1-3: Intentional hard-throw is fine; ensure messaging stays accurate.

If the recommended package name changes, keep this string in sync. Consider adding a short README in the package to explain usage vs. the runtime shim.

crates/biome_plugin_loader/src/lib.rs (2)

62-75: Consider whether .cjs should be supported or explicitly rejected

If ESM-only is intentional, emit a clearer diagnostic for .cjs with guidance. Otherwise, include it here.


104-106: Prefer extension() over byte-suffix for .grit check

Safer and clearer; avoids false positives on weird paths.

-                    if rule.as_os_str().as_encoded_bytes().ends_with(b".grit") {
-                        let plugin =
-                            AnalyzerGritPlugin::load(fs.as_ref(), &plugin_path.join(rule))?;
+                    if rule.extension().is_some_and(|ext| ext == "grit") {
+                        let plugin =
+                            AnalyzerGritPlugin::load(fs.as_ref(), &plugin_path.join(&rule))?;
crates/biome_plugin_loader/Cargo.toml (1)

26-26: Add justification for biome_text_size dependency.

Looks fine; if it’s only used transitively, consider removing to keep the crate lean.

crates/biome_service/src/workspace/server.rs (1)

308-323: JSX-everywhere logic: guard is good; add quick tests for non-TS .js and .cjs.

Behaviour looks right (don’t override TS/JSX). Please ensure tests cover .js and .cjs with jsxEverywhere=true/false.

crates/biome_js_runtime/src/plugin_api.rs (1)

49-55: Span is None; consider allowing an overload with a span later.

Fine for first cut; keep a TODO for a third argument or an options object to pass a TextRange.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between af97d7f and ff39272.

⛔ Files ignored due to path filters (4)
  • Cargo.lock is excluded by !**/*.lock and included by **
  • crates/biome_js_analyze/tests/specs/style/useReadonlyClassProperties/valid.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_plugin_loader/src/snapshots/evaluate_in_worker_threads.snap is excluded by !**/*.snap and included by **
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml and included by **
📒 Files selected for processing (38)
  • .changeset/keep-jsxeverywhere-variant.md (1 hunks)
  • .changeset/use_readonly_class_properties_nested_assignment_fix.md (1 hunks)
  • .github/workflows/beta.yml (1 hunks)
  • .github/workflows/main.yml (1 hunks)
  • .github/workflows/preview.yml (3 hunks)
  • .github/workflows/pull_request.yml (1 hunks)
  • .github/workflows/release.yml (1 hunks)
  • .github/workflows/release_cli.yml (2 hunks)
  • .github/workflows/release_js_api.yml (1 hunks)
  • Cargo.toml (4 hunks)
  • biome.json (1 hunks)
  • crates/biome_cli/Cargo.toml (1 hunks)
  • crates/biome_css_analyze/src/keywords.rs (1 hunks)
  • crates/biome_js_analyze/Cargo.toml (1 hunks)
  • crates/biome_js_analyze/src/lint/style/use_exponentiation_operator.rs (2 hunks)
  • crates/biome_js_analyze/tests/specs/style/useReadonlyClassProperties/valid.ts (1 hunks)
  • crates/biome_js_runtime/Cargo.toml (1 hunks)
  • crates/biome_js_runtime/src/context.rs (1 hunks)
  • crates/biome_js_runtime/src/lib.rs (1 hunks)
  • crates/biome_js_runtime/src/module_loader.rs (1 hunks)
  • crates/biome_js_runtime/src/plugin_api.rs (1 hunks)
  • crates/biome_plugin_loader/Cargo.toml (1 hunks)
  • crates/biome_plugin_loader/src/analyzer_js_plugin.rs (1 hunks)
  • crates/biome_plugin_loader/src/diagnostics.rs (3 hunks)
  • crates/biome_plugin_loader/src/lib.rs (11 hunks)
  • crates/biome_plugin_loader/src/thread_local.rs (1 hunks)
  • crates/biome_service/Cargo.toml (1 hunks)
  • crates/biome_service/src/file_handlers/javascript.rs (2 hunks)
  • crates/biome_service/src/file_handlers/javascript.tests.rs (0 hunks)
  • crates/biome_service/src/workspace/server.rs (3 hunks)
  • crates/biome_service/src/workspace/server.tests.rs (2 hunks)
  • package.json (1 hunks)
  • packages/@biomejs/plugin-api/LICENSE-APACHE (1 hunks)
  • packages/@biomejs/plugin-api/LICENSE-MIT (1 hunks)
  • packages/@biomejs/plugin-api/index.d.ts (1 hunks)
  • packages/@biomejs/plugin-api/index.js (1 hunks)
  • packages/@biomejs/plugin-api/package.json (1 hunks)
  • plugins/plugin.js (1 hunks)
💤 Files with no reviewable changes (1)
  • crates/biome_service/src/file_handlers/javascript.tests.rs
✅ Files skipped from review due to trivial changes (5)
  • packages/@biomejs/plugin-api/LICENSE-MIT
  • packages/@biomejs/plugin-api/LICENSE-APACHE
  • crates/biome_js_analyze/Cargo.toml
  • .changeset/use_readonly_class_properties_nested_assignment_fix.md
  • crates/biome_js_runtime/Cargo.toml
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/biome_css_analyze/src/keywords.rs
🧰 Additional context used
📓 Path-based instructions (9)
.changeset/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

.changeset/*.md: Create changesets with just new-changeset; store them in .changeset/ with correct frontmatter (package keys and change type).
In changeset descriptions, follow content conventions: user-facing changes only; past tense for what you did; present tense for current behavior; link issues for fixes; link rules/assists; include representative code blocks; end every sentence with a period.
When adding headers in a changeset, only use #### or ##### levels.

Files:

  • .changeset/keep-jsxeverywhere-variant.md
**/*.{rs,toml}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Format Rust and TOML files before committing (use just f/just format).

Files:

  • crates/biome_plugin_loader/src/analyzer_js_plugin.rs
  • crates/biome_js_runtime/src/module_loader.rs
  • crates/biome_service/Cargo.toml
  • crates/biome_plugin_loader/src/lib.rs
  • crates/biome_js_runtime/src/lib.rs
  • crates/biome_js_runtime/src/context.rs
  • Cargo.toml
  • crates/biome_js_runtime/src/plugin_api.rs
  • crates/biome_service/src/file_handlers/javascript.rs
  • crates/biome_service/src/workspace/server.tests.rs
  • crates/biome_cli/Cargo.toml
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_js_analyze/src/lint/style/use_exponentiation_operator.rs
  • crates/biome_plugin_loader/src/thread_local.rs
  • crates/biome_plugin_loader/Cargo.toml
  • crates/biome_plugin_loader/src/diagnostics.rs
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_plugin_loader/src/analyzer_js_plugin.rs
  • crates/biome_js_runtime/src/module_loader.rs
  • crates/biome_service/Cargo.toml
  • crates/biome_plugin_loader/src/lib.rs
  • crates/biome_js_runtime/src/lib.rs
  • crates/biome_js_runtime/src/context.rs
  • crates/biome_js_runtime/src/plugin_api.rs
  • crates/biome_service/src/file_handlers/javascript.rs
  • crates/biome_service/src/workspace/server.tests.rs
  • crates/biome_js_analyze/tests/specs/style/useReadonlyClassProperties/valid.ts
  • crates/biome_cli/Cargo.toml
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_js_analyze/src/lint/style/use_exponentiation_operator.rs
  • crates/biome_plugin_loader/src/thread_local.rs
  • crates/biome_plugin_loader/Cargo.toml
  • crates/biome_plugin_loader/src/diagnostics.rs
crates/**/Cargo.toml

📄 CodeRabbit inference engine (CONTRIBUTING.md)

crates/**/Cargo.toml: In internal crates, use workspace = true for internal dependencies.
Use path dependencies for dev-dependencies in internal crates.

Files:

  • crates/biome_service/Cargo.toml
  • crates/biome_cli/Cargo.toml
  • crates/biome_plugin_loader/Cargo.toml
{Cargo.toml,crates/**/Cargo.toml}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Keep the version field consistent across all crates during release.

Files:

  • crates/biome_service/Cargo.toml
  • Cargo.toml
  • crates/biome_cli/Cargo.toml
  • crates/biome_plugin_loader/Cargo.toml
Cargo.toml

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Centralize shared dependencies in the root Cargo.toml using workspace dependencies.

Files:

  • Cargo.toml
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

📄 CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_js_analyze/tests/specs/style/useReadonlyClassProperties/valid.ts
  • crates/biome_js_analyze/src/lint/style/use_exponentiation_operator.rs
**/tests/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place test files under a tests/ directory in each crate

Files:

  • crates/biome_js_analyze/tests/specs/style/useReadonlyClassProperties/valid.ts
crates/biome_service/src/workspace/server.rs

📄 CodeRabbit inference engine (crates/biome_service/CONTRIBUTING.md)

Use WorkspaceServer (src/workspace/server.rs) to maintain workspace state in daemon and CLI daemonless modes

Files:

  • crates/biome_service/src/workspace/server.rs
🧠 Learnings (37)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-17T08:56:30.831Z
Learning: Applies to crates/biome_analyze/crates/biome_js_analyze/lib/src/lint/nursery/*.rs : For new JavaScript lint rules generated by `just new-js-lintrule`, implement the rule in the generated file under `biome_js_analyze/lib/src/lint/nursery/`
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-17T08:56:30.831Z
Learning: Applies to crates/biome_analyze/crates/biome_js_analyze/tests/quick_test.rs : Use `biome_js_analyze/tests/quick_test.rs` for quick, ad-hoc testing; un-ignore the test and adjust the rule filter as needed
📚 Learning: 2025-08-17T08:56:30.831Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-17T08:56:30.831Z
Learning: Applies to crates/biome_analyze/crates/biome_js_analyze/lib/src/lint/nursery/*.rs : For new JavaScript lint rules generated by `just new-js-lintrule`, implement the rule in the generated file under `biome_js_analyze/lib/src/lint/nursery/`

Applied to files:

  • crates/biome_plugin_loader/src/analyzer_js_plugin.rs
  • crates/biome_service/Cargo.toml
  • crates/biome_plugin_loader/src/lib.rs
  • crates/biome_js_runtime/src/plugin_api.rs
  • crates/biome_service/src/file_handlers/javascript.rs
  • crates/biome_cli/Cargo.toml
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
PR: biomejs/biome#7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.

Applied to files:

  • packages/@biomejs/plugin-api/index.js
  • biome.json
  • packages/@biomejs/plugin-api/package.json
📚 Learning: 2025-08-11T11:50:12.090Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:50:12.090Z
Learning: Applies to crates/biome_js_type_info/{src,resolver,biome_module_graph/src}/**/*.rs : Implement and use type resolution via the TypeResolver trait; resolvers own TypeStore vectors and provide fast by-id and hashed lookups

Applied to files:

  • crates/biome_js_runtime/src/module_loader.rs
  • Cargo.toml
  • crates/biome_plugin_loader/Cargo.toml
📚 Learning: 2025-08-11T11:48:52.001Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:52.001Z
Learning: Applies to crates/biome_js_formatter/**/Cargo.toml : Add biome_js_formatter as a path dependency in Cargo.toml: biome_js_formatter = { version = "0.0.1", path = "../biome_js_formatter" }

Applied to files:

  • crates/biome_service/Cargo.toml
  • Cargo.toml
  • crates/biome_service/src/workspace/server.tests.rs
  • crates/biome_cli/Cargo.toml
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_plugin_loader/Cargo.toml
  • crates/biome_plugin_loader/src/diagnostics.rs
📚 Learning: 2025-08-11T11:48:27.774Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.774Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/Cargo.toml : Add the specified dev-dependencies (biome_formatter_test, biome_html_factory, biome_html_parser, biome_parser, biome_service, countme with feature enable, iai 0.1.1, quickcheck, quickcheck_macros, tests_macros) to Cargo.toml under [dev-dependencies]

Applied to files:

  • crates/biome_service/Cargo.toml
  • Cargo.toml
  • crates/biome_cli/Cargo.toml
  • crates/biome_plugin_loader/Cargo.toml
📚 Learning: 2025-08-11T11:46:05.836Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:46:05.836Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Types implementing Diagnostic must also implement Debug (e.g., use #[derive(Debug, Diagnostic)])

Applied to files:

  • crates/biome_plugin_loader/src/lib.rs
  • crates/biome_plugin_loader/src/diagnostics.rs
📚 Learning: 2025-08-17T08:56:30.831Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-17T08:56:30.831Z
Learning: Applies to crates/biome_analyze/crates/biome_js_analyze/tests/quick_test.rs : Use `biome_js_analyze/tests/quick_test.rs` for quick, ad-hoc testing; un-ignore the test and adjust the rule filter as needed

Applied to files:

  • crates/biome_plugin_loader/src/lib.rs
  • crates/biome_service/src/file_handlers/javascript.rs
📚 Learning: 2025-08-11T11:48:27.774Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.774Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_test.rs : Create tests/spec_test.rs implementing the run(spec_input_file, _expected_file, test_directory, _file_type) function as shown and include!("language.rs")

Applied to files:

  • crates/biome_plugin_loader/src/lib.rs
  • crates/biome_service/src/file_handlers/javascript.rs
📚 Learning: 2025-08-11T11:46:05.836Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:46:05.836Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use helper advice types from biome_diagnostics::v2 (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) when suitable

Applied to files:

  • crates/biome_plugin_loader/src/lib.rs
  • crates/biome_plugin_loader/src/diagnostics.rs
📚 Learning: 2025-08-11T11:53:15.299Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:53:15.299Z
Learning: Applies to crates/biome_service/../biome_lsp/src/server.tests.rs : Keep end-to-end LSP tests in biome_lsp’s server.tests.rs

Applied to files:

  • crates/biome_plugin_loader/src/lib.rs
  • Cargo.toml
  • crates/biome_service/src/file_handlers/javascript.rs
  • crates/biome_service/src/workspace/server.tests.rs
  • crates/biome_plugin_loader/Cargo.toml
📚 Learning: 2025-08-11T11:46:05.836Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:46:05.836Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Specify category and severity using #[diagnostic(...)] on the type or derive them from fields

Applied to files:

  • crates/biome_plugin_loader/src/lib.rs
  • crates/biome_plugin_loader/src/diagnostics.rs
📚 Learning: 2025-08-11T11:48:27.774Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.774Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_tests.rs : Create tests/spec_tests.rs in the biome_html_formatter crate that generates tests via tests_macros::gen_tests! for all HTML files at tests/specs/html/**/*.html

Applied to files:

  • crates/biome_plugin_loader/src/lib.rs
  • crates/biome_service/src/file_handlers/javascript.rs
📚 Learning: 2025-08-11T11:46:05.836Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:46:05.836Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : #[derive(Diagnostic)] can be used on enums only if every variant contains a diagnostic type

Applied to files:

  • crates/biome_plugin_loader/src/lib.rs
📚 Learning: 2025-08-17T08:55:30.118Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-17T08:55:30.118Z
Learning: Applies to **/tests/specs/**/*.snap : Use snapshot spec tests stored as .snap files under tests/specs/ (via cargo insta)

Applied to files:

  • crates/biome_plugin_loader/src/lib.rs
📚 Learning: 2025-08-11T11:50:12.090Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:50:12.090Z
Learning: Applies to crates/biome_js_type_info/src/**/*.rs : Represent links between types using TypeReference (not Arc) to avoid cross-module retention and recursive structures; store type data in linear vectors

Applied to files:

  • crates/biome_js_runtime/src/lib.rs
  • Cargo.toml
📚 Learning: 2025-08-11T11:40:38.097Z
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:40:38.097Z
Learning: Applies to crates/**/Cargo.toml : In internal crates, use `workspace = true` for internal dependencies.

Applied to files:

  • Cargo.toml
  • crates/biome_plugin_loader/Cargo.toml
📚 Learning: 2025-08-11T11:40:38.097Z
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:40:38.097Z
Learning: Applies to Cargo.toml : Centralize shared dependencies in the root Cargo.toml using workspace dependencies.

Applied to files:

  • Cargo.toml
  • crates/biome_plugin_loader/Cargo.toml
📚 Learning: 2025-08-17T08:55:30.118Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-17T08:55:30.118Z
Learning: Applies to crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/** : Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Applied to files:

  • Cargo.toml
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_plugin_loader/Cargo.toml
📚 Learning: 2025-08-11T11:48:52.001Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:52.001Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Build an intermediate IR via the provided helper APIs when formatting

Applied to files:

  • Cargo.toml
  • crates/biome_service/src/workspace/server.tests.rs
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_plugin_loader/src/diagnostics.rs
📚 Learning: 2025-08-17T08:57:34.751Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-17T08:57:34.751Z
Learning: Applies to crates/biome_parser/crates/biome_*_factory/** : Create a new crate named biome_<language>_factory under crates/

Applied to files:

  • Cargo.toml
📚 Learning: 2025-08-17T08:57:34.751Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-17T08:57:34.751Z
Learning: Applies to crates/biome_parser/crates/biome_*_syntax/** : Create a new crate named biome_<language>_syntax under crates/

Applied to files:

  • Cargo.toml
📚 Learning: 2025-08-11T11:48:27.774Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.774Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/lib.rs : Place the plumbing traits and impls (AsFormat, IntoFormat, FormattedIterExt, and their Iterator adapters) in the biome_html_formatter crate’s lib.rs

Applied to files:

  • Cargo.toml
  • crates/biome_service/src/workspace/server.tests.rs
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_plugin_loader/src/diagnostics.rs
📚 Learning: 2025-08-11T11:53:15.299Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:53:15.299Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Place watcher tests for workspace methods in src/workspace/watcher.tests.rs

Applied to files:

  • Cargo.toml
  • crates/biome_service/src/file_handlers/javascript.rs
  • crates/biome_service/src/workspace/server.tests.rs
  • crates/biome_plugin_loader/Cargo.toml
📚 Learning: 2025-08-11T11:48:52.001Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:52.001Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to fix code: if a mandatory token/node is missing, return None instead

Applied to files:

  • crates/biome_service/src/file_handlers/javascript.rs
  • crates/biome_service/src/workspace/server.rs
📚 Learning: 2025-08-17T08:55:30.118Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-17T08:55:30.118Z
Learning: Applies to **/tests/** : Place test files under a tests/ directory in each crate

Applied to files:

  • crates/biome_service/src/file_handlers/javascript.rs
📚 Learning: 2025-08-11T11:48:27.774Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.774Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/language.rs : Create tests/language.rs defining HtmlTestFormatLanguage and implement TestFormatLanguage for it

Applied to files:

  • crates/biome_service/src/file_handlers/javascript.rs
📚 Learning: 2025-08-17T08:56:30.831Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-17T08:56:30.831Z
Learning: Applies to crates/biome_analyze/crates/**/tests/specs/**/{invalid*,valid*}.{js,jsx,ts,tsx,css,graphql,jsonc} : Place snapshot test cases under `tests/specs/<group>/<ruleName>/` using files prefixed with `invalid` and `valid`

Applied to files:

  • crates/biome_service/src/workspace/server.tests.rs
📚 Learning: 2025-08-11T11:48:52.001Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:52.001Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import the FormatNode trait and implement it for your Node

Applied to files:

  • crates/biome_service/src/workspace/server.tests.rs
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_plugin_loader/src/diagnostics.rs
📚 Learning: 2025-08-11T11:48:52.001Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:52.001Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Use the generic Format trait and FormatNode for AST nodes when implementing the formatter

Applied to files:

  • crates/biome_service/src/workspace/server.tests.rs
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_plugin_loader/src/diagnostics.rs
📚 Learning: 2025-08-11T11:48:52.001Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:52.001Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Use dbg_write! to debug and inspect the written IR elements during formatter development

Applied to files:

  • crates/biome_service/src/workspace/server.tests.rs
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_plugin_loader/src/diagnostics.rs
📚 Learning: 2025-08-17T08:55:30.118Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-17T08:55:30.118Z
Learning: Applies to crates/biome_html_formatter/benches/html_formatter.rs : Maintain the HTML formatter benchmark at benches/html_formatter.rs within the biome_html_formatter crate

Applied to files:

  • crates/biome_service/src/workspace/server.tests.rs
📚 Learning: 2025-08-11T11:48:52.001Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:52.001Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For non-mandatory tokens, use the formatter helper functions (e.g., token, space_token) instead of hardcoding

Applied to files:

  • crates/biome_service/src/workspace/server.tests.rs
📚 Learning: 2025-08-11T11:53:15.299Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:53:15.299Z
Learning: For debugging: run commands against the daemon (e.g., `cargo run --bin=biome -- lint --use-server <path>`)

Applied to files:

  • .github/workflows/preview.yml
📚 Learning: 2025-08-11T11:48:27.774Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.774Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/lib.rs : Expose a documented public function format_node(options: HtmlFormatOptions, root: &HtmlSyntaxNode) -> FormatResult<Formatted<HtmlFormatContext>> delegating to biome_formatter::format_node

Applied to files:

  • crates/biome_service/src/workspace/server.rs
📚 Learning: 2025-08-11T11:53:15.299Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:53:15.299Z
Learning: Applies to crates/biome_service/src/workspace.rs : Implement the Workspace trait in src/workspace.rs

Applied to files:

  • crates/biome_plugin_loader/Cargo.toml
📚 Learning: 2025-08-17T08:56:30.831Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-17T08:56:30.831Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Define per-rule options in the `biome_rule_options` crate under `lib/`, with serde- and schemars-compatible derives and `#[serde(rename_all = "camelCase", deny_unknown_fields, default)]`

Applied to files:

  • crates/biome_plugin_loader/Cargo.toml
🧬 Code graph analysis (9)
crates/biome_plugin_loader/src/analyzer_js_plugin.rs (5)
crates/biome_plugin_loader/src/lib.rs (2)
  • load_plugin (141-157)
  • load (40-118)
crates/biome_js_runtime/src/context.rs (1)
  • new (25-38)
crates/biome_js_runtime/src/module_loader.rs (1)
  • new (18-24)
crates/biome_js_runtime/src/plugin_api.rs (2)
  • new (17-21)
  • None (51-51)
crates/biome_plugin_loader/src/thread_local.rs (3)
  • new (15-24)
  • new (57-71)
  • new (106-110)
crates/biome_js_runtime/src/module_loader.rs (2)
crates/biome_js_runtime/src/context.rs (1)
  • new (25-38)
crates/biome_js_runtime/src/plugin_api.rs (1)
  • new (17-21)
crates/biome_plugin_loader/src/lib.rs (6)
crates/biome_service/src/workspace/server.rs (3)
  • fs (1606-1608)
  • fs (1688-1690)
  • new (119-141)
crates/biome_service/src/workspace/client.rs (1)
  • fs (236-238)
crates/biome_plugin_loader/src/analyzer_js_plugin.rs (1)
  • load (59-71)
crates/biome_js_runtime/src/context.rs (1)
  • new (25-38)
crates/biome_js_runtime/src/module_loader.rs (1)
  • new (18-24)
crates/biome_plugin_loader/src/thread_local.rs (3)
  • new (15-24)
  • new (57-71)
  • new (106-110)
crates/biome_js_runtime/src/context.rs (2)
crates/biome_js_runtime/src/module_loader.rs (1)
  • new (18-24)
crates/biome_js_runtime/src/plugin_api.rs (2)
  • new (17-21)
  • pull_diagnostics (82-84)
crates/biome_js_runtime/src/plugin_api.rs (4)
packages/@biomejs/plugin-api/index.d.ts (1)
  • Severity (1-1)
crates/biome_js_runtime/src/context.rs (2)
  • new (25-38)
  • pull_diagnostics (41-43)
crates/biome_service/src/workspace/server.rs (3)
  • new (119-141)
  • diagnostics (1232-1235)
  • pull_diagnostics (1268-1352)
crates/biome_plugin_loader/src/analyzer_grit_plugin.rs (1)
  • register_diagnostic (104-156)
crates/biome_service/src/file_handlers/javascript.rs (2)
crates/biome_service/src/file_handlers/svelte.rs (1)
  • file_source (66-79)
crates/biome_service/src/file_handlers/vue.rs (1)
  • file_source (66-79)
crates/biome_service/src/workspace/server.tests.rs (4)
crates/biome_service/src/test_utils.rs (1)
  • setup_workspace_and_open_project (14-21)
crates/biome_service/src/file_handlers/javascript.rs (1)
  • parse (501-529)
crates/biome_js_parser/src/parse.rs (3)
  • parse (173-178)
  • parse (219-220)
  • parse (247-250)
crates/biome_formatter/src/lib.rs (1)
  • as_code (998-1000)
crates/biome_service/src/workspace/server.rs (2)
crates/biome_plugin_loader/src/analyzer_js_plugin.rs (1)
  • load (59-71)
crates/biome_plugin_loader/src/lib.rs (1)
  • load (40-118)
crates/biome_plugin_loader/src/diagnostics.rs (1)
crates/biome_service/src/diagnostics.rs (11)
  • fmt (172-174)
  • fmt (178-180)
  • fmt (538-540)
  • message (357-364)
  • message (403-419)
  • message (499-501)
  • message (563-572)
  • message (642-650)
  • description (421-440)
  • description (503-505)
  • description (552-561)
🔇 Additional comments (33)
crates/biome_js_analyze/tests/specs/style/useReadonlyClassProperties/valid.ts (1)

668-675: Good addition: covers nested post-increment inside an assignment

This nicely exercises the “assignment-within-assignment” edge case the rule used to mishandle.

.github/workflows/main.yml (1)

95-95: CI now forces js_plugin feature — verify workspace feature wiring.

Please confirm every impacted crate is compatible when running cargo test --workspace --features=js_plugin (virtual workspace nuances can bite). If some crates don’t gate this feature, scope tests with -p or feature-per-package flags.

crates/biome_service/Cargo.toml (1)

83-83: Feature passthrough looks good.

js_plugin = ["biome_plugin_loader/js_plugin"] is a clean wire-up.

.github/workflows/release_js_api.yml (1)

24-24: Pin bump to EndBug/version-check v2.1.7 looks good.

Nice tidy upgrade; keeps the workflow pinned and reproducible.

.github/workflows/beta.yml (1)

73-73: Upgrade taiki-e/install-action to v2.58.21: all good.

Consistent with other workflows; no behavioural changes expected.

.github/workflows/release.yml (1)

131-131: cargo-audit installer bump to v2.58.21 approved.

Keeps the pin fresh and consistent across pipelines.

crates/biome_cli/Cargo.toml (1)

92-93: Feature wiring for js_plugin is correct.

Maps cleanly to biome_service/js_plugin and stays opt-in. Please ensure you’ve run the workspace formatter for TOML as per contributor guide.

.changeset/keep-jsxeverywhere-variant.md (1)

1-7: Changeset reads well and matches style conventions.

Links the issue, uses past tense, and ends sentences with periods. Ship it.

.github/workflows/preview.yml (3)

65-65: Action pin bump looks good

Pinned taiki-e/install-action to v2.58.21; sensible, reproducible builds.


76-76: js_plugin feature added to CLI build – verify cross-target viability

Enabling --features=js_plugin for all targets is fine, but please confirm it builds cleanly for both musl and Darwin/Windows targets in this matrix (Boa/libc/windows dependencies can be finicky on static/musl). If issues surface, consider conditional feature gating per target.


132-132: GNU build parity with js_plugin

Same note as above; good to keep feature parity between MUSL and GNU builds, but double-check linkability in the Debian bullseye container.

.github/workflows/release_cli.yml (2)

24-24: Version-check action bump approved

Update to EndBug/version-check@v2.1.7 is fine.


90-90: Action pin bump looks good

Pinned taiki-e/install-action to v2.58.21; approved.

packages/@biomejs/plugin-api/package.json (1)

30-36: Private package is fine; ensure release workflow excludes it

Given "private": true, keep it out of publish loops (see workflow comment). No action here if you adopt that change.

crates/biome_plugin_loader/src/diagnostics.rs (3)

1-4: Imports and MessageAndDescription adoption look good

Migration to MessageAndDescription aligns with diagnostics elsewhere. Please run repo formatters before merge.


46-51: Grit compile error mapping – good

Static message plus original error as source is the right balance.


192-207: Public message fields for user-facing diagnostics – good

Exposing message on UnsupportedRuleFormat and NotLoaded keeps construction flexible for callers.

crates/biome_js_runtime/src/module_loader.rs (1)

27-34: Confirm single-threaded access to the loader.

RefCell-backed caches assume Boa will call the loader on one thread. If that assumption changes, switch to parking_lot::RwLock or similar.

plugins/plugin.js (1)

4-8: LGTM.

Simple demo plugin; condition and diagnostic wiring are fine.

crates/biome_js_runtime/src/lib.rs (1)

5-6: Public re-exports look good.

Surface matches the new modules; no concerns.

Cargo.toml (1)

139-139: Compile-cost gating looks good. All uses of boa_engine, libc and windows are behind the js_plugin feature or platform-specific cfg blocks in crates/biome_plugin_loader, and biome_js_runtime itself is only pulled in via that feature. Root workspace entries just centralise versions.

crates/biome_plugin_loader/src/lib.rs (2)

8-15: Feature-gated JS plugin module — good separation

Gating AnalyzerJsPlugin behind js_plugin is the right call.


215-229: JS single‑file plugin test behind feature — nice coverage

Solid smoke test for the feature-gated path.

crates/biome_service/src/workspace/server.tests.rs (2)

115-231: JSX‑everywhere happy‑path test looks good

Asserts variants and formatting; reads well. Once Bool is imported, this should pass.


232-342: JSX‑everywhere disabled test is spot‑on

Covers both JS and JSX files with expected diagnostics/formatting. 👍

crates/biome_plugin_loader/src/analyzer_js_plugin.rs (2)

27-39: Fail‑fast preload is a good UX

Preloading in the main thread surfaces load errors early; the entrypoint type check is clear.


144-197: Concurrent evaluation test — great

Validates per‑thread initialisation and diagnostic collection.

crates/biome_plugin_loader/Cargo.toml (2)

1-11: PR scope mismatch with stated objective (CSS navigation).

The changes in this file (and the rest of the diff) relate to JS plugin/runtime wiring, not the CSS property list. Please confirm the PR includes the CSS fix (KNOWN_PROPERTIES + test) before merging.


34-41: Feature-gated JS plugin deps look sane; double-check cross-platform feature activation.

Enabling js_plugin pulls optional, target-specific deps (windows, libc). This usually works, but please verify cargo check -F js_plugin on Linux/macOS and Windows to avoid feature resolution surprises.

Also applies to: 50-52

crates/biome_service/src/workspace/server.rs (2)

20-20: LGTM: imports expanded for JSX/ModuleKind support.


507-507: Arc-based FS passed to plugin loader — good alignment with new API.

crates/biome_js_runtime/src/plugin_api.rs (1)

82-84: Pull-drain logic is neat and efficient.

crates/biome_js_runtime/src/context.rs (1)

32-37: Builtin module registration for @biomejs/plugin-api — looks correct.

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: cargo test --workspace
run: cargo test --workspace --features=js_plugin
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

PR tests also force js_plugin — double-check feature presence.

Same note as main CI: ensure js_plugin is defined (or transitively activated) across all relevant crates, or narrow with -p to crates that need it.


🏁 Script executed:

#!/bin/bash
# Quick scan for js_plugin feature definitions and uses
rg -nP '^\s*\[features\]|\bjs_plugin\b' -g '*.toml' -C2

Length of output: 12332


🏁 Script executed:

#!/bin/bash
# Check for js_plugin feature definition in workspace root
rg -nP '^\[features\]' -C5 Cargo.toml || true

Length of output: 46


Narrow JS plugin feature in PR tests
CI currently runs cargo test --workspace --features=js_plugin, but only biome_service, biome_plugin_loader and biome_cli define that feature—other crates will error. Either scope the invocation with -p flags to those crates or add a workspace-level alias for js_plugin.

🤖 Prompt for AI Agents
.github/workflows/pull_request.yml around line 88: the workflow runs cargo test
--workspace --features=js_plugin which fails because only biome_service,
biome_plugin_loader and biome_cli define that feature; update the step to either
scope the test to those crates by adding -p flags (e.g. cargo test -p
biome_service -p biome_plugin_loader -p biome_cli --features=js_plugin) or
create a workspace-level cargo alias (in .cargo/config.toml under [alias]) that
includes the appropriate packages and features and call that alias from the
workflow.

Comment on lines +677 to +687
class TesAssignmentInNestedCallback {
private thing: any;

public doStuff(): void {
ui.showText("example", {
callback: () => {
this.thing = x;
},
});
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Fix typo in class name

Looks like a missing “t” in “TestAssignment…”. Rename for clarity and searchability.

-class TesAssignmentInNestedCallback {
+class TestAssignmentInNestedCallback {

Run to ensure no other references need updating:


🏁 Script executed:

#!/bin/bash
rg -nP 'TesAssignmentInNestedCallback|TestAssignmentInNestedCallback' -C2

Length of output: 1049


Update class name typo and snapshot
Rename TesAssignmentInNestedCallback to TestAssignmentInNestedCallback in both

  • crates/biome_js_analyze/tests/specs/style/useReadonlyClassProperties/valid.ts
  • crates/biome_js_analyze/tests/specs/style/useReadonlyClassProperties/valid.ts.snap
🤖 Prompt for AI Agents
In crates/biome_js_analyze/tests/specs/style/useReadonlyClassProperties/valid.ts
around lines 677 to 687, the class is misspelled as
TesAssignmentInNestedCallback; rename the class to
TestAssignmentInNestedCallback in this file and update the corresponding
snapshot file
crates/biome_js_analyze/tests/specs/style/useReadonlyClassProperties/valid.ts.snap
to match the new class name so the test and snapshot remain consistent.

Comment on lines +45 to +53
pub fn import_module(&mut self, path: impl AsRef<Utf8Path>) -> JsResult<Module> {
let ctx = &mut self.ctx;
let path = path.as_ref();
let source = self.fs.read_file_from_path(path).map_err(|err| {
JsNativeError::error().with_message(format!("Failed to read {path}: {err}"))
})?;
let source = Source::from_bytes(source.as_bytes()).with_path(path.as_std_path());
let module = Module::parse(source, None, ctx)?;

Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add a settling guard to avoid infinite loops on never-resolving promises.

A misbehaving plugin could hang import_module. Add a max job ticks/timeout and surface a clear error.

Apply:

-        loop {
+        let mut ticks = 0usize;
+        const MAX_TICKS: usize = 10_000; // tweak as needed
+        loop {
             match promise_result.state() {
                 PromiseState::Pending => {
                     // Drive the job queue until the promise settles.
                     ctx.run_jobs();
+                    ticks += 1;
+                    if ticks >= MAX_TICKS {
+                        break Err(JsNativeError::error()
+                            .with_message(format!("Module load timed out while importing {}", path))
+                            .into());
+                    }
                 }

Also applies to: 82-98

🤖 Prompt for AI Agents
In crates/biome_js_runtime/src/context.rs around lines 45-53 (and similarly at
82-98), import_module can hang if JS promises never resolve; add a settling
guard by limiting the number of event-loop/job ticks or a wall-clock timeout
while waiting for JS jobs to settle and surface a clear JsNativeError when the
limit is exceeded. Concretely: after invoking Module::parse/any async evaluation
that may schedule jobs, run the runtime job loop in a bounded loop (e.g., for
tick in 0..MAX_TICKS { run_jobs_once(ctx); if no_pending_jobs { break } } ) or
use a timeout mechanism, and if the loop finishes because the max ticks/time was
reached return Err(JsNativeError::error().with_message("Timed out waiting for JS
promises to settle")) instead of blocking forever; apply the same pattern to the
other block at lines 82-98.

Comment on lines +11 to +15
pub struct JsModuleLoader {
fs: Arc<dyn FsWithResolverProxy>,
builtins: RefCell<FxHashMap<JsString, Module>>,
modules: RefCell<FxHashMap<Utf8PathBuf, Module>>,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Prefer owned String for builtin keys (avoid GC-managed JsString in long‑lived maps).

Using JsString as the HashMap key ties the cache to engine internals. Storing owned String avoids lifetime/GC surprises and makes lookups uniform with later string conversions.

 pub struct JsModuleLoader {
     fs: Arc<dyn FsWithResolverProxy>,
-    builtins: RefCell<FxHashMap<JsString, Module>>,
+    builtins: RefCell<FxHashMap<String, Module>>,
     modules: RefCell<FxHashMap<Utf8PathBuf, Module>>,
 }
🤖 Prompt for AI Agents
In crates/biome_js_runtime/src/module_loader.rs around lines 11 to 15, the
builtins map currently uses JsString as its key which couples the cache to the
JS engine; change the key type to owned String (e.g. RefCell<FxHashMap<String,
Module>>) and update all insertions and lookups to convert JsString -> String
(via to_string or similar) before using as a key, adjust any function signatures
or return types that assumed JsString keys, and add or update imports if
necessary so the map stores plain owned Strings to avoid GC/lifetime issues.

Comment on lines +35 to +41
if let Some(module) = self.builtins.borrow().get(&specifier) {
finish_load(Ok(module.clone()), context);
return;
}

let specifier = specifier.to_std_string_lossy();

Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Unify builtin lookup on an owned string.

Convert once, then hit the cache using the same representation used for resolution.

-        if let Some(module) = self.builtins.borrow().get(&specifier) {
+        let specifier_str = specifier.to_std_string_lossy();
+        if let Some(module) = self.builtins.borrow().get(&specifier_str) {
             finish_load(Ok(module.clone()), context);
             return;
         }
-
-        let specifier = specifier.to_std_string_lossy();
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if let Some(module) = self.builtins.borrow().get(&specifier) {
finish_load(Ok(module.clone()), context);
return;
}
let specifier = specifier.to_std_string_lossy();
let specifier_str = specifier.to_std_string_lossy();
if let Some(module) = self.builtins.borrow().get(&specifier_str) {
finish_load(Ok(module.clone()), context);
return;
}
🤖 Prompt for AI Agents
In crates/biome_js_runtime/src/module_loader.rs around lines 35 to 41, the code
converts the specifier to a std string after checking the builtins cache,
causing two different representations; change it to convert specifier to an
owned String once (let specifier = specifier.to_std_string_lossy()) before the
builtin lookup and then use that owned String (or &specifier) for both the
builtins.borrow().get(...) lookup and subsequent resolution so the cache is hit
with the same representation and redundant conversions are removed.

Comment on lines +56 to +71
impl<T> Key<T> {
pub(super) unsafe fn new() -> Self {
let inner = unsafe {
let mut inner = MaybeUninit::uninit();
let result = libc::pthread_key_create(inner.as_mut_ptr(), None);

assert_eq!(result, 0);

inner.assume_init()
};

Self {
inner,
_phantom: PhantomData,
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Unix: wire up a destructor with pthread_key_create.

Mirror the Windows fix to avoid leaks.

     impl<T> Key<T> {
+        unsafe extern "C" fn dtor(value: *mut c_void) {
+            if !value.is_null() {
+                drop(Box::from_raw(value as *mut std::cell::RefCell<T>));
+            }
+        }
         pub(super) unsafe fn new() -> Self {
             let inner = unsafe {
                 let mut inner = MaybeUninit::uninit();
-                let result = libc::pthread_key_create(inner.as_mut_ptr(), None);
+                let result = libc::pthread_key_create(inner.as_mut_ptr(), Some(Self::dtor));
 
                 assert_eq!(result, 0);
 
                 inner.assume_init()
             };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
impl<T> Key<T> {
pub(super) unsafe fn new() -> Self {
let inner = unsafe {
let mut inner = MaybeUninit::uninit();
let result = libc::pthread_key_create(inner.as_mut_ptr(), None);
assert_eq!(result, 0);
inner.assume_init()
};
Self {
inner,
_phantom: PhantomData,
}
}
impl<T> Key<T> {
// On Unix, provide a destructor so that thread‐local
// RefCell<T> boxes are dropped when the thread exits.
unsafe extern "C" fn dtor(value: *mut c_void) {
if !value.is_null() {
drop(Box::from_raw(value as *mut std::cell::RefCell<T>));
}
}
pub(super) unsafe fn new() -> Self {
let inner = unsafe {
let mut inner = MaybeUninit::uninit();
let result = libc::pthread_key_create(
inner.as_mut_ptr(),
Some(Self::dtor),
);
assert_eq!(result, 0);
inner.assume_init()
};
Self {
inner,
_phantom: PhantomData,
}
}
}

Comment on lines +139 to +144
fn set(&self, value: T) {
let cell = Box::into_raw(Box::new(RefCell::new(value)));
unsafe {
self.key.set(cell);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid leaking on re-initialisation in the same thread.

Drop the old pointer before storing a new one.

     fn set(&self, value: T) {
         let cell = Box::into_raw(Box::new(RefCell::new(value)));
         unsafe {
-            self.key.set(cell);
+            let old = self.key.get();
+            if !old.is_null() {
+                drop(Box::from_raw(old));
+            }
+            self.key.set(cell);
         }
     }
🤖 Prompt for AI Agents
In crates/biome_plugin_loader/src/thread_local.rs around lines 139 to 144, the
set method currently overwrites the raw pointer in self.key without freeing any
previously stored Box, leaking memory on re-initialisation; modify set to first
read the existing pointer (using self.key.get()), and if it is not null convert
it back into a Box (Box::from_raw) to drop it safely, then create the new
Box::into_raw and store that in self.key within the unsafe block so the old
allocation is freed before replacing the pointer.

Comment on lines +523 to 525
let file_source = file_source.to_js_file_source().unwrap_or_default();
let parse = biome_js_parser::parse_js_with_cache(text, file_source, options, cache);
ParseResult {
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Restore path-based fallback for JsFileSource (parity with formatter/linter)

If DocumentFileSource can’t yield a JS source, we should fall back to path inference like other paths in this file do. Avoids mis-parsing edge cases.

Apply:

-    let file_source = file_source.to_js_file_source().unwrap_or_default();
+    let file_source = file_source
+        .to_js_file_source()
+        .or(JsFileSource::try_from(biome_path.as_path()).ok())
+        .unwrap_or_default();
🤖 Prompt for AI Agents
In crates/biome_service/src/file_handlers/javascript.rs around lines 523 to 525,
replace the current unconditional unwrap_or_default on
file_source.to_js_file_source() with the same path-based fallback used elsewhere
in this file (formatter/linter) so that when DocumentFileSource cannot produce a
JsFileSource you infer it from the file path; specifically, attempt to convert
to JsFileSource, and if that yields None use the existing path-inference helper
(the logic used by the formatter/linter) to construct the JsFileSource from the
file path before passing it into biome_js_parser::parse_js_with_cache so parsing
behavior matches other tools.

Comment on lines +308 to +323
if !js.is_typescript() && !js.is_jsx() {
let settings = self
.projects
.get_settings_based_on_path(project_key, &biome_path)
.ok_or_else(WorkspaceError::no_project)?;
let jsx_everywhere = settings
.languages
.javascript
.parser
.jsx_everywhere
.unwrap_or_default()
.into();
if jsx_everywhere {
js.set_variant(LanguageVariant::Jsx);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Likely type mismatch: pass &path (Utf8Path) instead of &biome_path (BiomePath).

Other call sites pass &Utf8Path. This may not compile if get_settings_based_on_path expects &Utf8Path.

Apply:

-                let settings = self
-                    .projects
-                    .get_settings_based_on_path(project_key, &biome_path)
+                let settings = self
+                    .projects
+                    .get_settings_based_on_path(project_key, &path)
                     .ok_or_else(WorkspaceError::no_project)?;

To confirm the expected type, run:


🏁 Script executed:

#!/bin/bash
# Inspect Projects::get_settings_based_on_path signature and call sites
rg -nP 'fn\s+get_settings_based_on_path\s*\(' -C3
rg -nP --type=rust -C2 '\.get_settings_based_on_path\s*\('

Length of output: 5188


🏁 Script executed:

#!/bin/bash
sed -n '260,330p' crates/biome_service/src/workspace/server.rs

Length of output: 2643


🏁 Script executed:

#!/bin/bash
rg -nP 'struct\s+BiomePath' -C3 crates/biome_service/src
rg -nP 'impl\s+BiomePath' -C3 crates/biome_service/src

Length of output: 115


🏁 Script executed:

#!/bin/bash
rg -nP 'struct\s+OpenFileParams' -C3 crates/biome_service/src
rg -nP 'enum\s+OpenFileParams' -C3 crates/biome_service/src
rg -nP 'OpenFileParams\s*{' -C3 crates/biome_service/src

Length of output: 23375


🏁 Script executed:

#!/bin/bash
sed -n '1,200p' crates/biome_service/src/lib.rs

Length of output: 2363


Pass &path (Utf8Path) to get_settings_based_on_path
The method signature is fn get_settings_based_on_path(&self,…, file_path: &Utf8Path) (projects.rs:84), so &biome_path (a BiomePath) won’t match—use &path instead.

🤖 Prompt for AI Agents
In crates/biome_service/src/workspace/server.rs around lines 308 to 323, the
call to get_settings_based_on_path currently passes &biome_path (a BiomePath)
but the function expects a &Utf8Path; change the argument to &path (the Utf8Path
in scope) so the types match and the correct file path is used; no other logic
changes needed.

Comment on lines +1 to +5
use biome_configuration::{
FormatterConfiguration, JsConfiguration,
javascript::{JsFormatterConfiguration, JsParserConfiguration},
};
use biome_formatter::{IndentStyle, LineWidth};
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Missing import for Bool breaks compilation

Bool(true/false) is used below but not in scope.

-use biome_configuration::{
-    FormatterConfiguration, JsConfiguration,
-    javascript::{JsFormatterConfiguration, JsParserConfiguration},
-};
+use biome_configuration::{
+    Bool, FormatterConfiguration, JsConfiguration,
+    javascript::{JsFormatterConfiguration, JsParserConfiguration},
+};
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
use biome_configuration::{
FormatterConfiguration, JsConfiguration,
javascript::{JsFormatterConfiguration, JsParserConfiguration},
};
use biome_formatter::{IndentStyle, LineWidth};
use biome_configuration::{
Bool, FormatterConfiguration, JsConfiguration,
javascript::{JsFormatterConfiguration, JsParserConfiguration},
};
use biome_formatter::{IndentStyle, LineWidth};
🤖 Prompt for AI Agents
In crates/biome_service/src/workspace/server.tests.rs around lines 1 to 5, the
test code later constructs Bool(true/false) but there is no use/import for Bool,
causing a compile error; locate the module that defines Bool in the codebase
(e.g. the AST or syntax crate used for JS nodes) and add a use statement at the
top of this file to bring Bool into scope (for example add a line like `use
<crate>::<module>::Bool;` with the correct crate/module path you find).

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

Labels

A-CLI Area: CLI A-Linter Area: linter A-Project Area: project L-CSS Language: CSS L-JavaScript Language: JavaScript and super languages L-JSON Language: JSON and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💅 False positive: lint/correctness/noUnknownProperty with navigation: auto

1 participant

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载