source: frontend/node_modules/eslint-module-utils/contextCompat.d.ts@ ae6cd79

Last change on this file since ae6cd79 was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 1.1 KB
Line 
1import { Scope, SourceCode, Rule } from 'eslint';
2import * as ESTree from 'estree';
3
4type LegacyContext = {
5 getFilename: () => string,
6 getPhysicalFilename: () => string,
7 getSourceCode: () => SourceCode,
8 getScope: never,
9 getAncestors: never,
10 getDeclaredVariables: never,
11};
12
13type NewContext = {
14 filename: string,
15 sourceCode: SourceCode,
16 getPhysicalFilename?: () => string,
17 getScope: () => Scope.Scope,
18 getAncestors: () => ESTree.Node[],
19 getDeclaredVariables: (node: ESTree.Node) => Scope.Variable[],
20};
21
22export type Context = LegacyContext | NewContext | Rule.RuleContext;
23
24declare function getAncestors(context: Context, node: ESTree.Node): ESTree.Node[];
25declare function getDeclaredVariables(context: Context, node: ESTree.Node): Scope.Variable[];
26declare function getFilename(context: Context): string;
27declare function getPhysicalFilename(context: Context): string;
28declare function getScope(context: Context, node: ESTree.Node): Scope.Scope;
29declare function getSourceCode(context: Context): SourceCode;
30
31export {
32 getAncestors,
33 getDeclaredVariables,
34 getFilename,
35 getPhysicalFilename,
36 getScope,
37 getSourceCode,
38};
Note: See TracBrowser for help on using the repository browser.