Skip to content

Commit ec179b6

Browse files
committed
refactor: rename to useUniqueGraphqlOperationName
1 parent 20b0987 commit ec179b6

File tree

13 files changed

+103
-93
lines changed

13 files changed

+103
-93
lines changed

.changeset/rich-memes-sleep.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"@biomejs/biome": patch
33
---
44

5-
Added the GraphQL nursery rule [`uniqueOperationName`](https://biomejs.dev/linter/rules/unique-operation-name). This rule ensures that all GraphQL operations within a document have unique names.
5+
Added the GraphQL nursery rule [`useUniqueGraphqlOperationName`](https://biomejs.dev/linter/rules/use-unique-graphql-operation-name). This rule ensures that all GraphQL operations within a document have unique names.
66

77
**Invalid:**
88
```graphql

crates/biome_configuration/src/analyzer/linter/rules.rs

Lines changed: 29 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/biome_diagnostics_categories/src/categories.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ define_categories! {
192192
"lint/nursery/noVueDuplicateKeys": "https://biomejs.dev/linter/rules/no-vue-duplicate-keys",
193193
"lint/nursery/noVueReservedKeys": "https://biomejs.dev/linter/rules/no-vue-reserved-keys",
194194
"lint/nursery/noVueReservedProps": "https://biomejs.dev/linter/rules/no-vue-reserved-props",
195-
"lint/nursery/uniqueOperationName": "https://biomejs.dev/linter/rules/unique-operation-name",
196195
"lint/nursery/useAnchorHref": "https://biomejs.dev/linter/rules/use-anchor-href",
197196
"lint/nursery/useBiomeSuppressionComment": "https://biomejs.dev/linter/rules/use-biome-suppression-comment",
198197
"lint/nursery/useConsistentArrowReturn": "https://biomejs.dev/linter/rules/use-consistent-arrow-return",
@@ -207,6 +206,7 @@ define_categories! {
207206
"lint/nursery/useQwikMethodUsage": "https://biomejs.dev/linter/rules/use-qwik-method-usage",
208207
"lint/nursery/useQwikValidLexicalScope": "https://biomejs.dev/linter/rules/use-qwik-valid-lexical-scope",
209208
"lint/nursery/useSortedClasses": "https://biomejs.dev/linter/rules/use-sorted-classes",
209+
"lint/nursery/useUniqueGraphqlOperationName": "https://biomejs.dev/linter/rules/use-unique-graphql-operation-name",
210210
"lint/nursery/useVueDefineMacrosOrder": "https://biomejs.dev/linter/rules/use-vue-define-macros-order",
211211
"lint/nursery/useVueMultiWordComponentNames": "https://biomejs.dev/linter/rules/use-vue-multi-word-component-names",
212212
"lint/performance/noAccumulatingSpread": "https://biomejs.dev/linter/rules/no-accumulating-spread",

crates/biome_graphql_analyze/src/lint/nursery.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
55
use biome_analyze::declare_lint_group;
66
pub mod no_empty_source;
7-
pub mod unique_operation_name;
87
pub mod use_deprecated_date;
9-
declare_lint_group! { pub Nursery { name : "nursery" , rules : [self :: no_empty_source :: NoEmptySource , self :: unique_operation_name :: UniqueOperationName , self :: use_deprecated_date :: UseDeprecatedDate ,] } }
8+
pub mod use_unique_graphql_operation_name;
9+
declare_lint_group! { pub Nursery { name : "nursery" , rules : [self :: no_empty_source :: NoEmptySource , self :: use_deprecated_date :: UseDeprecatedDate , self :: use_unique_graphql_operation_name :: UseUniqueGraphqlOperationName ,] } }

crates/biome_graphql_analyze/src/lint/nursery/unique_operation_name.rs renamed to crates/biome_graphql_analyze/src/lint/nursery/use_unique_graphql_operation_name.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use biome_analyze::{
44
use biome_console::markup;
55
use biome_graphql_syntax::GraphqlRoot;
66
use biome_rowan::{AstNode, TextRange, TokenText};
7-
use biome_rule_options::unique_operation_name::UniqueOperationNameOptions;
7+
use biome_rule_options::use_unique_graphql_operation_name::UseUniqueGraphqlOperationNameOptions;
88
use rustc_hash::FxHashMap;
99

1010
declare_lint_rule! {
@@ -47,9 +47,9 @@ declare_lint_rule! {
4747
/// }
4848
/// ```
4949
///
50-
pub UniqueOperationName {
50+
pub UseUniqueGraphqlOperationName {
5151
version: "next",
52-
name: "uniqueOperationName",
52+
name: "useUniqueGraphqlOperationName",
5353
language: "graphql",
5454
recommended: false,
5555
sources: &[RuleSource::EslintGraphql("unique-operation-name").inspired()],
@@ -61,11 +61,11 @@ pub struct DuplicateOperationName {
6161
text_range: TextRange,
6262
}
6363

64-
impl Rule for UniqueOperationName {
64+
impl Rule for UseUniqueGraphqlOperationName {
6565
type Query = Ast<GraphqlRoot>;
6666
type State = DuplicateOperationName;
6767
type Signals = Box<[Self::State]>;
68-
type Options = UniqueOperationNameOptions;
68+
type Options = UseUniqueGraphqlOperationNameOptions;
6969

7070
fn run(ctx: &RuleContext<Self>) -> Self::Signals {
7171
let root = ctx.query();

crates/biome_graphql_analyze/tests/specs/nursery/uniqueOperationName/invalid.graphql.snap renamed to crates/biome_graphql_analyze/tests/specs/nursery/useUniqueGraphqlOperationName/invalid.graphql.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ mutation updateUser {
3838

3939
# Diagnostics
4040
```
41-
invalid.graphql:7:1 lint/nursery/uniqueOperationName ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
41+
invalid.graphql:7:1 lint/nursery/useUniqueGraphqlOperationName ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4242
4343
i Operation named "user" is already defined.
4444
@@ -62,7 +62,7 @@ invalid.graphql:7:1 lint/nursery/uniqueOperationName ━━━━━━━━━
6262
```
6363
6464
```
65-
invalid.graphql:19:1 lint/nursery/uniqueOperationName ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
65+
invalid.graphql:19:1 lint/nursery/useUniqueGraphqlOperationName ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6666
6767
i Operation named "updateUser" is already defined.
6868
@@ -86,7 +86,7 @@ invalid.graphql:19:1 lint/nursery/uniqueOperationName ━━━━━━━━
8686
```
8787
8888
```
89-
invalid.graphql:25:1 lint/nursery/uniqueOperationName ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
89+
invalid.graphql:25:1 lint/nursery/useUniqueGraphqlOperationName ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
9090
9191
i Operation named "updateUser" is already defined.
9292

crates/biome_rule_options/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ pub mod no_vue_reserved_props;
248248
pub mod no_with;
249249
pub mod no_yoda_expression;
250250
pub mod organize_imports;
251-
pub mod unique_operation_name;
252251
pub mod use_adjacent_overload_signatures;
253252
pub mod use_alt_text;
254253
pub mod use_anchor_content;
@@ -361,6 +360,7 @@ pub mod use_top_level_regex;
361360
pub mod use_trim_start_end;
362361
pub mod use_unified_type_signatures;
363362
pub mod use_unique_element_ids;
363+
pub mod use_unique_graphql_operation_name;
364364
pub mod use_valid_anchor;
365365
pub mod use_valid_aria_props;
366366
pub mod use_valid_aria_role;

0 commit comments

Comments
 (0)