diff --git a/packages/experimental-utils/src/ast-utils/eslint-utils/ReferenceTracker.ts b/packages/experimental-utils/src/ast-utils/eslint-utils/ReferenceTracker.ts index e0b47222949..3b4580155d1 100644 --- a/packages/experimental-utils/src/ast-utils/eslint-utils/ReferenceTracker.ts +++ b/packages/experimental-utils/src/ast-utils/eslint-utils/ReferenceTracker.ts @@ -7,6 +7,7 @@ const ReferenceTrackerREAD: unique symbol = eslintUtils.ReferenceTracker.READ; const ReferenceTrackerCALL: unique symbol = eslintUtils.ReferenceTracker.CALL; const ReferenceTrackerCONSTRUCT: unique symbol = eslintUtils.ReferenceTracker.CONSTRUCT; +const ReferenceTrackerESM: unique symbol = eslintUtils.ReferenceTracker.ESM; interface ReferenceTracker { /** @@ -59,12 +60,14 @@ interface ReferenceTrackerStatic { readonly READ: typeof ReferenceTrackerREAD; readonly CALL: typeof ReferenceTrackerCALL; readonly CONSTRUCT: typeof ReferenceTrackerCONSTRUCT; + readonly ESM: typeof ReferenceTrackerESM; } namespace ReferenceTracker { export type READ = ReferenceTrackerStatic['READ']; export type CALL = ReferenceTrackerStatic['CALL']; export type CONSTRUCT = ReferenceTrackerStatic['CONSTRUCT']; + export type ESM = ReferenceTrackerStatic['ESM']; export type ReferenceType = READ | CALL | CONSTRUCT; // eslint-disable-next-line @typescript-eslint/no-explicit-any export type TraceMap = Record>; @@ -72,6 +75,7 @@ namespace ReferenceTracker { [ReferenceTrackerREAD]?: T; [ReferenceTrackerCALL]?: T; [ReferenceTrackerCONSTRUCT]?: T; + [ReferenceTrackerESM]?: true; [key: string]: TraceMapElement; } // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/packages/experimental-utils/typings/eslint-utils.d.ts b/packages/experimental-utils/typings/eslint-utils.d.ts index f99a3e840db..5843e99466f 100644 --- a/packages/experimental-utils/typings/eslint-utils.d.ts +++ b/packages/experimental-utils/typings/eslint-utils.d.ts @@ -35,6 +35,7 @@ declare module 'eslint-utils' { readonly READ: never; readonly CALL: never; readonly CONSTRUCT: never; + readonly ESM: never; new (): never; }; }