@@ -79,11 +79,7 @@ const _getImports = (context: RuleContext<any, any>) => {
7979
8080const getImports = ( context : RuleContext < any , any > ) => {
8181 const imports = _getImports ( context )
82- try {
83- return imports . filter ( ( imp ) => syncAction ( 'matchImports' , getSyncOpts ( context ) , imp ) )
84- } catch ( error ) {
85- return [ ]
86- }
82+ return imports . filter ( ( imp ) => syncAction ( 'matchImports' , getSyncOpts ( context ) , imp ) )
8783}
8884
8985const isValidStyledProp = < T extends Node | string > ( node : T , context : RuleContext < any , any > ) => {
@@ -156,7 +152,7 @@ export const isPandaProp = (node: TSESTree.JSXAttribute, context: RuleContext<an
156152 return true
157153}
158154
159- export const isStyledNode = ( node : TSESTree . Property , context : RuleContext < any , any > , calleeName ?: string ) => {
155+ export const isStyledProperty = ( node : TSESTree . Property , context : RuleContext < any , any > , calleeName ?: string ) => {
160156 if ( ! isIdentifier ( node . key ) && ! isLiteral ( node . key ) && ! isTemplateLiteral ( node . key ) ) return
161157
162158 if ( isIdentifier ( node . key ) && ! isValidProperty ( node . key . name , context , calleeName ) ) return
@@ -167,20 +163,9 @@ export const isStyledNode = (node: TSESTree.Property, context: RuleContext<any,
167163 )
168164 return
169165 if ( isTemplateLiteral ( node . key ) && ! isValidProperty ( node . key . quasis [ 0 ] . value . raw , context , calleeName ) ) return
170-
171166 return true
172167}
173168
174- export const isStyledProperty = ( node : TSESTree . Property , context : RuleContext < any , any > , calleeName ?: string ) => {
175- const ancestor = node . parent . parent
176-
177- const isValidFuncAncestor =
178- isCallExpression ( ancestor ) && isIdentifier ( ancestor . callee ) && isPandaIsh ( ancestor . callee . name , context )
179- if ( isValidFuncAncestor ) return isStyledNode ( node , context , calleeName )
180-
181- return isStyledNode ( ancestor as any , context , calleeName ) && isStyledNode ( node , context , calleeName )
182- }
183-
184169export const isInPandaFunction = ( node : TSESTree . Property , context : RuleContext < any , any > ) => {
185170 const callAncestor = getAncestor ( isCallExpression , node )
186171 if ( ! callAncestor ) return
@@ -271,10 +256,6 @@ export const getInvalidTokens = (value: string, context: RuleContext<any, any>)
271256 return syncAction ( 'filterInvalidTokens' , getSyncOpts ( context ) , tokens )
272257}
273258
274- export const getExtendWarnings = ( context : RuleContext < any , any > ) => {
275- return syncAction ( 'getExtendWarnings' , getSyncOpts ( context ) )
276- }
277-
278259export const getTokenImport = ( context : RuleContext < any , any > ) => {
279260 const imports = _getImports ( context )
280261 return imports . find ( ( imp ) => imp . name === 'token' )
0 commit comments