@@ -51,6 +51,7 @@ import type {
5151 ValuePlain ,
5252 WhiteSpace ,
5353 CssNodePlain ,
54+ CssLocationRange ,
5455} from "@eslint/css-tree" ;
5556import type { CSSRuleDefinition , CSSRuleVisitor } from "@eslint/css/types" ;
5657
@@ -73,6 +74,19 @@ css.configs.recommended.plugins satisfies object;
7374 null as AssertAllNamesIn < RecommendedRuleName , RuleName > ;
7475}
7576
77+ {
78+ type ApplyInlineConfigLoc = ReturnType <
79+ CSSSourceCode [ "applyInlineConfig" ]
80+ > [ "configs" ] [ 0 ] [ "loc" ] ;
81+
82+ // Check that `applyInlineConfig`'s return type includes correct `loc` structure.
83+ const loc : ApplyInlineConfigLoc = {
84+ source : "source" ,
85+ start : { line : 1 , column : 1 , offset : 0 } ,
86+ end : { line : 1 , column : 1 , offset : 0 } ,
87+ } ;
88+ }
89+
7690( ) : CSSRuleDefinition => ( {
7791 create ( { sourceCode } ) : CSSRuleVisitor {
7892 sourceCode satisfies CSSSourceCode ;
@@ -91,6 +105,12 @@ css.configs.recommended.plugins satisfies object;
91105 sourceCode . getParent ( node ) satisfies CssNodePlain | undefined ;
92106 sourceCode . getAncestors ( node ) satisfies CssNodePlain [ ] ;
93107 sourceCode . getText ( node ) satisfies string ;
108+ sourceCode . applyInlineConfig ( ) . configs [ 0 ] . loc
109+ . source satisfies CssLocationRange [ "source" ] ;
110+ sourceCode . applyInlineConfig ( ) . configs [ 0 ] . loc . start
111+ . offset satisfies CssLocationRange [ "start" ] [ "offset" ] ;
112+ sourceCode . applyInlineConfig ( ) . configs [ 0 ] . loc . end
113+ . offset satisfies CssLocationRange [ "end" ] [ "offset" ] ;
94114 }
95115
96116 return {
0 commit comments