Skip to content

Commit

Permalink
fix(linter): false positive in jsx-a11y/iframe-has-title (#7253)
Browse files Browse the repository at this point in the history
closes #7243
  • Loading branch information
shulaoda authored and Dunqing committed Nov 17, 2024
1 parent 71a2a03 commit 6b8b96b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/oxc_linter/src/rules/jsx_a11y/iframe_has_title.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ impl Rule for IframeHasTitle {
return;
}
}
JSXExpression::CallExpression(_) => {
return;
}
expr @ JSXExpression::Identifier(_) => {
if !expr.is_undefined() {
return;
Expand All @@ -124,6 +127,7 @@ fn test() {
(r"<iframe title='Unique title' />", None, None),
(r"<iframe title={foo} />", None, None),
(r"<FooComponent />", None, None),
(r"<iframe title={titleGenerator('hello')} />", None, None),
// CUSTOM ELEMENT TESTS FOR COMPONENTS SETTINGS
(
r"<FooComponent title='Unique title' />",
Expand Down

0 comments on commit 6b8b96b

Please sign in to comment.