fix(typescript): support type param for styled components (#8066)

This commit is contained in:
Alexey Svirshchevskiy 2025-11-05 05:07:27 +01:00 committed by GitHub
parent 53049d6678
commit 896e92a7f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 1 deletions

View file

@ -1 +1 @@
; inherits: ecma,jsx ; inherits: typescript,jsx

View file

@ -1 +1,28 @@
; inherits: ecma ; inherits: ecma
; styled.div<{}>`<css>`
(call_expression
function: (non_null_expression
(instantiation_expression
(member_expression
object: (identifier) @_name
(#eq? @_name "styled")
property: (property_identifier))
type_arguments: (type_arguments)))
arguments: ((template_string) @injection.content
(#offset! @injection.content 0 1 0 -1)
(#set! injection.include-children)
(#set! injection.language "styled")))
; styled.div<T>`<css>`
(binary_expression
left: (binary_expression
left: (member_expression
object: (identifier) @_name
(#eq? @_name "styled")
property: (property_identifier))
right: (identifier))
right: (template_string) @injection.content
(#offset! @injection.content 0 1 0 -1)
(#set! injection.include-children)
(#set! injection.language "styled"))