@@ -8,6 +8,7 @@ import type { TSESLint } from "@typescript-eslint/utils";
88
99import { TSESTree as T , ESLintUtils } from "@typescript-eslint/utils" ;
1010import { isDOMElementName , formatList , appendImports , insertImports } from "../utils" ;
11+ import { getScope , getSourceCode } from "../compat" ;
1112
1213const createRule = ESLintUtils . RuleCreator . withoutDocs ;
1314
@@ -86,8 +87,8 @@ export default createRule<Options, MessageIds>({
8687 isCustomDirective,
8788 } : { isComponent ?: boolean ; isCustomDirective ?: boolean } = { }
8889 ) {
89- let scope = context . getScope ( ) ;
90- const sourceCode = context . getSourceCode ( ) ;
90+ let scope = getScope ( context , node ) ;
91+ const sourceCode = getSourceCode ( context ) ;
9192 const sourceType = sourceCode . ast . sourceType ;
9293 const scopeUpperBound = ! allowGlobals && sourceType === "module" ? "module" : "global" ;
9394 const variables = [ ...scope . variables ] ;
@@ -192,7 +193,7 @@ export default createRule<Options, MessageIds>({
192193 source : SOURCE_MODULE ,
193194 } ,
194195 fix : ( fixer ) => {
195- return appendImports ( fixer , context . getSourceCode ( ) , importNode , missingComponents ) ;
196+ return appendImports ( fixer , getSourceCode ( context ) , importNode , missingComponents ) ;
196197 } ,
197198 } ) ;
198199 } else {
@@ -205,7 +206,7 @@ export default createRule<Options, MessageIds>({
205206 } ,
206207 fix : ( fixer ) => {
207208 // insert `import { missing, identifiers } from "solid-js"` at top of module
208- return insertImports ( fixer , context . getSourceCode ( ) , "solid-js" , missingComponents ) ;
209+ return insertImports ( fixer , getSourceCode ( context ) , "solid-js" , missingComponents ) ;
209210 } ,
210211 } ) ;
211212 }
0 commit comments