Skip to content

Conversation

@Netail
Copy link
Member

@Netail Netail commented Dec 29, 2025

Summary

Port Eslint Graphql's lone-executable-definition

Test Plan

Docs

@changeset-bot
Copy link

changeset-bot bot commented Dec 29, 2025

🦋 Changeset detected

Latest commit: 52b49ec

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

@Netail Netail changed the title feat(graphql_analyze): implement useLoneAnonymousOperation feat(graphql_analyze): implement useLoneExecutableDefinition Dec 29, 2025
@github-actions github-actions bot added A-Project Area: project A-Linter Area: linter A-Diagnostic Area: diagnostocis labels Dec 29, 2025
@Netail Netail force-pushed the feat/use-lone-executable-definition branch from 4966d0d to 7333327 Compare December 29, 2025 15:51
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 29, 2025

CodSpeed Performance Report

Merging #8617 will not alter performance

Comparing Netail:feat/use-lone-executable-definition (7333327) with main (cc3e851)

Summary

✅ 1 untouched
⏩ 154 skipped1

Footnotes

  1. 154 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.

@Netail Netail force-pushed the feat/use-lone-executable-definition branch from 7333327 to de4a247 Compare December 29, 2025 18:30
@Netail Netail marked this pull request as ready for review December 29, 2025 18:31
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 29, 2025

Walkthrough

Adds a new GraphQL nursery lint rule useLoneExecutableDefinition that requires queries, mutations, subscriptions or fragments to be in separate files. Implements the rule in the analyzer, exposes UseLoneExecutableDefinitionOptions, exports the module, and adds a comprehensive test suite with valid and invalid fixtures covering multiple and single executable-definition cases.

Suggested reviewers

  • Conaclos
  • dyc3
  • ematipico

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: implementing the useLoneExecutableDefinition GraphQL lint rule.
Description check ✅ Passed The description is related to the changeset, identifying this as a port of ESLint GraphQL's lone-executable-definition rule, though it lacks specific test details.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0a2abf1 and 52b49ec.

⛔ Files ignored due to path filters (16)
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_graphql_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-named-query.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/fragment.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-mutation.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-query.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-subscription.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-mutation.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-query.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-subscription.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-shorthand-query.graphql.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (16)
  • .changeset/lazy-doodles-attack.md
  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-named-query.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/fragment.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-mutation.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-query.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-subscription.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-mutation.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-query.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-subscription.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-shorthand-query.graphql
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
  • justfile
🚧 Files skipped from review as they are similar to previous changes (10)
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/fragment.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-named-query.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-shorthand-query.graphql
  • .changeset/lazy-doodles-attack.md
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-query.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-mutation.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-subscription.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-mutation.graphql
  • justfile
  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Use inline rustdoc documentation for rules, assists, and their options
Use the dbg!() macro for debugging output in Rust tests and code
Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in tests

Files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
🧠 Learnings (22)
📓 Common learnings
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Add `issue_number` field to `declare_lint_rule!` macro for work-in-progress rules
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Run `just l` to lint analyzer rule code
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*valid* : Create test files prefixed with `valid` for code that should not trigger the rule

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-subscription.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-query.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphql
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Wrap rule options fields in `Option<>` to properly track set and unset options during merge

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options must be placed inside the `biome_rule_options` crate

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/local_inference.rs : Implement local inference in dedicated modules to derive type definitions from expressions without context of surrounding scopes

Applied to files:

  • crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Implement `Merge` trait for rule options to support configuration inheritance

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `deny_unknown_fields` in serde derive macro for rule options

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `rename_all = "camelCase"` in serde derive macro for rule options

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `options` code block property for rule-specific configuration snippets in documentation

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `Box<[T]>` instead of `Vec<T>` for rule options arrays to save memory

Applied to files:

  • crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `language` field in `declare_lint_rule!` macro to the language the rule primarily applies to

Applied to files:

  • crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation must include `## Options` section if the rule has options

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*invalid* : Create test files prefixed with `invalid` for code that should trigger the rule

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql
📚 Learning: 2025-12-04T13:29:49.287Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8291
File: crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/elastic-header.html:10-10
Timestamp: 2025-12-04T13:29:49.287Z
Learning: Files under `crates/biome_html_formatter/tests/specs/prettier` are test fixtures synced from Prettier and should not receive detailed code quality reviews (e.g., HTTP vs HTTPS, formatting suggestions, etc.). These files are test data meant to validate formatter behavior and should be preserved as-is.

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphql
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Each invalid code example in rule documentation must emit exactly one diagnostic

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use #[derive(Diagnostic)] on enums when every variant contains a type that is itself a diagnostic

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphql
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options struct must derive `Deserializable`, `Serialize`, `Deserialize`, and optionally `JsonSchema`

