Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(linter): false positive in jsx-a11y/iframe-has-title #7253

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading