1 | # Installation
|
---|
2 | > `npm install --save @types/eslint-scope`
|
---|
3 |
|
---|
4 | # Summary
|
---|
5 | This package contains type definitions for eslint-scope (http://github.com/eslint/eslint-scope).
|
---|
6 |
|
---|
7 | # Details
|
---|
8 | Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eslint-scope.
|
---|
9 | ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eslint-scope/index.d.ts)
|
---|
10 | ````ts
|
---|
11 | // Type definitions for eslint-scope 3.7
|
---|
12 | // Project: http://github.com/eslint/eslint-scope
|
---|
13 | // Definitions by: Toru Nagashima <https://github.com/mysticatea>
|
---|
14 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
---|
15 | // TypeScript Version: 2.2
|
---|
16 | import * as eslint from "eslint";
|
---|
17 | import * as estree from "estree";
|
---|
18 |
|
---|
19 | export const version: string;
|
---|
20 |
|
---|
21 | export class ScopeManager implements eslint.Scope.ScopeManager {
|
---|
22 | scopes: Scope[];
|
---|
23 | globalScope: Scope;
|
---|
24 | acquire(node: {}, inner?: boolean): Scope | null;
|
---|
25 | getDeclaredVariables(node: {}): Variable[];
|
---|
26 | }
|
---|
27 |
|
---|
28 | export class Scope implements eslint.Scope.Scope {
|
---|
29 | type: "block" | "catch" | "class" | "for" | "function" | "function-expression-name" | "global" | "module" | "switch" | "with" | "TDZ";
|
---|
30 | isStrict: boolean;
|
---|
31 | upper: Scope | null;
|
---|
32 | childScopes: Scope[];
|
---|
33 | variableScope: Scope;
|
---|
34 | block: estree.Node;
|
---|
35 | variables: Variable[];
|
---|
36 | set: Map<string, Variable>;
|
---|
37 | references: Reference[];
|
---|
38 | through: Reference[];
|
---|
39 | functionExpressionScope: boolean;
|
---|
40 | }
|
---|
41 |
|
---|
42 | export class Variable implements eslint.Scope.Variable {
|
---|
43 | name: string;
|
---|
44 | identifiers: estree.Identifier[];
|
---|
45 | references: Reference[];
|
---|
46 | defs: eslint.Scope.Definition[];
|
---|
47 | }
|
---|
48 |
|
---|
49 | export class Reference implements eslint.Scope.Reference {
|
---|
50 | identifier: estree.Identifier;
|
---|
51 | from: Scope;
|
---|
52 | resolved: Variable | null;
|
---|
53 | writeExpr: estree.Node | null;
|
---|
54 | init: boolean;
|
---|
55 |
|
---|
56 | isWrite(): boolean;
|
---|
57 | isRead(): boolean;
|
---|
58 | isWriteOnly(): boolean;
|
---|
59 | isReadOnly(): boolean;
|
---|
60 | isReadWrite(): boolean;
|
---|
61 | }
|
---|
62 |
|
---|
63 | export interface AnalysisOptions {
|
---|
64 | optimistic?: boolean | undefined;
|
---|
65 | directive?: boolean | undefined;
|
---|
66 | ignoreEval?: boolean | undefined;
|
---|
67 | nodejsScope?: boolean | undefined;
|
---|
68 | impliedStrict?: boolean | undefined;
|
---|
69 | fallback?: string | ((node: {}) => string[]) | undefined;
|
---|
70 | sourceType?: "script" | "module" | undefined;
|
---|
71 | ecmaVersion?: number | undefined;
|
---|
72 | }
|
---|
73 |
|
---|
74 | export function analyze(ast: {}, options?: AnalysisOptions): ScopeManager;
|
---|
75 |
|
---|
76 | ````
|
---|
77 |
|
---|
78 | ### Additional Details
|
---|
79 | * Last updated: Tue, 06 Jul 2021 19:03:40 GMT
|
---|
80 | * Dependencies: [@types/eslint](https://npmjs.com/package/@types/eslint), [@types/estree](https://npmjs.com/package/@types/estree)
|
---|
81 | * Global values: none
|
---|
82 |
|
---|
83 | # Credits
|
---|
84 | These definitions were written by [Toru Nagashima](https://github.com/mysticatea).
|
---|