Applied to files:

  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `use_options` code block property for code examples that follow an options configuration in documentation

Applied to files:

  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `full_options` code block property for complete biome.json configuration snippets in documentation

Applied to files:

  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Invalid code examples in rule documentation must be marked with `expect_diagnostic` code block property

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `declare_node_union!` macro to query multiple node types at once

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation must include `## Examples` section with `### Invalid` and `### Valid` subsections

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql
🔇 Additional comments (6)
crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-subscription.graphql (1)

1-4: LGTM!

Valid test case correctly demonstrates a single named subscription that should not trigger diagnostics.

crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-query.graphql (1)

1-4: LGTM!

Valid test case correctly demonstrates a single anonymous query that should not trigger diagnostics.

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

342-342: LGTM!

Module registration is correctly placed in alphabetical order and follows the established pattern.

crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphql (1)

1-7: LGTM!

Invalid test case correctly demonstrates multiple executable definitions (shorthand query + fragment) that should trigger diagnostics.

crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql (1)

1-26: LGTM!

Comprehensive invalid test case covering multiple executable definition types (queries, mutations, subscriptions, fragments). Excellent coverage for verifying the rule correctly identifies all forms of executable definitions.

crates/biome_rule_options/src/use_lone_executable_definition.rs (1)

1-6: LGTM!

Options struct correctly implements all required traits and follows coding guidelines. The empty struct serves as a proper placeholder for future configuration options if needed.


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

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: 4

🧹 Nitpick comments (2)
.changeset/lazy-doodles-attack.md (1)

5-17: Consider adding a valid example to the changeset.

The changeset shows what's now invalid, but adding a brief valid example (e.g., "each definition in its own file") would clarify the expected behaviour for users.

Based on learnings, changesets should demonstrate both invalid and valid patterns.

crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs (1)

86-92: Consider simplifying diagnostic message.

The message "Document contains (multiple) definitions." could be clearer as "This document contains multiple definitions."

🔎 Suggested simplification
     let mut diagnostic = RuleDiagnostic::new(
         rule_category!(),
         span,
         markup! {
-            "Document contains (multiple) definitions."
+            "This document contains multiple definitions."
         },
     );
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7c85bf0 and de4a247.

⛔ Files ignored due to path filters (15)
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_graphql_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/fragment.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-mutation.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-query.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-subscription.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-mutation 3.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-query.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-subscription.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-shorthand-query.graphql.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (16)
  • .changeset/lazy-doodles-attack.md
  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-named-query.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/fragment.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-mutation.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-query.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-subscription.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-mutation 3.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-query.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-subscription.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-shorthand-query.graphql
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
  • justfile
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Use inline rustdoc documentation for rules, assists, and their options
Use the dbg!() macro for debugging output in Rust tests and code
Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in tests

Files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
🧠 Learnings (42)
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options must be placed inside the `biome_rule_options` crate

Applied to files:

  • crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Wrap rule options fields in `Option<>` to properly track set and unset options during merge

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `deny_unknown_fields` in serde derive macro for rule options

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/local_inference.rs : Implement local inference in dedicated modules to derive type definitions from expressions without context of surrounding scopes

Applied to files:

  • crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Implement `Merge` trait for rule options to support configuration inheritance

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `rename_all = "camelCase"` in serde derive macro for rule options

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `options` code block property for rule-specific configuration snippets in documentation

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `Box<[T]>` instead of `Vec<T>` for rule options arrays to save memory

Applied to files:

  • crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation must include `## Options` section if the rule has options

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `language` field in `declare_lint_rule!` macro to the language the rule primarily applies to

Applied to files:

  • crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*valid* : Create test files prefixed with `valid` for code that should not trigger the rule

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-query.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-subscription.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-mutation 3.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/fragment.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-query.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-shorthand-query.graphql
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `declare_node_union!` macro to query multiple node types at once

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-named-query.graphql
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*invalid* : Create test files prefixed with `invalid` for code that should trigger the rule

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-named-query.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-mutation 3.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Each invalid code example in rule documentation must emit exactly one diagnostic

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-named-query.graphql
  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-shorthand-query.graphql
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Implement Queryable trait for custom query match types in analyzer rules

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-named-query.graphql
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/spec_tests.rs : Use the `tests_macros::gen_tests!` macro in `spec_tests.rs` to generate test functions for each specification file matching the pattern `tests/specs/<language>/**/*.<ext>`

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-named-query.graphql
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options struct must derive `Deserializable`, `Serialize`, `Deserialize`, and optionally `JsonSchema`

