Skip to content

Commit dc08b51

Browse files
committed
Fixed type discrimination
1 parent 7a9fe6e commit dc08b51

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

src/ast/style.ts

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,27 @@ type ESLintCompatiblePostCSSContainer<
6363
): false | undefined;
6464
};
6565

66-
export type ESLintCompatiblePostCSSNode<PostCSSNode extends Node> = Locations &
67-
Omit<
68-
PostCSSNode,
69-
| "type"
70-
| "each"
71-
| "every"
72-
| "first"
73-
| "index"
74-
| "insertAfter"
75-
| "insertBefore"
76-
| "last"
77-
| "nodes"
78-
| "push"
79-
| "removeChild"
80-
| "some"
81-
| "walk"
82-
> & {
83-
type: `SvelteStyle-${PostCSSNode["type"]}`;
84-
} & (PostCSSNode extends Container<infer Child>
85-
? ESLintCompatiblePostCSSContainer<PostCSSNode, Child>
86-
: unknown);
66+
export type ESLintCompatiblePostCSSNode<PostCSSNode extends Node> =
67+
PostCSSNode extends any
68+
? Locations &
69+
Omit<
70+
PostCSSNode,
71+
| "type"
72+
| "each"
73+
| "every"
74+
| "first"
75+
| "index"
76+
| "insertAfter"
77+
| "insertBefore"
78+
| "last"
79+
| "nodes"
80+
| "push"
81+
| "removeChild"
82+
| "some"
83+
| "walk"
84+
> & {
85+
type: `SvelteStyle-${PostCSSNode["type"]}`;
86+
} & (PostCSSNode extends Container<infer Child>
87+
? ESLintCompatiblePostCSSContainer<PostCSSNode, Child>
88+
: unknown)
89+
: never;

0 commit comments

Comments
 (0)