Skip to content

Commit

Permalink
fix(lint/useConsistentArrayType): move this unstable rule to nursery (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Conaclos authored Jan 9, 2024
1 parent d0d7aec commit 6473a2e
Show file tree
Hide file tree
Showing 25 changed files with 150 additions and 143 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom

#### Bug fixes

- [useConsistentArrayType](https://biomejs.dev/rules/use-consistent-array-type) was accidentally placed in the `style` rule group instead of the `nursery` group. It is now correctly placed under `nursery`.

- Fix [#1483](https://github.com/biomejs/biome/issues/1483). [useConsistentArrayType](https://biomejs.dev/rules/use-consistent-array-type) now correctly handles its option. Contributed by @Conaclos

### Parser
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: crates/biome_cli/tests/snap_test.rs
assertion_line: 388
expression: content
---
## `biome.json`
Expand Down Expand Up @@ -121,7 +120,6 @@ biome.json:9:13 deserialize ━━━━━━━━━━━━━━━━━
- useAsConstAssertion
- useBlockStatements
- useCollapsedElseIf
- useConsistentArrayType
- useConst
- useDefaultParameterLast
- useEnumInitializers
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_diagnostics_categories/src/categories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ define_categories! {
"lint/nursery/noUselessTernary": "https://biomejs.dev/linter/rules/no-useless-ternary",
"lint/nursery/useAwait": "https://biomejs.dev/linter/rules/use-await",
"lint/nursery/useBiomeSuppressionComment": "https://biomejs.dev/linter/rules/use-biome-suppression-comment",
"lint/nursery/useConsistentArrayType": "https://biomejs.dev/linter/rules/use-consistent-arrray-type",
"lint/nursery/useExportType": "https://biomejs.dev/linter/rules/use-export-type",
"lint/nursery/useFilenamingConvention": "https://biomejs.dev/linter/rules/use-filenaming-convention",
"lint/nursery/useForOf": "https://biomejs.dev/linter/rules/use-for-of",
Expand Down Expand Up @@ -149,7 +150,6 @@ define_categories! {
"lint/style/useAsConstAssertion": "https://biomejs.dev/linter/rules/use-as-const-assertion",
"lint/style/useBlockStatements": "https://biomejs.dev/linter/rules/use-block-statements",
"lint/style/useCollapsedElseIf": "https://biomejs.dev/linter/rules/use-collapsed-else-if",
"lint/style/useConsistentArrayType": "https://biomejs.dev/linter/rules/use-consistent-arrray-type",
"lint/style/useConst": "https://biomejs.dev/linter/rules/use-const",
"lint/style/useDefaultParameterLast": "https://biomejs.dev/linter/rules/use-default-parameter-last",
"lint/style/useEnumInitializers": "https://biomejs.dev/linter/rules/use-enum-initializers",
Expand Down
2 changes: 2 additions & 0 deletions crates/biome_js_analyze/src/analyzers/nursery.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions crates/biome_js_analyze/src/analyzers/style.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/biome_js_analyze/src/options.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! This module contains the rules that have options
use crate::analyzers::nursery::use_consistent_array_type::ConsistentArrayTypeOptions;
use crate::analyzers::nursery::use_filenaming_convention::FilenamingConventionOptions;
use crate::analyzers::style::use_consistent_array_type::ConsistentArrayTypeOptions;
use crate::semantic_analyzers::correctness::use_exhaustive_dependencies::HooksOptions;
use crate::semantic_analyzers::correctness::use_hook_at_top_level::DeprecatedHooksOptions;
use crate::semantic_analyzers::style::no_restricted_globals::RestrictedGlobalsOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let readonlyInvalid6: ReadonlyArray<ReadonlyArray<ReadonlyArray<number>>>;

# Diagnostics
```
invalid.ts:1:12 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.ts:1:12 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use shorthand T[] syntax instead of Array<T> syntax.
Expand All @@ -41,7 +41,7 @@ invalid.ts:1:12 lint/style/useConsistentArrayType FIXABLE ━━━━━━
```

```
invalid.ts:2:15 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.ts:2:15 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use shorthand T[] syntax instead of Array<T> syntax.
Expand All @@ -63,7 +63,7 @@ invalid.ts:2:15 lint/style/useConsistentArrayType FIXABLE ━━━━━━
```

```
invalid.ts:2:26 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.ts:2:26 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use shorthand T[] syntax instead of Array<T> syntax.
Expand All @@ -85,7 +85,7 @@ invalid.ts:2:26 lint/style/useConsistentArrayType FIXABLE ━━━━━━
```

```
invalid.ts:3:23 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.ts:3:23 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use shorthand T[] syntax instead of Array<T> syntax.
Expand All @@ -109,7 +109,7 @@ invalid.ts:3:23 lint/style/useConsistentArrayType FIXABLE ━━━━━━
```

```
invalid.ts:4:15 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.ts:4:15 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use shorthand T[] syntax instead of Array<T> syntax.
Expand All @@ -133,7 +133,7 @@ invalid.ts:4:15 lint/style/useConsistentArrayType FIXABLE ━━━━━━
```

```
invalid.ts:5:15 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.ts:5:15 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use shorthand T[] syntax instead of Array<T> syntax.
Expand All @@ -157,7 +157,7 @@ invalid.ts:5:15 lint/style/useConsistentArrayType FIXABLE ━━━━━━
```

```
invalid.ts:7:23 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.ts:7:23 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use shorthand readonly T[] syntax instead of ReadonlyArray<T> syntax.
Expand All @@ -181,7 +181,7 @@ invalid.ts:7:23 lint/style/useConsistentArrayType FIXABLE ━━━━━━
```

```
invalid.ts:8:31 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.ts:8:31 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use shorthand readonly T[] syntax instead of ReadonlyArray<T> syntax.
Expand All @@ -204,7 +204,7 @@ invalid.ts:8:31 lint/style/useConsistentArrayType FIXABLE ━━━━━━
```

```
invalid.ts:9:23 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.ts:9:23 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use shorthand readonly T[] syntax instead of ReadonlyArray<T> syntax.
Expand All @@ -228,7 +228,7 @@ invalid.ts:9:23 lint/style/useConsistentArrayType FIXABLE ━━━━━━
```

```
invalid.ts:10:23 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.ts:10:23 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use shorthand readonly T[] syntax instead of ReadonlyArray<T> syntax.
Expand All @@ -252,7 +252,7 @@ invalid.ts:10:23 lint/style/useConsistentArrayType FIXABLE ━━━━━━
```

```
invalid.ts:11:23 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.ts:11:23 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use shorthand readonly T[] syntax instead of ReadonlyArray<T> syntax.
Expand All @@ -276,7 +276,7 @@ invalid.ts:11:23 lint/style/useConsistentArrayType FIXABLE ━━━━━━
```

```
invalid.ts:11:37 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.ts:11:37 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use shorthand readonly T[] syntax instead of ReadonlyArray<T> syntax.
Expand All @@ -300,7 +300,7 @@ invalid.ts:11:37 lint/style/useConsistentArrayType FIXABLE ━━━━━━
```

```
invalid.ts:12:23 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.ts:12:23 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use shorthand readonly T[] syntax instead of ReadonlyArray<T> syntax.
Expand All @@ -322,7 +322,7 @@ invalid.ts:12:23 lint/style/useConsistentArrayType FIXABLE ━━━━━━
```

```
invalid.ts:12:37 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.ts:12:37 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use shorthand readonly T[] syntax instead of ReadonlyArray<T> syntax.
Expand All @@ -344,7 +344,7 @@ invalid.ts:12:37 lint/style/useConsistentArrayType FIXABLE ━━━━━━
```

```
invalid.ts:12:51 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.ts:12:51 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use shorthand readonly T[] syntax instead of ReadonlyArray<T> syntax.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"linter": {
"rules": {
"style": {
"nursery": {
"useConsistentArrayType": {
"level": "error",
"options": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let readonlyInvalid6: readonly (readonly (readonly number[])[])[];

# Diagnostics
```
invalidShorthand.ts:1:12 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalidShorthand.ts:1:12 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use Array<T> syntax instead of shorthand T[] syntax.
Expand All @@ -41,7 +41,7 @@ invalidShorthand.ts:1:12 lint/style/useConsistentArrayType FIXABLE ━━━
```

```
invalidShorthand.ts:2:26 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalidShorthand.ts:2:26 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use Array<T> syntax instead of shorthand T[] syntax.
Expand All @@ -63,7 +63,7 @@ invalidShorthand.ts:2:26 lint/style/useConsistentArrayType FIXABLE ━━━
```

```
invalidShorthand.ts:3:23 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalidShorthand.ts:3:23 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use Array<T> syntax instead of shorthand T[] syntax.
Expand All @@ -87,7 +87,7 @@ invalidShorthand.ts:3:23 lint/style/useConsistentArrayType FIXABLE ━━━
```

```
invalidShorthand.ts:4:15 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalidShorthand.ts:4:15 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use Array<T> syntax instead of shorthand T[] syntax.
Expand All @@ -111,7 +111,7 @@ invalidShorthand.ts:4:15 lint/style/useConsistentArrayType FIXABLE ━━━
```

```
invalidShorthand.ts:5:15 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalidShorthand.ts:5:15 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use Array<T> syntax instead of shorthand T[] syntax.
Expand All @@ -135,7 +135,7 @@ invalidShorthand.ts:5:15 lint/style/useConsistentArrayType FIXABLE ━━━
```

```
invalidShorthand.ts:7:23 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalidShorthand.ts:7:23 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use ReadonlyArray<T> syntax instead of shorthand readonly T[] syntax.
Expand All @@ -159,7 +159,7 @@ invalidShorthand.ts:7:23 lint/style/useConsistentArrayType FIXABLE ━━━
```

```
invalidShorthand.ts:8:31 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalidShorthand.ts:8:31 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use ReadonlyArray<T> syntax instead of shorthand readonly T[] syntax.
Expand All @@ -182,7 +182,7 @@ invalidShorthand.ts:8:31 lint/style/useConsistentArrayType FIXABLE ━━━
```

```
invalidShorthand.ts:9:23 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalidShorthand.ts:9:23 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use ReadonlyArray<T> syntax instead of shorthand readonly T[] syntax.
Expand All @@ -206,7 +206,7 @@ invalidShorthand.ts:9:23 lint/style/useConsistentArrayType FIXABLE ━━━
```

```
invalidShorthand.ts:10:23 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalidShorthand.ts:10:23 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use ReadonlyArray<T> syntax instead of shorthand readonly T[] syntax.
Expand All @@ -230,7 +230,7 @@ invalidShorthand.ts:10:23 lint/style/useConsistentArrayType FIXABLE ━━━
```

```
invalidShorthand.ts:11:23 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalidShorthand.ts:11:23 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use ReadonlyArray<T> syntax instead of shorthand readonly T[] syntax.
Expand All @@ -254,7 +254,7 @@ invalidShorthand.ts:11:23 lint/style/useConsistentArrayType FIXABLE ━━━
```

```
invalidShorthand.ts:11:33 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalidShorthand.ts:11:33 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use ReadonlyArray<T> syntax instead of shorthand readonly T[] syntax.
Expand All @@ -278,7 +278,7 @@ invalidShorthand.ts:11:33 lint/style/useConsistentArrayType FIXABLE ━━━
```

```
invalidShorthand.ts:12:23 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalidShorthand.ts:12:23 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use ReadonlyArray<T> syntax instead of shorthand readonly T[] syntax.
Expand All @@ -300,7 +300,7 @@ invalidShorthand.ts:12:23 lint/style/useConsistentArrayType FIXABLE ━━━
```

```
invalidShorthand.ts:12:33 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalidShorthand.ts:12:33 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use ReadonlyArray<T> syntax instead of shorthand readonly T[] syntax.
Expand All @@ -322,7 +322,7 @@ invalidShorthand.ts:12:33 lint/style/useConsistentArrayType FIXABLE ━━━
```

```
invalidShorthand.ts:12:43 lint/style/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalidShorthand.ts:12:43 lint/nursery/useConsistentArrayType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Use ReadonlyArray<T> syntax instead of shorthand readonly T[] syntax.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"linter": {
"rules": {
"style": {
"nursery": {
"useConsistentArrayType": {
"level": "error",
"options": {
Expand Down
Loading

0 comments on commit 6473a2e

Please sign in to comment.