Applied to files:

  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `use_options` code block property for code examples that follow an options configuration in documentation

Applied to files:

  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `full_options` code block property for complete biome.json configuration snippets in documentation

Applied to files:

  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-11-21T01:10:53.059Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.

Applied to files:

  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `declare_lint_rule!` macro to declare analyzer rule types and implement the RuleMeta trait

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should perform static analysis of source code to detect invalid or error-prone patterns and emit diagnostics with proposed fixes

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-22T09:26:56.943Z
Learnt from: ematipico
Repo: biomejs/biome PR: 8537
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:167-210
Timestamp: 2025-12-22T09:26:56.943Z
Learning: When defining lint rules (declare_lint_rule!), only specify fix_kind if the rule implements an action(...) function. Rules that only emit diagnostics without a code fix should omit fix_kind. This applies to all Rust lint rule definitions under crates/.../src/lint (e.g., crates/biome_js_analyze/src/lint/...).

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : The first paragraph of rule documentation must be a single line describing what the rule does

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Add `issue_number` field to `declare_lint_rule!` macro for work-in-progress rules

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
  • .changeset/lazy-doodles-attack.md
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should check syntax according to language specification and emit error diagnostics

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `version` field to `next` in `declare_lint_rule!` macro

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation code blocks should be ordered as language, expect_diagnostic, options/full_options/use_options, ignore, file

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `domains` field in `declare_lint_rule!` to tag rules that belong to specific concepts like testing or frameworks

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).same()` when implementing a rule that matches the behavior of an ESLint rule

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).inspired()` when implementing a rule inspired by but with different behavior than an ESLint rule

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `sources` field with `RuleSource` to cite ESLint or other rules that inspired the implementation

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use language-specific rule names if the rule is meant for a specific language only

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Valid code examples in rule documentation should not trigger any diagnostics

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-mutation.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-shorthand-query.graphql
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Invalid code examples in rule documentation must be marked with `expect_diagnostic` code block property

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation must include `## Examples` section with `### Invalid` and `### Valid` subsections

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: For rule changes in changesets, clearly demonstrate what is now invalid that wasn't before, or vice versa

Applied to files:

  • .changeset/lazy-doodles-attack.md
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Place new rules inside the `nursery` group during development

Applied to files:

  • .changeset/lazy-doodles-attack.md
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: For new nursery rules, send PRs to the maintenance branch `main`

Applied to files:

  • .changeset/lazy-doodles-attack.md
📚 Learning: 2025-12-04T13:29:49.287Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8291
File: crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/elastic-header.html:10-10
Timestamp: 2025-12-04T13:29:49.287Z
Learning: Files under `crates/biome_html_formatter/tests/specs/prettier` are test fixtures synced from Prettier and should not receive detailed code quality reviews (e.g., HTTP vs HTTPS, formatting suggestions, etc.). These files are test data meant to validate formatter behavior and should be preserved as-is.

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-shorthand-query.graphql
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Prefix line with `#` in documentation code examples sparingly; prefer concise complete snippets

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-shorthand-query.graphql
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use #[derive(Diagnostic)] on enums when every variant contains a type that is itself a diagnostic

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-shorthand-query.graphql
🧬 Code graph analysis (1)
crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs (3)
crates/biome_service/src/workspace.rs (1)
  • markup (1187-1189)
crates/biome_analyze/src/rule.rs (4)
  • recommended (619-622)
  • sources (634-637)
  • same (252-257)
  • span (1499-1501)
crates/biome_service/src/workspace_types.rs (1)
  • Self (748-748)
🔇 Additional comments (12)
justfile (1)

10-10: LGTM – Windows PowerShell configuration.

This setting ensures proper Windows compatibility for the justfile commands.

crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-subscription.graphql (1)

1-4: LGTM – Valid single subscription test case.

Correctly tests that a lone named subscription does not trigger diagnostics.

crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-query.graphql (1)

1-4: LGTM – Valid anonymous query test case.

Correctly validates that a single anonymous query is permitted.

crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/fragment.graphql (1)

1-4: LGTM – Valid fragment test case.

Correctly validates that a single fragment definition is permitted.

crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-subscription.graphql (1)

1-4: LGTM – Valid anonymous subscription test case.

Correctly validates that a single anonymous subscription is permitted.

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

