Skip to content

Commit 0aefdbf

Browse files
committed
chore: remove unneeded context helpers
1 parent 0a462a5 commit 0aefdbf

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

src/context.js

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
export function getFilename(context) {
2-
if ('filename' in context) {
3-
return context.filename;
4-
}
5-
6-
return context.getFilename();
7-
}
8-
9-
export function getPhysicalFilename(context) {
10-
if (context.getPhysicalFilename) {
11-
return context.getPhysicalFilename();
12-
}
13-
14-
return getFilename(context);
15-
}
16-
171
export function getSourceCode(context) {
182
if ('sourceCode' in context) {
193
return context.sourceCode;
@@ -31,23 +15,3 @@ export function getScope(context, node) {
3115

3216
return context.getScope();
3317
}
34-
35-
export function getAncestors(context, node) {
36-
const sourceCode = getSourceCode(context);
37-
38-
if (sourceCode && sourceCode.getAncestors) {
39-
return sourceCode.getAncestors(node);
40-
}
41-
42-
return context.getAncestors();
43-
}
44-
45-
export function getDeclaredVariables(context, node) {
46-
const sourceCode = getSourceCode(context);
47-
48-
if (sourceCode && sourceCode.getDeclaredVariables) {
49-
return sourceCode.getDeclaredVariables(node);
50-
}
51-
52-
return context.getDeclaredVariables(node);
53-
}

0 commit comments

Comments
 (0)