File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ export const getSourceMatchers = (
53
53
kind : [ SyntaxKind . Identifier , SyntaxKind . StringLiteral ] ,
54
54
text : 'base' ,
55
55
} ,
56
+ // Do not match CSS objects: `base: { color: 'blue' }`
56
57
initializer : ( node : ts . Node ) => node . kind != SyntaxKind . ObjectLiteralExpression ,
57
58
// https://github.com/microsoft/typescript-template-language-service-decorator/blob/main/src/nodes.ts#L62
58
59
// TODO styled.button, styled()
@@ -74,6 +75,8 @@ export const getSourceMatchers = (
74
75
kind : [ SyntaxKind . Identifier , SyntaxKind . StringLiteral ] ,
75
76
text : 'use' ,
76
77
} ,
78
+ // Do not match CSS objects: `use: { color: 'blue' }`
79
+ initializer : ( node : ts . Node ) => node . kind !== SyntaxKind . ObjectLiteralExpression ,
77
80
parent : {
78
81
kind : SyntaxKind . ObjectLiteralExpression ,
79
82
parent : {
@@ -103,6 +106,8 @@ export const getSourceMatchers = (
103
106
// style({ variants: { [...]: { [...]: '...' }} })
104
107
{
105
108
kind : SyntaxKind . PropertyAssignment ,
109
+ // Do not match CSS objects
110
+ initializer : ( node : ts . Node ) => node . kind != SyntaxKind . ObjectLiteralExpression ,
106
111
parent : {
107
112
kind : SyntaxKind . ObjectLiteralExpression ,
108
113
parent : {
You can’t perform that action at this time.
0 commit comments