File tree Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -1621,7 +1621,8 @@ impl RuleRunner for crate::rules::react::jsx_no_target_blank::JsxNoTargetBlank {
16211621}
16221622
16231623impl RuleRunner for crate :: rules:: react:: jsx_no_undef:: JsxNoUndef {
1624- const NODE_TYPES : Option < & AstTypesBitset > = None ;
1624+ const NODE_TYPES : Option < & AstTypesBitset > =
1625+ Some ( & AstTypesBitset :: from_types ( & [ AstType :: JSXOpeningElement ] ) ) ;
16251626}
16261627
16271628impl RuleRunner for crate :: rules:: react:: jsx_no_useless_fragment:: JsxNoUselessFragment {
Original file line number Diff line number Diff line change @@ -66,18 +66,18 @@ fn get_member_ident<'a>(
6666
6767impl Rule for JsxNoUndef {
6868 fn run < ' a > ( & self , node : & AstNode < ' a > , ctx : & LintContext < ' a > ) {
69- if let AstKind :: JSXOpeningElement ( elem) = & node. kind ( ) {
70- if let Some ( ident) = get_resolvable_ident ( & elem. name ) {
71- let reference = ctx. scoping ( ) . get_reference ( ident. reference_id ( ) ) ;
72- if reference. symbol_id ( ) . is_some ( ) {
73- return ;
74- }
75- let name = ident. name . as_str ( ) ;
76- if ctx. globals ( ) . is_enabled ( name) {
77- return ;
78- }
79- ctx. diagnostic ( jsx_no_undef_diagnostic ( name, ident. span ) ) ;
69+ let AstKind :: JSXOpeningElement ( elem) = node. kind ( ) else { return } ;
70+
71+ if let Some ( ident) = get_resolvable_ident ( & elem. name ) {
72+ let reference = ctx. scoping ( ) . get_reference ( ident. reference_id ( ) ) ;
73+ if reference. symbol_id ( ) . is_some ( ) {
74+ return ;
75+ }
76+ let name = ident. name . as_str ( ) ;
77+ if ctx. globals ( ) . is_enabled ( name) {
78+ return ;
8079 }
80+ ctx. diagnostic ( jsx_no_undef_diagnostic ( name, ident. span ) ) ;
8181 }
8282 }
8383
You can’t perform that action at this time.
0 commit comments