-
-
Notifications
You must be signed in to change notification settings - Fork 792
feat(graphql_analyze): implement useLoneExecutableDefinition #8617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 52b49ec The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
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 |
4966d0d to
7333327
Compare
CodSpeed Performance ReportMerging #8617 will not alter performanceComparing Summary
Footnotes
|
7333327 to
de4a247
Compare
WalkthroughAdds a new GraphQL nursery lint rule Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (16)
📒 Files selected for processing (16)
🚧 Files skipped from review as they are similar to previous changes (10)
🧰 Additional context used📓 Path-based instructions (1)**/*.rs📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
🧠 Learnings (22)📓 Common learnings📚 Learning: 2025-12-19T12:53:30.413ZApplied to files:
📚 Learning: 2025-12-19T12:53:30.413ZApplied to files:
📚 Learning: 2025-12-19T12:53:30.413ZApplied to files:
📚 Learning: 2025-11-24T18:05:42.356ZApplied to files:
📚 Learning: 2025-12-19T12:53:30.413ZApplied to files:
📚 Learning: 2025-12-19T12:53:30.413ZApplied to files:
📚 Learning: 2025-12-19T12:53:30.413ZApplied to files:
📚 Learning: 2025-12-19T12:53:30.413ZApplied to files:
📚 Learning: 2025-12-19T12:53:30.413ZApplied to files:
📚 Learning: 2025-12-19T12:53:30.413ZApplied to files:
📚 Learning: 2025-12-19T12:53:30.413ZApplied to files:
📚 Learning: 2025-12-19T12:53:30.413ZApplied to files:
📚 Learning: 2025-12-04T13:29:49.287ZApplied to files:
📚 Learning: 2025-12-19T12:53:30.413ZApplied to files:
📚 Learning: 2025-11-24T18:04:57.309ZApplied to files:
📚 Learning: 2025-12-19T12:53:30.413ZApplied to files:
📚 Learning: 2025-12-19T12:53:30.413ZApplied to files:
📚 Learning: 2025-12-19T12:53:30.413ZApplied to files:
📚 Learning: 2025-12-19T12:53:30.413ZApplied to files:
📚 Learning: 2025-12-19T12:53:30.413ZApplied to files:
📚 Learning: 2025-12-19T12:53:30.413ZApplied to files:
🔇 Additional comments (6)
Comment |
There was a problem hiding this 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
⛔ Files ignored due to path filters (15)
crates/biome_configuration/src/analyzer/linter/rules.rsis excluded by!**/rules.rsand included by**crates/biome_diagnostics_categories/src/categories.rsis excluded by!**/categories.rsand included by**crates/biome_graphql_analyze/src/lint/nursery.rsis excluded by!**/nursery.rsand included by**crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/fragment.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-mutation.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-query.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-subscription.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-mutation 3.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-query.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-subscription.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-shorthand-query.graphql.snapis excluded by!**/*.snapand included by**packages/@biomejs/backend-jsonrpc/src/workspace.tsis excluded by!**/backend-jsonrpc/src/workspace.tsand included by**packages/@biomejs/biome/configuration_schema.jsonis excluded by!**/configuration_schema.jsonand included by**
📒 Files selected for processing (16)
.changeset/lazy-doodles-attack.mdcrates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rscrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-named-query.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/fragment.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-mutation.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-query.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-subscription.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-mutation 3.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-query.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-subscription.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-shorthand-query.graphqlcrates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/use_lone_executable_definition.rsjustfile
🧰 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 thedbg!()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.rscrates/biome_rule_options/src/use_lone_executable_definition.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-subscription.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-mutation 3.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/fragment.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-query.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphqlcrates/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.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-mutation 3.graphqlcrates/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.graphqlcrates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rscrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphqlcrates/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.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphqlcrates/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_definitionoptions 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.
crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
Show resolved
Hide resolved
crates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rs
Show resolved
Hide resolved
...ql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-named-query.graphql
Outdated
Show resolved
Hide resolved
..._analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-mutation.graphql
Show resolved
Hide resolved
de4a247 to
0a2abf1
Compare
There was a problem hiding this 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: Addissue_numberfield for nursery rule.Nursery rules should include an
issue_numberfield 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_numberfield todeclare_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
⛔ Files ignored due to path filters (16)
crates/biome_configuration/src/analyzer/linter/rules.rsis excluded by!**/rules.rsand included by**crates/biome_diagnostics_categories/src/categories.rsis excluded by!**/categories.rsand included by**crates/biome_graphql_analyze/src/lint/nursery.rsis excluded by!**/nursery.rsand included by**crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-named-query.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/fragment.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-mutation.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-query.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-subscription.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-mutation.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-query.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-subscription.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-shorthand-query.graphql.snapis excluded by!**/*.snapand included by**packages/@biomejs/backend-jsonrpc/src/workspace.tsis excluded by!**/backend-jsonrpc/src/workspace.tsand included by**packages/@biomejs/biome/configuration_schema.jsonis excluded by!**/configuration_schema.jsonand included by**
📒 Files selected for processing (16)
.changeset/lazy-doodles-attack.mdcrates/biome_graphql_analyze/src/lint/nursery/use_lone_executable_definition.rscrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-executables-definitions.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/multi-named-query.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/invalid/single-query-definition.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/fragment.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-mutation.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-query.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-anonymous-subscription.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-mutation.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-query.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-named-subscription.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useLoneExecutableDefinition/valid/single-shorthand-query.graphqlcrates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/use_lone_executable_definition.rsjustfile
✅ 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 thedbg!()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.rscrates/biome_rule_options/src/use_lone_executable_definition.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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
runfunction correctly handles edge cases – checkingdefinitions.len() > 1before removing prevents the panic on empty documents.
0a2abf1 to
52b49ec
Compare
Summary
Port Eslint Graphql's
lone-executable-definitionTest Plan
Docs