Skip to content

Commit 3cf20eb

Browse files
authored
chore(linter): rename useExplicitFunctionReturnType to `useExplicit… (#4261)
1 parent 773f5b0 commit 3cf20eb

File tree

16 files changed

+41
-43
lines changed

16 files changed

+41
-43
lines changed

crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs

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

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3401,8 +3401,7 @@ pub struct Nursery {
34013401
Option<RuleConfiguration<biome_graphql_analyze::options::UseDeprecatedReason>>,
34023402
#[doc = "Require explicit return types on functions and class methods."]
34033403
#[serde(skip_serializing_if = "Option::is_none")]
3404-
pub use_explicit_function_return_type:
3405-
Option<RuleConfiguration<biome_js_analyze::options::UseExplicitFunctionReturnType>>,
3404+
pub use_explicit_type: Option<RuleConfiguration<biome_js_analyze::options::UseExplicitType>>,
34063405
#[doc = "Require for-in loops to include an if statement."]
34073406
#[serde(skip_serializing_if = "Option::is_none")]
34083407
pub use_guard_for_in: Option<RuleConfiguration<biome_js_analyze::options::UseGuardForIn>>,
@@ -3478,7 +3477,7 @@ impl Nursery {
34783477
"useConsistentCurlyBraces",
34793478
"useConsistentMemberAccessibility",
34803479
"useDeprecatedReason",
3481-
"useExplicitFunctionReturnType",
3480+
"useExplicitType",
34823481
"useGuardForIn",
34833482
"useImportRestrictions",
34843483
"useSortedClasses",
@@ -3750,7 +3749,7 @@ impl Nursery {
37503749
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[34]));
37513750
}
37523751
}
3753-
if let Some(rule) = self.use_explicit_function_return_type.as_ref() {
3752+
if let Some(rule) = self.use_explicit_type.as_ref() {
37543753
if rule.is_enabled() {
37553754
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[35]));
37563755
}
@@ -3964,7 +3963,7 @@ impl Nursery {
39643963
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[34]));
39653964
}
39663965
}
3967-
if let Some(rule) = self.use_explicit_function_return_type.as_ref() {
3966+
if let Some(rule) = self.use_explicit_type.as_ref() {
39683967
if rule.is_disabled() {
39693968
index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[35]));
39703969
}
@@ -4175,8 +4174,8 @@ impl Nursery {
41754174
.use_deprecated_reason
41764175
.as_ref()
41774176
.map(|conf| (conf.level(), conf.get_options())),
4178-
"useExplicitFunctionReturnType" => self
4179-
.use_explicit_function_return_type
4177+
"useExplicitType" => self
4178+
.use_explicit_type
41804179
.as_ref()
41814180
.map(|conf| (conf.level(), conf.get_options())),
41824181
"useGuardForIn" => self

crates/biome_diagnostics_categories/src/categories.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ define_categories! {
189189
"lint/nursery/useConsistentCurlyBraces": "https://biomejs.dev/linter/rules/use-consistent-curly-braces",
190190
"lint/nursery/useConsistentMemberAccessibility": "https://biomejs.dev/linter/rules/use-consistent-member-accessibility",
191191
"lint/nursery/useDeprecatedReason": "https://biomejs.dev/linter/rules/use-deprecated-reason",
192-
"lint/nursery/useExplicitFunctionReturnType": "https://biomejs.dev/linter/rules/use-explicit-function-return-type",
192+
"lint/nursery/useExplicitType": "https://biomejs.dev/linter/rules/use-explicit-function-return-type",
193193
"lint/nursery/useGuardForIn": "https://biomejs.dev/linter/rules/use-guard-for-in",
194194
"lint/nursery/useImportRestrictions": "https://biomejs.dev/linter/rules/use-import-restrictions",
195195
"lint/nursery/useJsxCurlyBraceConvention": "https://biomejs.dev/linter/rules/use-jsx-curly-brace-convention",

crates/biome_js_analyze/src/lint/nursery.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub mod use_at_index;
2828
pub mod use_component_export_only_modules;
2929
pub mod use_consistent_curly_braces;
3030
pub mod use_consistent_member_accessibility;
31-
pub mod use_explicit_function_return_type;
31+
pub mod use_explicit_type;
3232
pub mod use_guard_for_in;
3333
pub mod use_import_restrictions;
3434
pub mod use_sorted_classes;
@@ -66,7 +66,7 @@ declare_lint_group! {
6666
self :: use_component_export_only_modules :: UseComponentExportOnlyModules ,
6767
self :: use_consistent_curly_braces :: UseConsistentCurlyBraces ,
6868
self :: use_consistent_member_accessibility :: UseConsistentMemberAccessibility ,
69-
self :: use_explicit_function_return_type :: UseExplicitFunctionReturnType ,
69+
self :: use_explicit_type :: UseExplicitType ,
7070
self :: use_guard_for_in :: UseGuardForIn ,
7171
self :: use_import_restrictions :: UseImportRestrictions ,
7272
self :: use_sorted_classes :: UseSortedClasses ,

crates/biome_js_analyze/src/lint/nursery/use_explicit_function_return_type.rs renamed to crates/biome_js_analyze/src/lint/nursery/use_explicit_type.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ declare_lint_rule! {
202202
/// }
203203
/// ```
204204
///
205-
pub UseExplicitFunctionReturnType {
205+
pub UseExplicitType {
206206
version: "1.9.3",
207-
name: "useExplicitFunctionReturnType",
207+
name: "useExplicitType",
208208
language: "ts",
209209
recommended: false,
210210
sources: &[RuleSource::EslintTypeScript("explicit-function-return-type")],
@@ -215,7 +215,7 @@ declare_node_union! {
215215
pub AnyJsFunctionWithReturnType = AnyJsFunction | JsMethodClassMember | JsMethodObjectMember | JsGetterClassMember | JsGetterObjectMember
216216
}
217217

218-
impl Rule for UseExplicitFunctionReturnType {
218+
impl Rule for UseExplicitType {
219219
type Query = Ast<AnyJsFunctionWithReturnType>;
220220
type State = TextRange;
221221
type Signals = Option<Self::State>;

crates/biome_js_analyze/src/options.rs

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const x = { bar: { prop: () => {} } }
103103

104104
# Diagnostics
105105
```
106-
invalid.ts:1:1 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
106+
invalid.ts:1:1 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
107107
108108
! Missing return type on function.
109109
@@ -120,7 +120,7 @@ invalid.ts:1:1 lint/nursery/useExplicitFunctionReturnType ━━━━━━━
120120
```
121121

122122
```
123-
invalid.ts:3:2 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
123+
invalid.ts:3:2 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
124124
125125
! Missing return type on function.
126126
@@ -142,7 +142,7 @@ invalid.ts:3:2 lint/nursery/useExplicitFunctionReturnType ━━━━━━━
142142
```
143143

144144
```
145-
invalid.ts:9:10 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
145+
invalid.ts:9:10 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
146146
147147
! Missing return type on function.
148148
@@ -164,7 +164,7 @@ invalid.ts:9:10 lint/nursery/useExplicitFunctionReturnType ━━━━━━━
164164
```
165165

166166
```
167-
invalid.ts:13:15 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
167+
invalid.ts:13:15 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
168168
169169
! Missing return type on function.
170170
@@ -183,7 +183,7 @@ invalid.ts:13:15 lint/nursery/useExplicitFunctionReturnType ━━━━━━
183183
```
184184
185185
```
186-
invalid.ts:17:2 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
186+
invalid.ts:17:2 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
187187
188188
! Missing return type on function.
189189
@@ -205,7 +205,7 @@ invalid.ts:17:2 lint/nursery/useExplicitFunctionReturnType ━━━━━━━
205205
```
206206
207207
```
208-
invalid.ts:21:2 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
208+
invalid.ts:21:2 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
209209
210210
! Missing return type on function.
211211
@@ -227,7 +227,7 @@ invalid.ts:21:2 lint/nursery/useExplicitFunctionReturnType ━━━━━━━
227227
```
228228
229229
```
230-
invalid.ts:24:10 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
230+
invalid.ts:24:10 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
231231
232232
! Missing return type on function.
233233
@@ -246,7 +246,7 @@ invalid.ts:24:10 lint/nursery/useExplicitFunctionReturnType ━━━━━━
246246
```
247247
248248
```
249-
invalid.ts:25:2 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
249+
invalid.ts:25:2 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
250250
251251
! Missing return type on function.
252252
@@ -268,7 +268,7 @@ invalid.ts:25:2 lint/nursery/useExplicitFunctionReturnType ━━━━━━━
268268
```
269269
270270
```
271-
invalid.ts:31:2 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
271+
invalid.ts:31:2 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
272272
273273
! Missing return type on function.
274274
@@ -289,7 +289,7 @@ invalid.ts:31:2 lint/nursery/useExplicitFunctionReturnType ━━━━━━━
289289
```
290290
291291
```
292-
invalid.ts:37:3 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
292+
invalid.ts:37:3 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
293293
294294
! Missing return type on function.
295295
@@ -310,7 +310,7 @@ invalid.ts:37:3 lint/nursery/useExplicitFunctionReturnType ━━━━━━━
310310
```
311311
312312
```
313-
invalid.ts:42:14 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
313+
invalid.ts:42:14 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
314314
315315
! Missing return type on function.
316316
@@ -329,7 +329,7 @@ invalid.ts:42:14 lint/nursery/useExplicitFunctionReturnType ━━━━━━
329329
```
330330

331331
```
332-
invalid.ts:43:14 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
332+
invalid.ts:43:14 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
333333
334334
! Missing return type on function.
335335
@@ -347,7 +347,7 @@ invalid.ts:43:14 lint/nursery/useExplicitFunctionReturnType ━━━━━━
347347
```
348348

349349
```
350-
invalid.ts:45:16 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
350+
invalid.ts:45:16 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
351351
352352
! Missing return type on function.
353353
@@ -366,7 +366,7 @@ invalid.ts:45:16 lint/nursery/useExplicitFunctionReturnType ━━━━━━
366366
```
367367

368368
```
369-
invalid.ts:46:16 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
369+
invalid.ts:46:16 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
370370
371371
! Missing return type on function.
372372
@@ -384,7 +384,7 @@ invalid.ts:46:16 lint/nursery/useExplicitFunctionReturnType ━━━━━━
384384
```
385385

386386
```
387-
invalid.ts:49:23 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
387+
invalid.ts:49:23 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
388388
389389
! Missing return type on function.
390390
@@ -402,7 +402,7 @@ invalid.ts:49:23 lint/nursery/useExplicitFunctionReturnType ━━━━━━
402402
```
403403
404404
```
405-
invalid.ts:50:23 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
405+
invalid.ts:50:23 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
406406
407407
! Missing return type on function.
408408
@@ -421,7 +421,7 @@ invalid.ts:50:23 lint/nursery/useExplicitFunctionReturnType ━━━━━━
421421
```
422422
423423
```
424-
invalid.ts:52:10 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
424+
invalid.ts:52:10 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
425425
426426
! Missing return type on function.
427427
@@ -440,7 +440,7 @@ invalid.ts:52:10 lint/nursery/useExplicitFunctionReturnType ━━━━━━
440440
```
441441
442442
```
443-
invalid.ts:57:17 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
443+
invalid.ts:57:17 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
444444
445445
! Missing return type on function.
446446
@@ -464,7 +464,7 @@ invalid.ts:57:17 lint/nursery/useExplicitFunctionReturnType ━━━━━━
464464
```
465465
466466
```
467-
invalid.ts:66:17 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
467+
invalid.ts:66:17 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
468468
469469
! Missing return type on function.
470470
@@ -488,7 +488,7 @@ invalid.ts:66:17 lint/nursery/useExplicitFunctionReturnType ━━━━━━
488488
```
489489
490490
```
491-
invalid.ts:78:2 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
491+
invalid.ts:78:2 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
492492
493493
! Missing return type on function.
494494
@@ -510,7 +510,7 @@ invalid.ts:78:2 lint/nursery/useExplicitFunctionReturnType ━━━━━━━
510510
```
511511
512512
```
513-
invalid.ts:85:2 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
513+
invalid.ts:85:2 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
514514
515515
! Missing return type on function.
516516
@@ -532,7 +532,7 @@ invalid.ts:85:2 lint/nursery/useExplicitFunctionReturnType ━━━━━━━
532532
```
533533
534534
```
535-
invalid.ts:94:19 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
535+
invalid.ts:94:19 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
536536
537537
! Missing return type on function.
538538
@@ -550,7 +550,7 @@ invalid.ts:94:19 lint/nursery/useExplicitFunctionReturnType ━━━━━━
550550
```
551551
552552
```
553-
invalid.ts:95:26 lint/nursery/useExplicitFunctionReturnType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
553+
invalid.ts:95:26 lint/nursery/useExplicitType ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
554554
555555
! Missing return type on function.
556556

packages/@biomejs/backend-jsonrpc/src/workspace.ts

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

packages/@biomejs/biome/configuration_schema.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)