8000 feat(experimental-utils): expose ReferenceTracker.ESM (#3532) · mrmckeb/typescript-eslint@4ac67c4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4ac67c4

Browse files
MageJohnYuri Pieters
andauthored
feat(experimental-utils): expose ReferenceTracker.ESM (typescript-eslint#3532)
Co-authored-by: Yuri Pieters <yuri.pieters@anaplan.com>
1 parent a7fd7bb commit 4ac67c4

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

packages/experimental-utils/src/ast-utils/eslint-utils/ReferenceTracker.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const ReferenceTrackerREAD: unique symbol = eslintUtils.ReferenceTracker.READ;
77
const ReferenceTrackerCALL: unique symbol = eslintUtils.ReferenceTracker.CALL;
88
const ReferenceTrackerCONSTRUCT: unique symbol =
99
eslintUtils.ReferenceTracker.CONSTRUCT;
10+
const ReferenceTrackerESM: unique symbol = eslintUtils.ReferenceTracker.ESM;
1011

1112
interface ReferenceTracker {
1213
/**
@@ -59,19 +60,22 @@ interface ReferenceTrackerStatic {
5960
readonly READ: typeof ReferenceTrackerREAD;
6061
readonly CALL: typeof ReferenceTrackerCALL;
6162
readonly CONSTRUCT: typeof ReferenceTrackerCONSTRUCT;
63+
readonly ESM: typeof ReferenceTrackerESM;
6264
}
6365

6466
namespace ReferenceTracker {
6567
export type READ = ReferenceTrackerStatic['READ'];
6668
export type CALL = ReferenceTrackerStatic['CALL'];
6769
export type CONSTRUCT = ReferenceTrackerStatic['CONSTRUCT'];
70+
export type ESM = ReferenceTrackerStatic['ESM'];
6871
export type ReferenceType = READ | CALL | CONSTRUCT;
6972
// eslint-disable-next-line @typescript-eslint/no-explicit-any
7073
export type TraceMap<T = any> = Record<string, TraceMapElement<T>>;
7174
export interface TraceMapElement<T> {
7275
[ReferenceTrackerREAD]?: T;
7376
[ReferenceTrackerCALL]?: T;
7477
[ReferenceTrackerCONSTRUCT]?: T;
78+
[ReferenceTrackerESM]?: true;
7579
[key: string]: TraceMapElement<T>;
7680
}
7781
// eslint-disable-next-line @typescript-eslint/no-explicit-any

packages/experimental-utils/typings/eslint-utils.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ declare module 'eslint-utils' {
3535
readonly READ: never;
3636
readonly CALL: never;
3737
readonly CONSTRUCT: never;
38+
readonly ESM: never;
3839
new (): never;
3940
};
4041
}

0 commit comments

Comments
 (0)
0