@@ -11,7 +11,7 @@ import type { Context } from "../../context";
11
11
import { convertChildren , extractElementTags } from "./element" ;
12
12
import { convertAttributeTokens } from "./attr" ;
13
13
import type { Scope } from "eslint-scope" ;
14
- import type { Document , Node , Parser , Root } from "postcss" ;
14
+ import type { Node , Parser , Root } from "postcss" ;
15
15
import postcss from "postcss" ;
16
16
import { parse as SCSSparse } from "postcss-scss" ;
17
17
import type { ESLintCompatiblePostCSSNode } from "../../ast/style" ;
@@ -149,15 +149,19 @@ export function convertSvelteRoot(
149
149
style . body = parseFn ( styleCode , {
150
150
from : ctx . parserOptions . filePath ,
151
151
} ) as unknown as ESLintCompatiblePostCSSNode < Root > ;
152
- convertPostCSSNodeToESLintNode ( style . body , style . loc , contentRange ) ;
152
+ convertPostCSSNodeToESLintNode < Root > (
153
+ style . body ,
154
+ style . loc ,
155
+ contentRange
156
+ ) ;
153
157
// Fix Root loc
154
158
style . body . loc . start . column += style . startTag . loc . end . column ;
155
159
style . body . loc . end . column -=
156
160
style . endTag . loc . end . column - style . endTag . loc . start . column ;
157
161
style . body ?. walk ( ( node ) =>
158
162
convertPostCSSNodeToESLintNode ( node , style . loc , contentRange )
159
163
) ;
160
- style . body . parent = style as unknown as Document ;
164
+ style . body . parent = style ;
161
165
delete style . body . source ?. input . file ;
162
166
}
163
167
ctx . addToken ( "HTMLText" , contentRange ) ;
0 commit comments