342-342: LGTM – Module exposure for new rule options.

Correctly exposes the use_lone_executable_definition options module in alphabetical order.

crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-query.graphql (1)

1-4: LGTM!

Valid test case for a single named query is correctly structured.

crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql (1)

1-26: LGTM!

Comprehensive invalid test case covering multiple definition types (queries, mutations, subscriptions, fragments).

crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphql (1)

1-6: LGTM!

Minimal invalid case with two definitions is appropriate.

crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-shorthand-query.graphql (1)

1-4: LGTM!

Valid shorthand query test case is correctly structured.

crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-mutation.graphql (1)

1-6: LGTM!

Valid anonymous mutation test case is correctly structured.

crates/biome_rule_options/src/use_lone_executable_definition.rs (1)

1-6: LGTM!

Options struct correctly follows all coding guidelines: appropriate derives, serde attributes, and Merge trait implementation.

As per coding guidelines, options structs must derive Deserializable, Serialize, Deserialize, Merge, and use deny_unknown_fields with camelCase.

@Netail Netail force-pushed the feat/use-lone-executable-definition branch from de4a247 to 0a2abf1 Compare December 29, 2025 18:40
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: 0

♻️ Duplicate comments (1)
crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs (1)

40-46: Add issue_number field for nursery rule.

Nursery rules should include an issue_number field to track the associated GitHub issue.

🔎 Suggested addition
 pub UseLoneExecutableDefinition {
     version: "next",
     name: "useLoneExecutableDefinition",
     language: "graphql",
     recommended: false,
+    issue_number: <issue_number_here>,
     sources: &[RuleSource::EslintGraphql("lone-executable-definition").same()],
 }

Based on learnings, work-in-progress rules should add issue_number field to declare_lint_rule! macro.

🧹 Nitpick comments (2)
crates/biome_rule_options/src/use_lone_executable_definition.rs (1)

3-6: Consider adding rustdoc for the options struct.

Per coding guidelines, Rust types should have inline rustdoc documentation.

🔎 Suggested addition
+/// Options for the `useLoneExecutableDefinition` rule.
 #[derive(Default, Clone, Debug, Deserialize, Deserializable, Merge, Eq, PartialEq, Serialize)]
 #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
 #[serde(rename_all = "camelCase", deny_unknown_fields, default)]
 pub struct UseLoneExecutableDefinitionOptions {}
crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs (1)

88-91: Consider clarifying the diagnostic message.

The parenthetical "(multiple)" reads a bit awkwardly. A clearer message might be:

🔎 Suggested change
         let mut diagnostic = RuleDiagnostic::new(
             rule_category!(),
             span,
             markup! {
-                "Document contains (multiple) definitions."
+                "Document contains multiple executable definitions."
             },
         );
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between de4a247 and 0a2abf1.

⛔ Files ignored due to path filters (16)
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_graphql_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-named-query.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/fragment.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-mutation.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-query.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-subscription.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-mutation.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-query.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-subscription.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-shorthand-query.graphql.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (16)
  • .changeset/lazy-doodles-attack.md
  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-named-query.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/fragment.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-mutation.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-query.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-subscription.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-mutation.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-query.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-subscription.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-shorthand-query.graphql
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
  • justfile
✅ Files skipped from review due to trivial changes (1)
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-query.graphql
🚧 Files skipped from review as they are similar to previous changes (9)
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-query.graphql
  • justfile
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-named-query.graphql
  • .changeset/lazy-doodles-attack.md
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/fragment.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-subscription.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-shorthand-query.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-mutation.graphql
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Use inline rustdoc documentation for rules, assists, and their options
Use the dbg!() macro for debugging output in Rust tests and code
Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in tests

Files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
🧠 Learnings (37)
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options must be placed inside the `biome_rule_options` crate

Applied to files:

  • crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Wrap rule options fields in `Option<>` to properly track set and unset options during merge

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `deny_unknown_fields` in serde derive macro for rule options

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/local_inference.rs : Implement local inference in dedicated modules to derive type definitions from expressions without context of surrounding scopes

Applied to files:

  • crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Implement `Merge` trait for rule options to support configuration inheritance

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `rename_all = "camelCase"` in serde derive macro for rule options

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `options` code block property for rule-specific configuration snippets in documentation

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `version` field to `next` in `declare_lint_rule!` macro

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `language` field in `declare_lint_rule!` macro to the language the rule primarily applies to

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `Box<[T]>` instead of `Vec<T>` for rule options arrays to save memory

Applied to files:

  • crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation must include `## Options` section if the rule has options

