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

closes #7243
This commit is contained in:
dalaoshu 2024-11-12 21:14:50 +08:00 committed by GitHub
parent 44375a5662
commit ef847dab9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -99,6 +99,9 @@ impl Rule for IframeHasTitle {
return;
}
}
JSXExpression::CallExpression(_) => {
return;
}
expr @ JSXExpression::Identifier(_) => {
if !expr.is_undefined() {
return;
@ -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' />",