Skip to content

Commit

Permalink
fix: egression in useValidAutocomplete/valid.jsx.snap
Browse files Browse the repository at this point in the history
  • Loading branch information
ryo-ebata committed Jul 9, 2024
1 parent d6f4ad3 commit 08adc60
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions crates/biome_js_analyze/src/lint/nursery/use_valid_autocomplete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ impl Rule for UseValidAutocomplete {
let _initializer = autocomplete.initializer()?;
let extract_attrs = ctx.extract_attributes(&attributes)?;
let autocomplete_values = extract_attrs.get("autocomplete")?;
if let Some(f) = autocomplete_values.first() {
if f == "[DYNAMIC]" || f == "none" {
return None;
}
}
if is_valid_autocomplete(autocomplete_values)? {
return None;
}
Expand All @@ -181,6 +186,11 @@ impl Rule for UseValidAutocomplete {
let _initializer = autocomplete.initializer()?;
let extract_attrs = ctx.extract_attributes(&attributes)?;
let autocomplete_values = extract_attrs.get("autocomplete")?;
if let Some(f) = autocomplete_values.first() {
if f == "[DYNAMIC]" || f == "none" {
return None;
}
}
if is_valid_autocomplete(autocomplete_values)? {
return None;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_js_analyze/src/services/aria.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl AriaServices {
.collect::<Vec<String>>()
} else {
// handle dynamic values e.g. `<div onClick={dynamicValue}>`
vec![initializer.syntax().text_trimmed().to_string()]
vec!["[DYNAMIC]".to_string()]
}
} else {
vec!["true".to_string()]
Expand Down

0 comments on commit 08adc60

Please sign in to comment.