8000 typescript-eslint/packages/scope-manager at main · ljani/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content
{"payload":{"allShortcutsEnabled":false,"path":"packages/scope-manager","repo":{"id":454938296,"defaultBranch":"main","name":"typescript-eslint","ownerLogin":"ljani","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2022-02-02T21:16:44.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/1334470?v=4","public":true,"private":false,"isOrgOwned":false},"currentUser":null,"refInfo":{"name":"main","listCacheKey":"v0:1643839542.402603","canEdit":false,"refType":"branch","currentOid":"63fbbaa76ebd89dfb2c57fe0d5a7b8458482a087"},"tree":{"items":[{"name":"src","path":"packages/scope-manager/src","contentType":"directory"},{"name":"tests","path":"packages/scope-manager/tests","contentType":"directory"},{"name":"tools","path":"packages/scope-manager/tools","contentType":"directory"},{"name":"typings","path":"packages/scope-manager/typings","contentType":"directory"},{"name":"CHANGELOG.md","path":"packages/scope-manager/CHANGELOG.md","contentType":"file"},{"name":"LICENSE","path":"packages/scope-manager/LICENSE","contentType":"file"},{"name":"README.md","path":"packages/scope-manager/README.md","contentType":"file"},{"name":"jest.config.js","path":"packages/scope-manager/jest.config.js","contentType":"file"},{"name":"package.json","path":"packages/scope-manager/package.json","contentType":"file"},{"name":"project.json","path":"packages/scope-manager/project.json","contentType":"file"},{"name":"tsconfig.build.json","path":"packages/scope-manager/tsconfig.build.json","contentType":"file"},{"name":"tsconfig.json","path":"packages/scope-manager/tsconfig.json","contentType":"file"}],"templateDirectorySuggestionUrl":null,"readme":{"displayName":"README.md","richText":"\u003carticle class=\"markdown-body entry-content container-lg\" itemprop=\"text\"\u003e\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 align=\"center\" tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eTypeScript Scope Manager\u003c/h1\u003e\u003ca id=\"user-content-typescript-scope-manager\" class=\"anchor\" aria-label=\"Permalink: TypeScript Scope Manager\" href=\"#typescript-scope-manager\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp align=\"center\" dir=\"auto\"\u003e\n \u003ca target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/typescript-eslint/typescript-eslint/workflows/CI/badge.svg\"\u003e\u003cimg src=\"https://github.com/typescript-eslint/typescript-eslint/workflows/CI/badge.svg\" alt=\"CI\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n \u003ca href=\"https://www.npmjs.com/package/@typescript-eslint/scope-manager\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/4711da59498d9f90e9693fd2cb83c74394e5d0d7b42a7c27d50e71e5b4471e47/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f40747970657363726970742d65736c696e742f73636f70652d6d616e616765722e7376673f7374796c653d666c61742d737175617265\" alt=\"NPM Version\" data-canonical-src=\"https://img.shields.io/npm/v/@typescript-eslint/scope-manager.svg?style=flat-square\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n \u003ca href=\"https://www.npmjs.com/package/@typescript-eslint/scope-manager\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/5749a59bfe01650b37cdbf50cf299855597d65afa939b56371689e47db5eb627/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f646d2f40747970657363726970742d65736c696e742f73636f70652d6d616e616765722e7376673f7374796c653d666c61742d737175617265\" alt=\"NPM Downloads\" data-canonical-src=\"https://img.shields.io/npm/dm/@typescript-eslint/scope-manager.svg?style=flat-square\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThis is a fork of \u003ca href=\"https://github.com/eslint/eslint-scope\"\u003e\u003ccode\u003eeslint-scope\u003c/code\u003e\u003c/a\u003e, enhanced to support TypeScript functionality.\n\u003ca href=\"https://github.com/eslint/eslint-scope/blob/dbddf14d5771b21b5da704213e4508c660ca1c64/LICENSE\"\u003eYou can view the original licence for the code here\u003c/a\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThis package is consumed automatically by \u003ca href=\"/ljani/typescript-eslint/blob/main/packages/parser\"\u003e\u003ccode\u003e@typescript-eslint/parser\u003c/code\u003e\u003c/a\u003e.\nYou probably don't want to use it directly.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eGetting Started\u003c/h2\u003e\u003ca id=\"user-content-getting-started\" class=\"anchor\" aria-label=\"Permalink: Getting Started\" href=\"#getting-started\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003e\u003ca href=\"https://typescript-eslint.io/docs/linting\" rel=\"nofollow\"\u003eYou can find our Getting Started docs here\u003c/a\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eInstallation\u003c/h2\u003e\u003ca id=\"user-content-installation\" class=\"anchor\" aria-label=\"Permalink: Installation\" href=\"#installation\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"$ yarn add -D typescript @typescript-eslint/scope-manager\n$ npm i --save-dev typescript @typescript-eslint/scope-manager\"\u003e\u003cpre\u003e$ yarn add -D typescript @typescript-eslint/scope-manager\n$ npm i --save-dev typescript @typescript-eslint/scope-manager\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eAPI\u003c/h2\u003e\u003ca id=\"user-content-api\" class=\"anchor\" aria-label=\"Permalink: API\" href=\"#api\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ccode\u003eanalyze(tree, options)\u003c/code\u003e\u003c/h3\u003e\u003ca id=\"user-content-analyzetree-options\" class=\"anchor\" aria-label=\"Permalink: analyze(tree, options)\" href=\"#analyzetree-options\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAnalyses a given AST and returns the resulting \u003ccode\u003eScopeManager\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-ts notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"interface AnalyzeOptions {\n /**\n * Known visitor keys.\n */\n childVisitorKeys?: Record\u0026lt;string, string[]\u0026gt; | null;\n\n /**\n * Which ECMAScript version is considered.\n * Defaults to `2018`.\n * `'latest'` is converted to 1e8 at parser.\n */\n ecmaVersion?: EcmaVersion | 1e8;\n\n /**\n * Whether the whole script is executed under node.js environment.\n * When enabled, the scope manager adds a function scope immediately following the global scope.\n * Defaults to `false`.\n */\n globalReturn?: boolean;\n\n /**\n * Implied strict mode (if ecmaVersion \u0026gt;= 5).\n * Defaults to `false`.\n */\n impliedStrict?: boolean;\n\n /**\n * The identifier that's used for JSX Element creation (after transpilation).\n * This should not be a member expression - just the root identifier (i.e. use \u0026quot;React\u0026quot; instead of \u0026quot;React.createElement\u0026quot;).\n * Defaults to `\u0026quot;React\u0026quot;`.\n */\n jsxPragma?: string;\n\n /**\n * The identifier that's used for JSX fragment elements (after transpilation).\n * If `null`, assumes transpilation will always use a member on `jsxFactory` (i.e. React.Fragment).\n * This should not be a member expression - just the root identifier (i.e. use \u0026quot;h\u0026quot; instead of \u0026quot;h.Fragment\u0026quot;).\n * Defaults to `null`.\n */\n jsxFragmentName?: string | null;\n\n /**\n * The lib used by the project.\n * This automatically defines a type variable for any types provided by the configured TS libs.\n * For more information, see https://www.typescriptlang.org/tsconfig#lib\n *\n * Defaults to the lib for the provided `ecmaVersion`.\n */\n lib?: Lib[];\n\n /**\n * The source type of the script.\n */\n sourceType?: 'script' | 'module';\n\n /**\n * Emit design-type metadata for decorated declarations in source.\n * Defaults to `false`.\n */\n emitDecoratorMetadata?: boolean;\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eAnalyzeOptions\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e/**\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * Known visitor keys.\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e */\u003c/span\u003e\n \u003cspan class=\"pl-c1\"\u003echildVisitorKeys\u003c/span\u003e?: \u003cspan class=\"pl-smi\"\u003eRecord\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003estring\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003estring\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e|\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003enull\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e/**\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * Which ECMAScript version is considered.\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * Defaults to `2018`.\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * `'latest'` is converted to 1e8 at parser.\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e */\u003c/span\u003e\n \u003cspan class=\"pl-c1\"\u003eecmaVersion\u003c/span\u003e?: \u003cspan class=\"pl-smi\"\u003eEcmaVersion\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e|\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e1e8\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e/**\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * Whether the whole script is executed under node.js environment.\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * When enabled, the scope manager adds a function scope immediately following the global scope.\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * Defaults to `false`.\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e */\u003c/span\u003e\n \u003cspan class=\"pl-c1\"\u003eglobalReturn\u003c/span\u003e?: \u003cspan class=\"pl-smi\"\u003eboolean\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e/**\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * Implied strict mode (if ecmaVersion \u0026gt;= 5).\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * Defaults to `false`.\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e */\u003c/span\u003e\n \u003cspan class=\"pl-c1\"\u003eimpliedStrict\u003c/span\u003e?: \u003cspan class=\"pl-smi\"\u003eboolean\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e/**\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * The identifier that's used for JSX Element creation (after transpilation).\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * This should not be a member expression - just the root identifier (i.e. use \"React\" instead of \"React.createElement\").\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * Defaults to `\"React\"`.\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e */\u003c/span\u003e\n \u003cspan class=\"pl-c1\"\u003ejsxPragma\u003c/span\u003e?: \u003cspan class=\"pl-smi\"\u003estring\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e/**\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * The identifier that's used for JSX fragment elements (after transpilation).\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * If `null`, assumes transpilation will always use a member on `jsxFactory` (i.e. React.Fragment).\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * This should not be a member expression - just the root identifier (i.e. use \"h\" instead of \"h.Fragment\").\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * Defaults to `null`.\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e */\u003c/span\u003e\n \u003cspan class=\"pl-c1\"\u003ejsxFragmentName\u003c/span\u003e?: \u003cspan class=\"pl-smi\"\u003estring\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e|\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003enull\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e/**\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * The lib used by the project.\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * This automatically defines a type variable for any types provided by the configured TS libs.\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * For more information, see https://www.typescriptlang.org/tsconfig#lib\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e *\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * Defaults to the lib for the provided `ecmaVersion`.\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e */\u003c/span\u003e\n \u003cspan class=\"pl-c1\"\u003elib\u003c/span\u003e?: \u003cspan class=\"pl-smi\"\u003eLib\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e/**\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * The source type of the script.\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e */\u003c/span\u003e\n \u003cspan class=\"pl-c1\"\u003esourceType\u003c/span\u003e?: \u003cspan class=\"pl-s\"\u003e'script'\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e|\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e'module'\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e/**\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * Emit design-type metadata for decorated declarations in source.\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e * Defaults to `false`.\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e */\u003c/span\u003e\n \u003cspan class=\"pl-c1\"\u003eemitDecoratorMetadata\u003c/span\u003e?: \u003cspan class=\"pl-smi\"\u003eboolean\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eExample usage:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-ts notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"import { analyze } from '@typescript-eslint/scope-manager';\nimport { parse } from '@typescript-eslint/typescript-estree';\n\nconst code = `const hello: string = 'world';`;\nconst ast = parse(code, {\n // note that scope-manager requires ranges on the AST\n range: true,\n});\nconst scope = analyze(ast, {\n ecmaVersion: 2020,\n sourceType: 'module',\n});\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eimport\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eanalyze\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e \u003cspan class=\"pl-k\"\u003efrom\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e'@typescript-eslint/scope-manager'\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eimport\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eparse\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e \u003cspan class=\"pl-k\"\u003efrom\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e'@typescript-eslint/typescript-estree'\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ecode\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e`const hello: string = 'world';`\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003east\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eparse\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003ecode\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// note that scope-manager requires ranges on the AST\u003c/span\u003e\n \u003cspan class=\"pl-c1\"\u003erange\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003escope\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eanalyze\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003east\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-c1\"\u003eecmaVersion\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003e2020\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n \u003cspan class=\"pl-c1\"\u003esourceType\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e'module'\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eReferences\u003c/h2\u003e\u003ca id=\"user-content-references\" class=\"anchor\" aria-label=\"Permalink: References\" href=\"#references\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"https://eslint.org/docs/developer-guide/scope-manager-interface\" rel=\"nofollow\"\u003ehttps://eslint.org/docs/developer-guide/scope-manager-interface\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/eslint/eslint-scope\"\u003ehttps://github.com/eslint/eslint-scope\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eContributing\u003c/h2\u003e\u003ca id=\"user-content-contributing\" class=\"anchor\" aria-label=\"Permalink: Contributing\" href=\"#contributing\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"/ljani/typescript-eslint/blob/main/CONTRIBUTING.md\"\u003eSee the contributing guide here\u003c/a\u003e\u003c/p\u003e\n\u003c/article\u003e","errorMessage":null,"headerInfo":{"toc":[{"level":1,"text":"TypeScript Scope Manager","anchor":"typescript-scope-manager","htmlText":"TypeScript Scope Manager"},{"level":2,"text":"Getting Started","anchor":"getting-started","htmlText":"Getting Started"},{"level":2,"text":"Installation","anchor":"installation","htmlText":"Installation"},{"level":2,"text":"API","anchor":"api","htmlText":"API"},{"level":3,"text":"analyze(tree, options)","anchor":"analyzetree-options","htmlText":"analyze(tree, options)"},{"level":2,"text":"References","anchor":"references","htmlText":"References"},{"level":2,"text":"Contributing","anchor":"contributing","htmlText":"Contributing"}],"siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fljani%2Ftypescript-eslint%2Ftree%2Fmain%2Fpackages%2Fscope-manager"}},"totalCount":12,"showBranchInfobar":true},"fileTree":{"packages":{"items":[{"name":"ast-spec","path":"packages/ast-spec","contentType":"directory"},{"name":"eslint-plugin-internal","path":"packages/eslint-plugin-internal","contentType":"directory"},{"name":"eslint-plugin-tslint","path":"packages/eslint-plugin-tslint","contentType":"directory"},{"name":"eslint-plugin","path":"packages/eslint-plugin","contentType":"directory"},{"name":"experimental-utils","path":"packages/experimental-utils","contentType":"directory"},{"name":"parser","path":"packages/parser","contentType":"directory"},{"name":"scope-manager","path":"packages/scope-manager","contentType":"directory"},{"name":"shared-fixtures","path":"packages/shared-fixtures","contentType":"directory"},{"name":"type-utils","path":"packages/type-utils","contentType":"directory"},{"name":"types","path":"packages/types","contentType":"directory"},{"name":"typescript-estree","path":"packages/typescript-estree","contentType":"directory"},{"name":"utils","path":"packages/utils","contentType":"directory"},{"name":"visitor-keys","path":"packages/visitor-keys","contentType":"directory"},{"name":"website-eslint","path":"packages/website-eslint","contentType":"directory"},{"name":"website","path":"packages/website","contentType":"directory"}],"totalCount":15},"":{"items":[{"name":".github","path":".github","contentType":"directory"},{"name":".husky","path":".husky","contentType":"directory"},{"name":".vscode","path":".vscode","contentType":"directory"},{"name":"docs","path":"docs","contentType":"directory"},{"name":"packages","path":"packages","contentType":"directory"},{"name":"tests","path":"tests","contentType":"directory"},{"name":"tools","path":"tools","contentType":"directory"},{"name":".all-contributorsrc","path":".all-contributorsrc","contentType":"file"},{"name":".codecov.yml","path":".codecov.yml","contentType":"file"},{"name":".cspell.json","path":".cspell.json","contentType":"file"},{"name":".editorconfig","path":".editorconfig","contentType":"file"},{"name":".eslintignore","path":".eslintignore","contentType":"file"},{"name":".eslintrc.js","path":".eslintrc.js","contentType":"file"},{"name":".gitattributes","path":".gitattributes","contentType":"file"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":".lintstagedrc","path":".lintstagedrc","contentType":"file"},{"name":".markdownlint.json","path":".markdownlint.json","contentType":"file"},{"name":".markdownlintignore","path":".markdownlintignore","contentType":"file"},{"name":".npmrc","path":".npmrc","contentType":"file"},{"name":".prettierignore","path":".prettierignore","contentType":"file"},{"name":".prettierrc.json","path":".prettierrc.json","contentType":"file"},{"name":"CHANGELOG.md","path":"CHANGELOG.md","contentType":"file"},{"name":"CODE_OF_CONDUCT.md","path":"CODE_OF_CONDUCT.md","contentType":"file"},{"name":"CONTRIBUTING.md","path":"CONTRIBUTING.md","contentType":"file"},{"name":"CONTRIBUTORS.md","path":"CONTRIBUTORS.md","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"commitlint.config.js","path":"commitlint.config.js","contentType":"file"},{"name":"lerna.json","path":"lerna.json","contentType":"file"},{"name":"nx.json","path":"nx.json","contentType":"file"},{"name":"package.json","path":"package.json","contentType":"file"},{"name":"tsconfig.base.json","path":"tsconfig.base.json","contentType":"file"},{"name":"tsconfig.eslint.json","path":"tsconfig.eslint.json","contentType":"file"},{"name":"workspace.json","path":"workspace.json","contentType":"file"},{"name":"yarn.lock","path":"yarn.lock","contentType":"file"}],"totalCount":35}},"fileTreeProcessingTime":21.716234,"foldersToFetch":[],"treeExpanded":true,"symbolsExpanded":false,"csrf_tokens":{"/ljani/typescript-eslint/branches":{"post":"8dQYJv0bwlI-Up-ksc_lSw0-vXir4olYRghtqvL2NeUKjnn4Ywy4x_crcvRN9QVFj5CssBYdG0TkhNknN3mIGA"},"/ljani/typescript-eslint/branches/fetch_and_merge/main":{"post":"1yjN5uYShmd6GR3uEXLRbAHKEjzgqG1x0B2VFilwsKz0c_kxeWbmAjhBmIb0vab_tFDg0eUkps2eBF3bbSp4ZA"},"/ljani/typescript-eslint/branches/fetch_and_merge/main?discard_changes=true":{"post":"W08zUo4xQbtgSUItDGCpKGIyj3s9tuIP51EajESNJb94FAeFEUUh3iIRx0Xpr96716h9ljg6KbOpSNJBANftdw"}}},"title":"typescript-eslint/packages/scope-manager at main · ljani/typescript-eslint","appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-7d7eb7c71814.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-1ae9fa256942.js","githubDevUrl":null,"enabled_features":{"code_nav_ui_events":false,"react_blob_overlay":false,"accessible_code_button":true,"github_models_repo_integration":false}}}
0