11import ts from "typescript" ;
22import { SourceCode , AST , Scope } from "eslint" ;
3- import { ParserOptions } from "@typescript-eslint/parser " ;
4- import { analyzeScope } from "@typescript-eslint/parser/dist/analyze- scope" ;
3+ import { ParserOptions } from "@typescript-eslint/types " ;
4+ import { analyze , AnalyzeOptions } from "@typescript-eslint/scope-manager " ;
55import { Extra } from "@typescript-eslint/typescript-estree/dist/parser-options" ;
66import { visitorKeys } from "@typescript-eslint/visitor-keys" ;
77import { ParseAndGenerateServicesResult , TSESTreeOptions } from "@typescript-eslint/typescript-estree" ;
@@ -200,6 +200,15 @@ export class AstConverter {
200200 jsx : validateBoolean ( options . ecmaFeatures . jsx ) ,
201201 } ) ;
202202
203+ const analyzeOptions : AnalyzeOptions = {
204+ ecmaVersion : options . ecmaVersion ,
205+ globalReturn : options . ecmaFeatures . globalReturn ,
206+ // jsxPragma: options.jsxPragma,
207+ // jsxFragmentName: options.jsxFragmentName,
208+ lib : options . lib ,
209+ sourceType : options . sourceType ,
210+ } ;
211+
203212 if ( typeof options . filePath === "string" ) {
204213 const tsx = options . filePath . endsWith ( ".tsx" ) ;
205214 if ( tsx || options . filePath . endsWith ( ".ts" ) ) {
@@ -219,7 +228,7 @@ export class AstConverter {
219228 const { ast, services } = this . parseAndGenerateServices ( src , parserOptions ) ;
220229 ast . sourceType = options . sourceType ;
221230
222- const scopeManager = analyzeScope ( ast as any , parserOptions ) ;
231+ const scopeManager = analyze ( ast , analyzeOptions ) ;
223232
224233 return {
225234 ast : ast as AST . Program ,
0 commit comments