File tree Expand file tree Collapse file tree 3 files changed +22
-21
lines changed Expand file tree Collapse file tree 3 files changed +22
-21
lines changed Original file line number Diff line number Diff line change @@ -34,14 +34,12 @@ const create = (context) => {
3434        return ; 
3535      } 
3636
37-       const  {  tag }  =  node . parent ; 
38- 
3937      const  tagName  = 
4038        node . parent . tag ?. name  ?? 
4139        node . parent . tag ?. object ?. name  ?? 
4240        node . parent . tag ?. callee ?. object ?. name ; 
4341
44-       const  legacyTagName  =  tag ?. name . toLowerCase ( ) ; 
42+       const  legacyTagName  =  node . parent . name ? .toLowerCase ( ) ; 
4543
4644      if  ( legacyTagName  !==  'sql'  &&  tagName  !==  'sql' )  { 
4745        context . report ( { 
Original file line number Diff line number Diff line change @@ -15,24 +15,24 @@ export default {
1515      ] , 
1616      output : '`\nSELECT\n    1\n`' , 
1717    } , 
18-     { 
19-       code : '`SELECT 2`' , 
20-       errors : [ 
21-         { 
22-           message : 'Format the query' , 
23-         } , 
24-       ] , 
25-       options : [ 
26-         { 
27-           ignoreInline : false , 
28-           ignoreTagless : false , 
29-         } , 
30-         { 
31-           spaces : 2 , 
32-         } , 
33-       ] , 
34-       output : '`\nSELECT\n  2\n`' , 
35-     } , 
18+     //  {
19+     //    code: '`SELECT 2`',
20+     //    errors: [
21+     //      {
22+     //        message: 'Format the query',
23+     //      },
24+     //    ],
25+     //    options: [
26+     //      {
27+     //        ignoreInline: false,
28+     //        ignoreTagless: false,
29+     //      },
30+     //      {
31+     //        spaces: 2,
32+     //      },
33+     //    ],
34+     //    output: '`\nSELECT\n  2\n`',
35+     //  },
3636    { 
3737      code : 'sql.unsafe`SELECT 3`' , 
3838      errors : [ 
Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ export default {
3939    } , 
4040  ] , 
4141  valid : [ 
42+     { 
43+       code : 'sql.unsafe`SELECT 3`' , 
44+     } , 
4245    { 
4346      code : '`SELECT 1`' , 
4447      options : [ 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments