Skip to content

Commit 9b6685b

Browse files
fix(analyzer): some rules panicked (#9255)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 841f8e9 commit 9b6685b

File tree

8 files changed

+19
-7
lines changed

8 files changed

+19
-7
lines changed

.changeset/ninety-wombats-run.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@biomejs/biome": patch
3+
---
4+
5+
Fixed [`#9234`](https://github.com/biomejs/biome/issues/9234), where some nursery rules panicked when they were configured with the option `level` without the corresponding `options`.

crates/biome_html_analyze/src/lint/a11y/no_header_scope.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use biome_console::markup;
44
use biome_diagnostics::Severity;
55
use biome_html_syntax::{AnyHtmlElement, HtmlAttribute};
66
use biome_rowan::{AstNode, BatchMutationExt};
7+
use biome_rule_options::no_header_scope::NoHeaderScopeOptions;
78

89
use crate::HtmlRuleAction;
910

@@ -52,7 +53,7 @@ impl Rule for NoHeaderScope {
5253
type Query = Ast<AnyHtmlElement>;
5354
type State = HtmlAttribute;
5455
type Signals = Option<Self::State>;
55-
type Options = ();
56+
type Options = NoHeaderScopeOptions;
5657

5758
fn run(ctx: &RuleContext<Self>) -> Self::Signals {
5859
let element = ctx.query();

crates/biome_html_analyze/src/lint/a11y/no_positive_tabindex.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use biome_console::markup;
44
use biome_diagnostics::Severity;
55
use biome_html_syntax::{AnyHtmlElement, HtmlAttribute};
66
use biome_rowan::{AstNode, BatchMutationExt, TextRange};
7+
use biome_rule_options::no_positive_tabindex::NoPositiveTabindexOptions;
78

89
use crate::HtmlRuleAction;
910

@@ -58,7 +59,7 @@ impl Rule for NoPositiveTabindex {
5859
type Query = Ast<AnyHtmlElement>;
5960
type State = NoPositiveTabindexState;
6061
type Signals = Option<Self::State>;
61-
type Options = ();
62+
type Options = NoPositiveTabindexOptions;
6263

6364
fn run(ctx: &RuleContext<Self>) -> Self::Signals {
6465
let element = ctx.query();

crates/biome_html_analyze/src/lint/a11y/use_anchor_content.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use biome_html_syntax::{
77
AnyHtmlContent, AnyHtmlElement, HtmlAttribute, HtmlElementList, HtmlFileSource,
88
};
99
use biome_rowan::{AstNode, BatchMutationExt};
10+
use biome_rule_options::use_anchor_content::UseAnchorContentOptions;
1011

1112
use crate::HtmlRuleAction;
1213
use crate::a11y::{
@@ -97,7 +98,7 @@ impl Rule for UseAnchorContent {
9798
type Query = Ast<AnyHtmlElement>;
9899
type State = UseAnchorContentState;
99100
type Signals = Option<Self::State>;
100-
type Options = ();
101+
type Options = UseAnchorContentOptions;
101102

102103
fn run(ctx: &RuleContext<Self>) -> Self::Signals {
103104
let node = ctx.query();

crates/biome_html_analyze/src/lint/a11y/use_media_caption.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use biome_console::markup;
55
use biome_diagnostics::Severity;
66
use biome_html_syntax::{AnyHtmlElement, HtmlElementList, HtmlFileSource};
77
use biome_rowan::AstNode;
8+
use biome_rule_options::use_media_caption::UseMediaCaptionOptions;
89

910
declare_lint_rule! {
1011
/// Enforces that `audio` and `video` elements must have a `track` for captions.
@@ -71,7 +72,7 @@ impl Rule for UseMediaCaption {
7172
type Query = Ast<AnyHtmlElement>;
7273
type State = ();
7374
type Signals = Option<Self::State>;
74-
type Options = ();
75+
type Options = UseMediaCaptionOptions;
7576

7677
fn run(ctx: &RuleContext<Self>) -> Self::Signals {
7778
let node = ctx.query();

crates/biome_js_analyze/src/lint/correctness/no_vue_setup_props_reactivity_loss.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use biome_js_syntax::{
1010
JsObjectMemberList, JsParameters,
1111
};
1212
use biome_rowan::{AstNode, AstSeparatedList, TextRange};
13+
use biome_rule_options::no_vue_setup_props_reactivity_loss::NoVueSetupPropsReactivityLossOptions;
1314

1415
declare_lint_rule! {
1516
/// Disallow destructuring of `props` passed to `setup` in Vue projects.
@@ -68,7 +69,7 @@ impl Rule for NoVueSetupPropsReactivityLoss {
6869
type Query = VueComponentQuery;
6970
type State = Violation;
7071
type Signals = Vec<Self::State>;
71-
type Options = ();
72+
type Options = NoVueSetupPropsReactivityLossOptions;
7273

7374
fn run(ctx: &RuleContext<Self>) -> Self::Signals {
7475
match ctx.query() {

crates/biome_js_analyze/src/lint/nursery/no_misused_promises.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use biome_js_syntax::{
99
};
1010
use biome_js_type_info::{Type, TypeMemberKind};
1111
use biome_rowan::{AstNode, AstSeparatedList, BatchMutationExt, TriviaPieceKind};
12+
use biome_rule_options::no_misused_promises::NoMisusedPromisesOptions;
1213

1314
use crate::{JsRuleAction, ast_utils::is_in_async_function, services::typed::Typed};
1415

@@ -103,7 +104,7 @@ impl Rule for NoMisusedPromises {
103104
type Query = Typed<AnyJsExpression>;
104105
type State = NoMisusedPromisesState;
105106
type Signals = Option<Self::State>;
106-
type Options = ();
107+
type Options = NoMisusedPromisesOptions;
107108

108109
fn run(ctx: &RuleContext<Self>) -> Self::Signals {
109110
let expression = ctx.query();

crates/biome_js_analyze/src/lint/nursery/no_parameters_only_used_in_recursion.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use biome_js_syntax::{
1010
JsVariableDeclarator, binding_ext::AnyJsParameterParentFunction, function_ext::AnyFunctionLike,
1111
};
1212
use biome_rowan::{AstNode, BatchMutationExt, TokenText};
13+
use biome_rule_options::no_parameters_only_used_in_recursion::NoParametersOnlyUsedInRecursionOptions;
1314

1415
declare_lint_rule! {
1516
/// Disallow function parameters that are only used in recursive calls.
@@ -98,7 +99,7 @@ impl Rule for NoParametersOnlyUsedInRecursion {
9899
type Query = Semantic<JsIdentifierBinding>;
99100
type State = ();
100101
type Signals = Option<Self::State>;
101-
type Options = ();
102+
type Options = NoParametersOnlyUsedInRecursionOptions;
102103

103104
fn run(ctx: &RuleContext<Self>) -> Self::Signals {
104105
let binding = ctx.query();

0 commit comments

Comments
 (0)