-
-
Notifications
You must be signed in to change notification settings - Fork 805
feat(graphql_analyze): implement useInputName #8619
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: 101930a 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 |
f1cce18 to
d90b913
Compare
Merging this PR will not alter performanceSummary
Comparing Footnotes
|
6af6c62 to
a3bd16f
Compare
WalkthroughAdds a new GraphQL nursery lint rule Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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: 2
Fix all issues with AI Agents 🤖
In
@crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid/invalid.options.json:
- Around line 1-16: The test options file is named invalid.options.json but is
located in a valid test case folder, which is confusing; either rename the file
to valid.options.json to match the directory's intent or move this file into an
invalid/ directory to match its name—update any test harness references
expecting invalid.options.json or valid.options.json accordingly (look for
usages of this test case in the test runner or fixtures that reference
"useInputName" or the nursery rule options) so the file name and directory
purpose are consistent.
In
@crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid/invalid.options.json:
- Around line 1-16: The file currently named invalid.options.json inside the
valid/ test directory should be renamed to valid.options.json so it matches the
other test fixtures; locate the file (invalid.options.json) in
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid/,
rename it to valid.options.json, and ensure any test harness or snapshot
references (if any) are updated to use the new filename.
🧹 Nitpick comments (3)
crates/biome_graphql_syntax/src/object_ext.rs (2)
3-36: Consider reducing duplication with a helper method.The three methods follow an identical pattern. You could extract a private helper like:
fn has_name(&self, expected: &str) -> bool { self.name() .ok() .and_then(|name| name.value_token().ok()) .is_some_and(|token| token.text_trimmed() == expected) }Then simplify each method:
pub fn is_query(&self) -> bool { self.has_name("Query") }This reduces the implementation from ~30 lines to ~10 and makes future changes easier.
38-71: Same duplication pattern asGraphqlObjectTypeDefinition.If you implement the helper method suggested above, you could use a trait to share the logic between both types:
trait HasTypeName { fn name(&self) -> Result<GraphqlName, ...>; fn has_name(&self, expected: &str) -> bool { // shared implementation } }Or simply duplicate the helper method in each impl block if trait complexity isn't warranted.
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs (1)
217-228: Consider documenting the unhandled type variant.Line 226 silently returns
Nonefor unmatchedAnyGraphqlTypevariants. Consider adding a comment explaining which variant this covers or if it's intentional that certain type constructs should not trigger type-name validation.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (11)
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/useInputName/case-sensitive-input-type/invalid/invalid.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid/valid.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid/invalid.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid/valid.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useInputName/invalid.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useInputName/valid.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/tangy-states-obey.mdcrates/biome_graphql_analyze/src/lint/nursery/use_input_name.rscrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid/invalid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid/valid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid/invalid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid/valid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/invalid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/valid.graphqlcrates/biome_graphql_syntax/src/lib.rscrates/biome_graphql_syntax/src/object_ext.rscrates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/use_input_name.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 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_graphql_syntax/src/object_ext.rscrates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/use_input_name.rscrates/biome_graphql_analyze/src/lint/nursery/use_input_name.rscrates/biome_graphql_syntax/src/lib.rs
🧠 Learnings (40)
📚 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/tangy-states-obey.md
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/* : Create test files with `invalid` and `valid` prefixes to represent code that should and should not trigger the rule
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid/invalid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid/invalid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid/valid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/invalid.graphql
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Rule options must be defined in the `biome_rule_options` crate with a file named after the rule
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/use_input_name.rscrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Use `Option<_>` wrapper for rule option fields to enable proper merging of configurations
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/use_input_name.rscrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Rule names should use the `use` prefix when the rule's sole intention is to mandate a single concept
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/use_input_name.rscrates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Use `Box<[Box<str>]>` instead of `Vec<String>` for collections of strings in rule options to save memory
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Apply `#[serde(rename_all = "camelCase")]` to rule option structs to match JSON configuration naming convention
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/use_input_name.rscrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Implement `biome_deserialize::Merge` for rule option types to define how shared and user configurations are merged
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Apply `#[serde(deny_unknown_fields)]` to rule option structs to enforce strict configuration validation
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/use_input_name.rscrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid/invalid.options.json
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/language_kind.rs : Add a new language prefix to the `LANGUAGE_PREFIXES` constant in `language_kind.rs` file
Applied to files:
crates/biome_rule_options/src/lib.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.rscrates/biome_graphql_syntax/src/lib.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Use `declare_lint_rule!` macro with a `version` field set to `next` for new rules
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Rule option types must derive `Deserializable`, `Serialize`, `Deserialize`, and optionally `JsonSchema` traits
Applied to files:
crates/biome_rule_options/src/use_input_name.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_input_name.rscrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid/invalid.options.json
📚 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/**/*.rs : Distinguish between `TypeData::Unknown` and `TypeData::UnknownKeyword` to measure inference effectiveness versus explicit user-provided unknown types
Applied to files:
crates/biome_rule_options/src/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Rule names should use the `no` prefix when the rule's sole intention is to forbid a single concept
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : New rules must be placed inside the `nursery` group before promotion to other groups
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rscrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Deprecated rules must include a `deprecated` field in the `declare_lint_rule!` macro with an explanation of what rule to use instead
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2025-12-31T15:35:32.899Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8639
File: crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs:101-108
Timestamp: 2025-12-31T15:35:32.899Z
Learning: In Rust lint rules under the nursery category, the issue_number field in declare_lint_rule! is optional and should not be added unless there is a compelling reason. In code reviews, verify that no unnecessary issue_number is included in nursery lint declarations. Only add issue_number if there is an explicit, justified reason (e.g., tracked issue for external observers). This guidance broadly applies to all nursery lint rule files, not just the single file.
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.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_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Use the `Semantic<T>` query type to access semantic information about bindings, references, and scope within a rule
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Use `rule_category!()` macro to refer to the diagnostic category instead of dynamically parsing its string name
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Implement the `action` function and add `fix_kind` metadata to the rule macro if the rule provides code actions
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Implement the `run` function to return `Option<Self::State>` or `Vec<Self::State>` (as `Box<[Self::State]>`) depending on whether the rule reports one or multiple signals
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Implement custom `Queryable` and `Visitor` types for rules that require deep inspection of child nodes to avoid inefficient traversals
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Use `p.eat(token)` for optional tokens, `p.expect(token)` for required tokens, `parse_rule(p).ok(p)` for optional nodes, and `parse_rule(p).or_add_diagnostic(p, error)` for required nodes
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Implement the `diagnostic` function to provide error messages explaining what the error is, why it is triggered, and what the user should do
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 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/specs/**/options.json : Create an `options.json` file (formatted as `biome.json`) in test specification folders to apply non-default formatting options to all test files in that folder
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/*.jsonc : Use `.jsonc` format for test files containing multiple code snippets, where each snippet is a string in an array
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid/invalid.options.json
📚 Learning: 2025-12-31T15:35:41.261Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8639
File: crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs:101-108
Timestamp: 2025-12-31T15:35:41.261Z
Learning: In crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs, the `issue_number` field in `declare_lint_rule!` macro is optional and the vast majority of nursery rules do not need it. Do not recommend adding `issue_number` unless there's a specific reason.
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Rule documentation must include an `## Examples` section followed by `### Invalid` and `### Valid` subsections, with Invalid appearing first
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/* : Test snapshot output files must be placed in `tests/specs/` folder with subfolders matching the rule group and rule name
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid/invalid.options.json
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Biome linter rules must be designed to work across languages, requiring careful naming to indicate intended scope
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid/invalid.options.json
📚 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/useInputName/check-input-type/invalid/invalid.options.json
📚 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/**/*.rs : No module may copy or clone data from another module in the module graph, not even behind an `Arc`
Applied to files:
crates/biome_graphql_syntax/src/lib.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/**/*.rs : Use `TypeReference` instead of `Arc` for types that reference other types to avoid stale cache issues when modules are replaced
Applied to files:
crates/biome_graphql_syntax/src/lib.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Create two new crates `biome_{language}_syntax` and `biome_{language}_factory` using `cargo new --lib` for new language parsers
Applied to files:
crates/biome_graphql_syntax/src/lib.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Use `ConditionalParsedSyntax` for syntax that is only valid in specific contexts (e.g., strict mode, file types, language versions) and call `or_invalid_to_bogus()` to convert to a bogus node if not supported
Applied to files:
crates/biome_graphql_syntax/src/lib.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Implement a token source struct that wraps the lexer and implements `TokenSourceWithBufferedLexer` and `LexerWithCheckpoint` for lookahead and re-lexing capabilities
Applied to files:
crates/biome_graphql_syntax/src/lib.rs
🧬 Code graph analysis (1)
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs (2)
crates/biome_graphql_syntax/src/object_ext.rs (2)
is_mutation(15-24)is_mutation(50-59)crates/biome_rule_options/src/use_input_name.rs (2)
check_input_type(20-23)case_sensitive_input_type(25-28)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
- GitHub Check: autofix
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Check JS Files
- GitHub Check: Test Node.js API
- GitHub Check: End-to-end tests
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Documentation
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check Dependencies
- GitHub Check: Validate rules documentation
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_graphql_parser)
🔇 Additional comments (16)
.changeset/tangy-states-obey.md (1)
1-13: LGTM!The changeset documentation is clear and correctly formatted.
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid/invalid.graphql (1)
1-10: LGTM!The test cases comprehensively cover different violation scenarios with clear explanatory comments.
crates/biome_graphql_syntax/src/lib.rs (1)
10-10: LGTM!Standard module integration, correctly declared as private.
crates/biome_rule_options/src/use_input_name.rs (2)
1-29: LGTM!The options structure follows Biome conventions correctly with proper derives, serde attributes, and sensible defaults.
7-13: Use rustdoc comments for field documentation.The documentation comments should use
///instead of//to generate proper API documentation.🔎 Proposed fix
- /// Check that the input type name follows the convention <mutationName>Input + /// Check that the input type name follows the convention <mutationName>Input #[serde(skip_serializing_if = "Option::<_>::is_none")] pub check_input_type: Option<bool>, - /// Treat input type names as case-sensitive + /// Treat input type names as case-sensitive #[serde(skip_serializing_if = "Option::<_>::is_none")] pub case_sensitive_input_type: Option<bool>,Based on coding guidelines.
⛔ Skipped due to learnings
Learnt from: CR Repo: biomejs/biome PR: 0 File: crates/biome_analyze/CONTRIBUTING.md:0-0 Timestamp: 2026-01-02T14:58:16.536Z Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Apply `#[serde(rename_all = "camelCase")]` to rule option structs to match JSON configuration naming conventionLearnt from: CR Repo: biomejs/biome PR: 0 File: crates/biome_analyze/CONTRIBUTING.md:0-0 Timestamp: 2026-01-02T14:58:16.536Z Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Use `Option<_>` wrapper for rule option fields to enable proper merging of configurationsLearnt from: CR Repo: biomejs/biome PR: 0 File: crates/biome_analyze/CONTRIBUTING.md:0-0 Timestamp: 2026-01-02T14:58:16.536Z Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Rule option types must derive `Deserializable`, `Serialize`, `Deserialize`, and optionally `JsonSchema` traitscrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid/invalid.options.json (1)
1-16: LGTM!Standard test configuration enabling both options for invalid test scenarios.
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid/invalid.options.json (1)
1-16: LGTM!Configuration correctly tests case-insensitive input type matching.
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid/valid.graphql (1)
1-6: LGTM!Test cases appropriately cover valid mutation input naming with type modifiers.
crates/biome_rule_options/src/lib.rs (1)
336-336: LGTM!The new module export is correctly placed in alphabetical order and follows the established pattern. Based on learnings, rule options are correctly defined in the
biome_rule_optionscrate.crates/biome_graphql_analyze/tests/specs/nursery/useInputName/invalid.graphql (1)
1-10: LGTM!Good coverage of invalid scenarios testing the base rule where the argument name must be "input". The fixtures appropriately cover primitive types, custom types, non-null wrappers, and list types.
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid/invalid.graphql (1)
1-13: LGTM!Comprehensive test coverage for the
checkInputTypefeature, covering argument name validation, type suffix requirements, case sensitivity, and mutation name matching.crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs (3)
14-90: LGTM!The rule declaration follows all conventions:
version: "next"for nursery rules,useprefix for mandating a concept, comprehensive rustdoc with examples. Based on learnings, nofix_kindis needed since noaction()is implemented.
98-163: LGTM!The
runimplementation correctly:
- Traverses the AST to verify the field is within a Mutation type
- Validates argument names and optionally type names
- The case-sensitivity logic on lines 150-151 correctly short-circuits based on the configuration
173-215: LGTM!Clear state representation with informative diagnostic messages. The
descriptionmethod appropriately explains the rationale behind each violation.crates/biome_graphql_analyze/tests/specs/nursery/useInputName/valid.graphql (1)
1-14: LGTM!Solid coverage of valid scenarios for the base rule. Good inclusion of
extend type Mutationto verify the rule handles type extensions correctly.crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid/valid.graphql (1)
8-9: No issues. The test case is correctly configured withcaseSensitiveInputType: falsein options.json, sosetMessageInput(lowercase) is a valid match for theSetMessagemutation when case-insensitive mode is enabled. The comment "# Case sensitive" simply labels which feature variant is being tested.
...phql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.options.json
Show resolved
Hide resolved
...biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.options.json
Show resolved
Hide resolved
a3bd16f to
9900e03
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
🧹 Nitpick comments (3)
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs (1)
150-152: Consider short-circuit evaluation for clarity.Whilst the logic is correct, the condition evaluates the lowercase comparison even when
case_sensitive_input_typeis true. For clarity and minor efficiency:if case_sensitive_input_type { ty_string != valid_string } else { ty_string.to_lowercase_cow() != valid_string.to_lowercase_cow() }crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.graphql (1)
8-9: Clarify the comment.The comment says "Case sensitive" but the test runs with
caseSensitiveInputType: false, so this line actually validates case-insensitive matching. Consider:-# Case sensitive +# Case insensitive - accepts different casing type Mutation { SetMessage(input: setMessageInput): String }crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.graphql (1)
4-4: Consider test organization.This case tests the base rule (argument not named "input") rather than the
checkInputTypefeature specifically. Whilst not incorrect, it might be clearer in a baseinvalid.graphqlfile. However, if comprehensive coverage in each configuration is intentional, this is fine.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (11)
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/useInputName/case-sensitive-input-type/invalid.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useInputName/invalid.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useInputName/valid.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/tangy-states-obey.mdcrates/biome_graphql_analyze/src/lint/nursery/use_input_name.rscrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/invalid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/valid.graphqlcrates/biome_graphql_syntax/src/lib.rscrates/biome_graphql_syntax/src/object_ext.rscrates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/use_input_name.rs
✅ Files skipped from review due to trivial changes (2)
- crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.options.json
- crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.graphql
🚧 Files skipped from review as they are similar to previous changes (6)
- .changeset/tangy-states-obey.md
- crates/biome_rule_options/src/lib.rs
- crates/biome_graphql_analyze/tests/specs/nursery/useInputName/invalid.graphql
- crates/biome_graphql_syntax/src/lib.rs
- crates/biome_rule_options/src/use_input_name.rs
- crates/biome_graphql_syntax/src/object_ext.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 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_graphql_analyze/src/lint/nursery/use_input_name.rs
🧠 Learnings (27)
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/* : Create test files with `invalid` and `valid` prefixes to represent code that should and should not trigger the rule
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.graphql
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Rule names should use the `use` prefix when the rule's sole intention is to mandate a single concept
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Rule names should use the `no` prefix when the rule's sole intention is to forbid a single concept
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Use `declare_lint_rule!` macro with a `version` field set to `next` for new rules
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : New rules must be placed inside the `nursery` group before promotion to other groups
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rscrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Deprecated rules must include a `deprecated` field in the `declare_lint_rule!` macro with an explanation of what rule to use instead
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2025-12-31T15:35:32.899Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8639
File: crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs:101-108
Timestamp: 2025-12-31T15:35:32.899Z
Learning: In Rust lint rules under the nursery category, the issue_number field in declare_lint_rule! is optional and should not be added unless there is a compelling reason. In code reviews, verify that no unnecessary issue_number is included in nursery lint declarations. Only add issue_number if there is an explicit, justified reason (e.g., tracked issue for external observers). This guidance broadly applies to all nursery lint rule files, not just the single file.
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.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_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Use the `Semantic<T>` query type to access semantic information about bindings, references, and scope within a rule
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Use `rule_category!()` macro to refer to the diagnostic category instead of dynamically parsing its string name
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Implement the `action` function and add `fix_kind` metadata to the rule macro if the rule provides code actions
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Implement the `run` function to return `Option<Self::State>` or `Vec<Self::State>` (as `Box<[Self::State]>`) depending on whether the rule reports one or multiple signals
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Implement custom `Queryable` and `Visitor` types for rules that require deep inspection of child nodes to avoid inefficient traversals
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Use `p.eat(token)` for optional tokens, `p.expect(token)` for required tokens, `parse_rule(p).ok(p)` for optional nodes, and `parse_rule(p).or_add_diagnostic(p, error)` for required nodes
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Use `Option<_>` wrapper for rule option fields to enable proper merging of configurations
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 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/specs/**/options.json : Create an `options.json` file (formatted as `biome.json`) in test specification folders to apply non-default formatting options to all test files in that folder
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.options.json
📚 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_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/*.jsonc : Use `.jsonc` format for test files containing multiple code snippets, where each snippet is a string in an array
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.options.json
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Biome linter rules must be designed to work across languages, requiring careful naming to indicate intended scope
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.options.json
📚 Learning: 2025-12-31T15:35:41.261Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8639
File: crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs:101-108
Timestamp: 2025-12-31T15:35:41.261Z
Learning: In crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs, the `issue_number` field in `declare_lint_rule!` macro is optional and the vast majority of nursery rules do not need it. Do not recommend adding `issue_number` unless there's a specific reason.
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/* : Test snapshot output files must be placed in `tests/specs/` folder with subfolders matching the rule group and rule name
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Apply `#[serde(rename_all = "camelCase")]` to rule option structs to match JSON configuration naming convention
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.options.json
📚 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/useInputName/case-sensitive-input-type/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Rule options must be defined in the `biome_rule_options` crate with a file named after the rule
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.options.json
📚 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/useInputName/case-sensitive-input-type/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Rule documentation must include an `## Examples` section followed by `### Invalid` and `### Valid` subsections, with Invalid appearing first
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.options.json
🧬 Code graph analysis (1)
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs (2)
crates/biome_graphql_syntax/src/object_ext.rs (2)
is_mutation(15-24)is_mutation(50-59)crates/biome_rule_options/src/use_input_name.rs (2)
check_input_type(20-23)case_sensitive_input_type(25-28)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Check Dependencies
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: End-to-end tests
- GitHub Check: Documentation
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Test Node.js API
- GitHub Check: Check JS Files
- GitHub Check: autofix
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_graphql_parser)
🔇 Additional comments (3)
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.graphql (1)
1-13: Test coverage looks solid.The test cases correctly cover the key violation scenarios for the
checkInputTypeoption: wrong argument name, non-Input type suffix, case sensitivity, and name mismatch.crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.graphql (1)
1-6: Excellent coverage of type modifiers.The test cases correctly validate that required (
!), optional, and list ([]) type modifiers work with the input type name checking. Well done.crates/biome_graphql_analyze/tests/specs/nursery/useInputName/valid.graphql (1)
1-14: Comprehensive base rule validation.The test cases properly validate that the base rule (argument named "input") accepts various type names when
checkInputTypeis disabled. The inclusion ofextend type Mutation(line 14) is particularly good for completeness.
9900e03 to
02e9bcd
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
🧹 Nitpick comments (3)
crates/biome_graphql_syntax/src/object_ext.rs (2)
4-13: Simplifyhas_namereturn logic.The explicit
return truefollowed byfalsecan be replaced with a direct boolean expression.🔎 Proposed simplification
fn has_name(&self, expected: &str) -> bool { - if let Some(name) = self.name().ok() + self.name().ok() && let Some(value_token) = name.value_token().ok() - && value_token.text_trimmed() == expected - { - return true; - } - - false + .is_some_and(|name| name.value_token().ok() + .is_some_and(|token| token.text_trimmed() == expected)) }Or more simply:
fn has_name(&self, expected: &str) -> bool { - if let Some(name) = self.name().ok() - && let Some(value_token) = name.value_token().ok() - && value_token.text_trimmed() == expected - { - return true; - } - - false + self.name().ok() + .and_then(|name| name.value_token().ok()) + .is_some_and(|token| token.text_trimmed() == expected) }
28-51: Consider extracting shared logic to reduce duplication.The
has_nameimplementation is identical for bothGraphqlObjectTypeDefinitionandGraphqlObjectTypeExtension. Consider a trait or macro to eliminate duplication.crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs (1)
150-151: Consider simplifying the boolean logic for clarity.The condition works correctly but evaluates both case-sensitive and case-insensitive comparisons when
case_sensitive_input_typeis true. A clearer approach would separate the two cases explicitly.🔎 Suggested refactor
- if (case_sensitive_input_type && ty_string != valid_string) - || ty_string.to_lowercase_cow() != valid_string.to_lowercase_cow() - { + let matches = if case_sensitive_input_type { + ty_string == valid_string + } else { + ty_string.to_lowercase_cow() == valid_string.to_lowercase_cow() + }; + if !matches { return Some(UseInputNameState::InvalidTypeName( argument.range(), ty_string.to_string(),
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (11)
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/useInputName/case-sensitive-input-type/invalid.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useInputName/invalid.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useInputName/valid.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/tangy-states-obey.mdcrates/biome_graphql_analyze/src/lint/nursery/use_input_name.rscrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/invalid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/valid.graphqlcrates/biome_graphql_syntax/src/lib.rscrates/biome_graphql_syntax/src/object_ext.rscrates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/use_input_name.rs
✅ Files skipped from review due to trivial changes (1)
- crates/biome_graphql_syntax/src/lib.rs
🚧 Files skipped from review as they are similar to previous changes (8)
- crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.json
- crates/biome_rule_options/src/lib.rs
- crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.graphql
- crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.graphql
- .changeset/tangy-states-obey.md
- crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.json
- crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.graphql
- crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.options.json
🧰 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_graphql_syntax/src/object_ext.rscrates/biome_graphql_analyze/src/lint/nursery/use_input_name.rscrates/biome_rule_options/src/use_input_name.rs
🧠 Learnings (31)
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Rule names should use the `use` prefix when the rule's sole intention is to mandate a single concept
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rscrates/biome_rule_options/src/use_input_name.rscrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Use `declare_lint_rule!` macro with a `version` field set to `next` for new rules
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Rule names should use the `no` prefix when the rule's sole intention is to forbid a single concept
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rscrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Deprecated rules must include a `deprecated` field in the `declare_lint_rule!` macro with an explanation of what rule to use instead
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : New rules must be placed inside the `nursery` group before promotion to other groups
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rscrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.options.json
📚 Learning: 2025-12-31T15:35:32.899Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8639
File: crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs:101-108
Timestamp: 2025-12-31T15:35:32.899Z
Learning: In Rust lint rules under the nursery category, the issue_number field in declare_lint_rule! is optional and should not be added unless there is a compelling reason. In code reviews, verify that no unnecessary issue_number is included in nursery lint declarations. Only add issue_number if there is an explicit, justified reason (e.g., tracked issue for external observers). This guidance broadly applies to all nursery lint rule files, not just the single file.
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.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_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Use the `Semantic<T>` query type to access semantic information about bindings, references, and scope within a rule
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Use `rule_category!()` macro to refer to the diagnostic category instead of dynamically parsing its string name
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Implement the `action` function and add `fix_kind` metadata to the rule macro if the rule provides code actions
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Implement the `run` function to return `Option<Self::State>` or `Vec<Self::State>` (as `Box<[Self::State]>`) depending on whether the rule reports one or multiple signals
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Implement custom `Queryable` and `Visitor` types for rules that require deep inspection of child nodes to avoid inefficient traversals
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Use `p.eat(token)` for optional tokens, `p.expect(token)` for required tokens, `parse_rule(p).ok(p)` for optional nodes, and `parse_rule(p).or_add_diagnostic(p, error)` for required nodes
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Use `Option<_>` wrapper for rule option fields to enable proper merging of configurations
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rscrates/biome_rule_options/src/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/* : Create test files with `invalid` and `valid` prefixes to represent code that should and should not trigger the rule
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/invalid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Apply `#[serde(rename_all = "camelCase")]` to rule option structs to match JSON configuration naming convention
Applied to files:
crates/biome_rule_options/src/use_input_name.rscrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Apply `#[serde(deny_unknown_fields)]` to rule option structs to enforce strict configuration validation
Applied to files:
crates/biome_rule_options/src/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Rule option types must derive `Deserializable`, `Serialize`, `Deserialize`, and optionally `JsonSchema` traits
Applied to files:
crates/biome_rule_options/src/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Rule options must be defined in the `biome_rule_options` crate with a file named after the rule
Applied to files:
crates/biome_rule_options/src/use_input_name.rscrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Implement `biome_deserialize::Merge` for rule option types to define how shared and user configurations are merged
Applied to files:
crates/biome_rule_options/src/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Use `Box<[Box<str>]>` instead of `Vec<String>` for collections of strings in rule options to save memory
Applied to files:
crates/biome_rule_options/src/use_input_name.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_input_name.rscrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.options.json
📚 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/specs/**/options.json : Create an `options.json` file (formatted as `biome.json`) in test specification folders to apply non-default formatting options to all test files in that folder
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.options.json
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/*.jsonc : Use `.jsonc` format for test files containing multiple code snippets, where each snippet is a string in an array
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.options.json
📚 Learning: 2025-12-31T15:35:41.261Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8639
File: crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs:101-108
Timestamp: 2025-12-31T15:35:41.261Z
Learning: In crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs, the `issue_number` field in `declare_lint_rule!` macro is optional and the vast majority of nursery rules do not need it. Do not recommend adding `issue_number` unless there's a specific reason.
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Rule documentation must include an `## Examples` section followed by `### Invalid` and `### Valid` subsections, with Invalid appearing first
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/* : Test snapshot output files must be placed in `tests/specs/` folder with subfolders matching the rule group and rule name
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.options.json
📚 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/useInputName/check-input-type/invalid.options.json
📚 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/useInputName/check-input-type/invalid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Biome linter rules must be designed to work across languages, requiring careful naming to indicate intended scope
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.options.json
🧬 Code graph analysis (1)
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs (3)
crates/biome_service/src/workspace.rs (1)
markup(1195-1197)crates/biome_graphql_syntax/src/object_ext.rs (2)
is_mutation(19-21)is_mutation(44-46)crates/biome_rule_options/src/use_input_name.rs (2)
check_input_type(20-23)case_sensitive_input_type(25-28)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
- GitHub Check: Test Node.js API
- GitHub Check: Check JS Files
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Documentation
- GitHub Check: Check Dependencies
- GitHub Check: End-to-end tests
- GitHub Check: Validate rules documentation
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: autofix
🔇 Additional comments (10)
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/invalid.graphql (1)
1-10: Test coverage looks good.The invalid cases correctly test various scenarios with the wrong argument name (
recordinstead ofinput), covering different type modifiers.crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.graphql (1)
1-13: Well-documented test cases.The test cases clearly cover the different validation scenarios when
checkInputTypeis enabled, with helpful comments explaining each violation.crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.options.json (1)
1-16: Configuration correctly enables strict checking.The options appropriately enable both
checkInputTypeandcaseSensitiveInputTypefor testing the stricter validation scenarios.crates/biome_graphql_analyze/tests/specs/nursery/useInputName/valid.graphql (1)
1-14: Comprehensive valid test cases.The test cases correctly verify that mutations with the proper
inputargument name don't trigger diagnostics, covering various type modifiers and extension syntax.crates/biome_graphql_syntax/src/object_ext.rs (1)
3-26: Add rustdoc comments to public methods.The public methods
is_query,is_mutation, andis_subscriptionlack documentation. According to coding guidelines, public API methods in Rust should have inline rustdoc.🔎 Example documentation
+ /// Returns `true` if this object type is the `Query` root type. pub fn is_query(&self) -> bool { self.has_name("Query") } + /// Returns `true` if this object type is the `Mutation` root type. pub fn is_mutation(&self) -> bool { self.has_name("Mutation") } + /// Returns `true` if this object type is the `Subscription` root type. pub fn is_subscription(&self) -> bool { self.has_name("Subscription") }Based on coding guidelines, inline rustdoc is required for rules, assists, and their options.
⛔ Skipped due to learnings
Learnt from: CR Repo: biomejs/biome PR: 0 File: CONTRIBUTING.md:0-0 Timestamp: 2025-12-21T21:15:03.796Z Learning: Applies to **/*.rs : Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in testsLearnt from: CR Repo: biomejs/biome PR: 0 File: CONTRIBUTING.md:0-0 Timestamp: 2025-12-21T21:15:03.796Z Learning: Applies to **/*.rs : Use inline rustdoc documentation for rules, assists, and their optionsLearnt from: CR Repo: biomejs/biome PR: 0 File: crates/biome_analyze/CONTRIBUTING.md:0-0 Timestamp: 2026-01-02T14:58:16.536Z Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Rule option types must derive `Deserializable`, `Serialize`, `Deserialize`, and optionally `JsonSchema` traitscrates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs (4)
14-90: LGTM!The rule declaration follows all conventions: proper version field, nursery placement, comprehensive rustdoc with examples, and correct naming prefix.
92-149: LGTM!The implementation correctly validates mutation input arguments, checking both the argument name and optionally the type name based on configuration. The diagnostic generation properly uses
rule_category!()and provides appropriate context.Also applies to: 152-163, 165-171
173-215: LGTM!The state enum is well-designed with clear variants and helpful accessor methods. The use of
markup!for messages follows Biome conventions.
217-240: LGTM!The helper functions correctly unwrap GraphQL type wrappers to extract the underlying type name, handling both nullable and list types appropriately.
crates/biome_rule_options/src/use_input_name.rs (1)
1-29: LGTM!The options struct follows all required conventions: proper derives, serde configuration with camelCase and strict validation, Option-wrapped fields for configuration merging, and accessor methods with sensible defaults.
Based on learnings, this aligns with the established patterns for rule options in the biome_rule_options crate.
5ad9d83 to
101930a
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
🧹 Nitpick comments (1)
crates/biome_graphql_syntax/src/object_ext.rs (1)
4-13: Extract duplicatehas_namelogic to eliminate repetition.The
has_namemethod is duplicated across bothimplblocks. Consider extracting this to a trait or a standalone helper function to adhere to DRY principles.♻️ Suggested approach: Extract to a trait
Define a trait with the shared logic:
trait HasTypeName { fn name(&self) -> Result</* appropriate type */, /* error type */>; fn has_name(&self, expected: &str) -> bool { if let Some(name) = self.name().ok() && let Some(value_token) = name.value_token().ok() && value_token.text_trimmed() == expected { return true; } false } }Then implement the trait for both types and remove the duplicate methods from each
implblock.Also applies to: 29-38
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (11)
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/useInputName/case-sensitive-input-type/invalid.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useInputName/invalid.graphql.snapis excluded by!**/*.snapand included by**crates/biome_graphql_analyze/tests/specs/nursery/useInputName/valid.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/tangy-states-obey.mdcrates/biome_graphql_analyze/src/lint/nursery/use_input_name.rscrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/invalid.graphqlcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/valid.graphqlcrates/biome_graphql_syntax/src/lib.rscrates/biome_graphql_syntax/src/object_ext.rscrates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/use_input_name.rs
🚧 Files skipped from review as they are similar to previous changes (8)
- crates/biome_graphql_syntax/src/lib.rs
- crates/biome_graphql_analyze/tests/specs/nursery/useInputName/invalid.graphql
- crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.graphql
- crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.graphql
- crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.options.json
- crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/invalid.graphql
- crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/invalid.options.json
- crates/biome_rule_options/src/lib.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 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_graphql_syntax/src/object_ext.rscrates/biome_rule_options/src/use_input_name.rscrates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
🧠 Learnings (31)
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/* : Create test files with `invalid` and `valid` prefixes to represent code that should and should not trigger the rule
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.json
📚 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/specs/**/options.json : Create an `options.json` file (formatted as `biome.json`) in test specification folders to apply non-default formatting options to all test files in that folder
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Apply `#[serde(rename_all = "camelCase")]` to rule option structs to match JSON configuration naming convention
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_rule_options/src/use_input_name.rscrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/*.jsonc : Use `.jsonc` format for test files containing multiple code snippets, where each snippet is a string in an array
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Rule options must be defined in the `biome_rule_options` crate with a file named after the rule
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_rule_options/src/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/* : Test snapshot output files must be placed in `tests/specs/` folder with subfolders matching the rule group and rule name
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : New rules must be placed inside the `nursery` group before promotion to other groups
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.json.changeset/tangy-states-obey.mdcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.jsoncrates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Use `Option<_>` wrapper for rule option fields to enable proper merging of configurations
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_rule_options/src/use_input_name.rscrates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Rule option types must derive `Deserializable`, `Serialize`, `Deserialize`, and optionally `JsonSchema` traits
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_rule_options/src/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Biome linter rules must be designed to work across languages, requiring careful naming to indicate intended scope
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.json
📚 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_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.jsoncrates/biome_rule_options/src/use_input_name.rscrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.json
📚 Learning: 2025-12-31T15:35:41.261Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8639
File: crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs:101-108
Timestamp: 2025-12-31T15:35:41.261Z
Learning: In crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs, the `issue_number` field in `declare_lint_rule!` macro is optional and the vast majority of nursery rules do not need it. Do not recommend adding `issue_number` unless there's a specific reason.
Applied to files:
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.json.changeset/tangy-states-obey.mdcrates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.json
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Apply `#[serde(deny_unknown_fields)]` to rule option structs to enforce strict configuration validation
Applied to files:
crates/biome_rule_options/src/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Implement `biome_deserialize::Merge` for rule option types to define how shared and user configurations are merged
Applied to files:
crates/biome_rule_options/src/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/**/*.rs : Use `Box<[Box<str>]>` instead of `Vec<String>` for collections of strings in rule options to save memory
Applied to files:
crates/biome_rule_options/src/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Rule names should use the `use` prefix when the rule's sole intention is to mandate a single concept
Applied to files:
crates/biome_rule_options/src/use_input_name.rs.changeset/tangy-states-obey.mdcrates/biome_graphql_analyze/src/lint/nursery/use_input_name.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/**/*.rs : Distinguish between `TypeData::Unknown` and `TypeData::UnknownKeyword` to measure inference effectiveness versus explicit user-provided unknown types
Applied to files:
crates/biome_rule_options/src/use_input_name.rs
📚 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/tangy-states-obey.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/tangy-states-obey.md
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Use `declare_lint_rule!` macro with a `version` field set to `next` for new rules
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Rule names should use the `no` prefix when the rule's sole intention is to forbid a single concept
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Deprecated rules must include a `deprecated` field in the `declare_lint_rule!` macro with an explanation of what rule to use instead
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2025-12-31T15:35:32.899Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8639
File: crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs:101-108
Timestamp: 2025-12-31T15:35:32.899Z
Learning: In Rust lint rules under the nursery category, the issue_number field in declare_lint_rule! is optional and should not be added unless there is a compelling reason. In code reviews, verify that no unnecessary issue_number is included in nursery lint declarations. Only add issue_number if there is an explicit, justified reason (e.g., tracked issue for external observers). This guidance broadly applies to all nursery lint rule files, not just the single file.
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.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_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Use `rule_category!()` macro to refer to the diagnostic category instead of dynamically parsing its string name
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Use the `Semantic<T>` query type to access semantic information about bindings, references, and scope within a rule
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Implement the `action` function and add `fix_kind` metadata to the rule macro if the rule provides code actions
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Implement the `run` function to return `Option<Self::State>` or `Vec<Self::State>` (as `Box<[Self::State]>`) depending on whether the rule reports one or multiple signals
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Implement custom `Queryable` and `Visitor` types for rules that require deep inspection of child nodes to avoid inefficient traversals
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Use `p.eat(token)` for optional tokens, `p.expect(token)` for required tokens, `parse_rule(p).ok(p)` for optional nodes, and `parse_rule(p).or_add_diagnostic(p, error)` for required nodes
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
- GitHub Check: Documentation
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: End-to-end tests
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check Dependencies
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Test Node.js API
- GitHub Check: Check JS Files
- GitHub Check: autofix
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_graphql_formatter)
🔇 Additional comments (9)
crates/biome_graphql_analyze/src/lint/nursery/use_input_name.rs (4)
14-90: LGTM! Well-structured rule declaration.The rule metadata follows best practices: uses
useprefix appropriately, setsversion: "next", correctly omitsissue_numberfor nursery, and omitsfix_kindsince it only emits diagnostics. The documentation is comprehensive with clear examples and options.
173-215: Clean state enum implementation.Well-structured with clear diagnostic messages that provide actionable feedback to users.
217-240: Helper functions correctly handle type unwrapping.Properly handles nested GraphQL type wrappers (NonNull, List) to extract the underlying type name.
150-151: Critical logic error: case sensitivity check is inverted.The current condition always performs the case-insensitive check regardless of the
caseSensitiveInputTypeoption, making the option ineffective. WhencaseSensitiveInputTypeistrue, it should only perform case-sensitive comparison.🐛 Proposed fix
- if (case_sensitive_input_type && ty_string != valid_string) - || ty_string.to_lowercase_cow() != valid_string.to_lowercase_cow() + let mismatch = if case_sensitive_input_type { + ty_string != valid_string + } else { + ty_string.to_lowercase_cow() != valid_string.to_lowercase_cow() + }; + if mismatchLikely an incorrect or invalid review comment.
.changeset/tangy-states-obey.md (1)
1-13: Clear changeset description.The description accurately summarises the new rule, and the example demonstrates what code will now be flagged as invalid.
crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.options.json (1)
1-16: Test configuration looks correct.Properly enables both
checkInputTypeandcaseSensitiveInputTypefor testing the strict naming convention.crates/biome_graphql_analyze/tests/specs/nursery/useInputName/case-sensitive-input-type/valid.options.json (1)
1-16: Test configuration correct, but affected by logic bug.This configuration tests case-insensitive matching (
caseSensitiveInputType: false), but the implementation bug in the main rule file means this option doesn't work as intended. Once the bug is fixed, this test should function properly.crates/biome_graphql_analyze/tests/specs/nursery/useInputName/check-input-type/valid.graphql (1)
1-6: Comprehensive test coverage for valid cases.Tests correctly cover the mutation name + "Input" pattern with different type wrappers (optional, non-null, list).
crates/biome_rule_options/src/use_input_name.rs (1)
1-29: Excellent adherence to Biome conventions!This options struct correctly implements all the required patterns:
- Proper serde configuration with camelCase and strict validation
- Optional fields with skip_serializing_if
- All necessary derives including Deserializable and Merge
- Clean accessor methods with sensible defaults
Based on learnings, this follows established best practices for rule options in the biome_rule_options crate.
Summary
Port Eslint Graphql's
input-name, requiring a mutation input be named "input" & optionally match input type name with<mutation name>InputTest Plan
Added unit tests
Docs
https://the-guild.dev/graphql/eslint/rules/input-name