Applied to files:

  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options struct must derive `Deserializable`, `Serialize`, `Deserialize`, and optionally `JsonSchema`

Applied to files:

  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `use_options` code block property for code examples that follow an options configuration in documentation

Applied to files:

  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `full_options` code block property for complete biome.json configuration snippets in documentation

Applied to files:

  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-11-21T01:10:53.059Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.

Applied to files:

  • crates/biome_rule_options/src/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `declare_lint_rule!` macro to declare analyzer rule types and implement the RuleMeta trait

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Add `issue_number` field to `declare_lint_rule!` macro for work-in-progress rules

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should perform static analysis of source code to detect invalid or error-prone patterns and emit diagnostics with proposed fixes

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-22T09:26:56.943Z
Learnt from: ematipico
Repo: biomejs/biome PR: 8537
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:167-210
Timestamp: 2025-12-22T09:26:56.943Z
Learning: When defining lint rules (declare_lint_rule!), only specify fix_kind if the rule implements an action(...) function. Rules that only emit diagnostics without a code fix should omit fix_kind. This applies to all Rust lint rule definitions under crates/.../src/lint (e.g., crates/biome_js_analyze/src/lint/...).

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : The first paragraph of rule documentation must be a single line describing what the rule does

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should check syntax according to language specification and emit error diagnostics

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `sources` field with `RuleSource` to cite ESLint or other rules that inspired the implementation

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `domains` field in `declare_lint_rule!` to tag rules that belong to specific concepts like testing or frameworks

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Place new rules inside the `nursery` group during development

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `deprecated` field to `declare_lint_rule!` macro when deprecating a rule

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code; if a token/node is known to be mandatory but is missing, return `None` instead

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).same()` when implementing a rule that matches the behavior of an ESLint rule

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation code blocks should be ordered as language, expect_diagnostic, options/full_options/use_options, ignore, file

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Each invalid code example in rule documentation must emit exactly one diagnostic

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).inspired()` when implementing a rule inspired by but with different behavior than an ESLint rule

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use language-specific rule names if the rule is meant for a specific language only

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
📚 Learning: 2025-12-04T13:29:49.287Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8291
File: crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/elastic-header.html:10-10
Timestamp: 2025-12-04T13:29:49.287Z
Learning: Files under `crates/biome_html_formatter/tests/specs/prettier` are test fixtures synced from Prettier and should not receive detailed code quality reviews (e.g., HTTP vs HTTPS, formatting suggestions, etc.). These files are test data meant to validate formatter behavior and should be preserved as-is.

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-mutation.graphql
📚 Learning: 2025-12-22T09:27:13.161Z
Learnt from: ematipico
Repo: biomejs/biome PR: 8537
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:167-210
Timestamp: 2025-12-22T09:27:13.161Z
Learning: In crates/biome_analyze/**/*analyze/src/**/*.rs, the `fix_kind` field in `declare_lint_rule!` should only be specified when the rule implements the `action` function. Rules that only emit diagnostics without providing code fixes should not include `fix_kind` in their metadata.

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-mutation.graphql
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*invalid* : Create test files prefixed with `invalid` for code that should trigger the rule

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Invalid code examples in rule documentation must be marked with `expect_diagnostic` code block property

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `declare_node_union!` macro to query multiple node types at once

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation must include `## Examples` section with `### Invalid` and `### Valid` subsections

Applied to files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql
🧬 Code graph analysis (1)
crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs (2)
crates/biome_service/src/workspace.rs (1)
  • markup (1187-1189)
crates/biome_analyze/src/rule.rs (4)
  • recommended (619-622)
  • sources (634-637)
  • same (252-257)
  • span (1499-1501)
🔇 Additional comments (5)
crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-mutation.graphql (1)

1-6: LGTM!

Valid test fixture for a single named mutation – correctly expects no diagnostics.

crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-subscription.graphql (1)

1-4: LGTM!

Valid test fixture for a single anonymous subscription.

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

342-342: LGTM!

Module correctly placed in alphabetical order.

crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql (1)

1-26: LGTM!

Comprehensive invalid test fixture covering all executable definition types – good coverage.

crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs (1)

55-81: LGTM!

The run function correctly handles edge cases – checking definitions.len() > 1 before removing prevents the panic on empty documents.

@Netail Netail force-pushed the feat/use-lone-executable-definition branch from 0a2abf1 to 52b49ec Compare December 29, 2025 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Diagnostic Area: diagnostocis A-Linter Area: linter A-Project Area: project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant