{"_id":"@daotl/typescript-eslint-scope-manager","_rev":"1-4d93b5f25c810e0e4288056a53258436","name":"@daotl/typescript-eslint-scope-manager","dist-tags":{"latest":"5.40.0"},"versions":{"5.40.0":{"name":"@daotl/typescript-eslint-scope-manager","version":"5.40.0","description":"TypeScript scope analyser for ESLint","keywords":["eslint","typescript","estree"],"engines":{"node":"^12.22.0 || ^14.17.0 || >=16.0.0"},"repository":{"type":"git","url":"git+https://github.com/typescript-eslint/typescript-eslint.git","directory":"packages/scope-manager"},"bugs":{"url":"https://github.com/typescript-eslint/typescript-eslint/issues"},"license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"cd ../../ && nx build @typescript-eslint/scope-manager","clean":"cd ../../ && nx clean @typescript-eslint/scope-manager","clean-fixtures":"cd ../../ && nx clean-fixtures @typescript-eslint/scope-manager","format":"prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore","generate:lib":"cd ../../ && nx generate-lib @typescript-eslint/scope-manager","lint":"cd ../../ && nx lint @typescript-eslint/scope-manager","test":"cd ../../ && nx test @typescript-eslint/scope-manager --code-coverage","typecheck":"cd ../../ && nx typecheck @typescript-eslint/scope-manager"},"dependencies":{"@typescript-eslint/types":"5.40.0","@typescript-eslint/visitor-keys":"5.40.0"},"devDependencies":{"@types/glob":"*","@typescript-eslint/typescript-estree":"5.40.0","glob":"*","jest-specific-snapshot":"*","make-dir":"*","prettier":"*","pretty-format":"*","rimraf":"*","typescript":"*"},"funding":{"type":"opencollective","url":"https://opencollective.com/typescript-eslint"},"typesVersions":{"<3.8":{"*":["_ts3.4/*"]}},"gitHead":"4a578e49f81055a33f660987e46f75513c89b9a4","homepage":"https://github.com/typescript-eslint/typescript-eslint#readme","_id":"@daotl/typescript-eslint-scope-manager@5.40.0","_nodeVersion":"18.9.0","_npmVersion":"8.19.1","dist":{"integrity":"sha512-x3bNLAhJ1fc0CvxJ25j2wQR+KxsLQZglRclTM93AQ2qUomSws2xa98TdpW9GyHy4PKbl/xAsesdTmNXJALI7mQ==","shasum":"8261dcb74e305d6ab91579f28477d4fd10aec001","tarball":"https://registry.npmjs.org/@daotl/typescript-eslint-scope-manager/-/typescript-eslint-scope-manager-5.40.0.tgz","fileCount":547,"unpackedSize":576805,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWK7cFcw0YHhfhShm2K8ti12JFFNhYuiC+dPE3cP+A8gIgZwB9V9uennapVac56mxyfUT4ICFO2v9z3Kmb7fal/P8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjS+77ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpchBAAjN7CNLVPzwXZAFSZReT3MZJXt862+zBfLv/LvXN0H6WPiRLl\r\nu1ZM2Ggu8cMtsQZQooeV3OD5gksvMaRO0XQkbxtR8ktzBTUGySx83SmUUzYO\r\nmUZsM6R2HE5tM9g/t40lpXBwMYhRBjHf7+/58S8VdWsbN8RUckoXPoyFjGRm\r\nArWKateHY1aH5yNPcfm8NLNlcpZ2NurrivV4c5fghYt9V28EUR/PGnvZe541\r\nWYI5r0w8RHZzQkzeAZmVUO7RYufsSqZzsOrE+tgedytzJfHWi0ICxjF0zEHg\r\nMishdXcVB7OGc4ohIn4Ach+st1fufp6D3RZGG/Bqv3Tt4+vOhG0moWQ6BpWQ\r\n2aJdqpn+iA7jnTB6w3vsOo4bD9eQgz5L/RMF3LSNhqPddDujUrRIP9xmIcCf\r\n03UBn8reLiy+YDCYEcjGvLFMq+A42Gw+PRv81SqYUa2SMb3qOy+LMifaKMPd\r\nd5fhYXoM5ZOBuJHNNwKA8+msCiU46vhLIWBDIkGra/yVwRUxvJY+6EQ7pckX\r\nBtSCqmItS2OyT43zisEyh4izyPRvU2bz8xZqqnz4d7UejafR3ExYm7FjCh6B\r\nz6uEsWYdWYrd82m1i0zJWC4oUZI7BB/JkOoSb0v9I6p3Gf626IDcFTeTPCRE\r\nXssH/Rcbf4RyGBHYO/rt8tmfFtz7MNrb0DI=\r\n=BrYf\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nex","email":"nexzhu@gmail.com"},"directories":{},"maintainers":[{"name":"nex","email":"nexzhu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typescript-eslint-scope-manager_5.40.0_1665920763480_0.145484422849661"},"_hasShrinkwrap":false}},"time":{"created":"2022-10-16T11:46:03.392Z","5.40.0":"2022-10-16T11:46:03.825Z","modified":"2023-05-18T09:55:29.689Z"},"maintainers":[{"email":"zwjCheer@163.com","name":"zwj_cheer"},{"email":"nexzhu@gmail.com","name":"nex"}],"description":"TypeScript scope analyser for ESLint","homepage":"https://github.com/typescript-eslint/typescript-eslint#readme","keywords":["eslint","typescript","estree"],"repository":{"type":"git","url":"git+https://github.com/typescript-eslint/typescript-eslint.git","directory":"packages/scope-manager"},"bugs":{"url":"https://github.com/typescript-eslint/typescript-eslint/issues"},"license":"MIT","readme":"<h1 align=\"center\">TypeScript Scope Manager</h1>\n\n<p align=\"center\">\n    <img src=\"https://github.com/typescript-eslint/typescript-eslint/workflows/CI/badge.svg\" alt=\"CI\" />\n    <a href=\"https://www.npmjs.com/package/@typescript-eslint/scope-manager\"><img src=\"https://img.shields.io/npm/v/@typescript-eslint/scope-manager.svg?style=flat-square\" alt=\"NPM Version\" /></a>\n    <a href=\"https://www.npmjs.com/package/@typescript-eslint/scope-manager\"><img src=\"https://img.shields.io/npm/dm/@typescript-eslint/scope-manager.svg?style=flat-square\" alt=\"NPM Downloads\" /></a>\n</p>\n\nThis is a fork of [`eslint-scope`](https://github.com/eslint/eslint-scope), enhanced to support TypeScript functionality.\n[You can view the original license for the code here](https://github.com/eslint/eslint-scope/blob/dbddf14d5771b21b5da704213e4508c660ca1c64/LICENSE).\n\nThis package is consumed automatically by [`@typescript-eslint/parser`](../parser).\nYou probably don't want to use it directly.\n\n## Getting Started\n\n**[You can find our Getting Started docs here](https://typescript-eslint.io/docs)**\n\n## Installation\n\n```bash\n$ yarn add -D typescript @typescript-eslint/scope-manager\n$ npm i --save-dev typescript @typescript-eslint/scope-manager\n```\n\n## API\n\n### `analyze(tree, options)`\n\nAnalyses a given AST and returns the resulting `ScopeManager`.\n\n```ts\ninterface AnalyzeOptions {\n  /**\n   * Known visitor keys.\n   */\n  childVisitorKeys?: Record<string, string[]> | 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 >= 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 \"React\" instead of \"React.createElement\").\n   * Defaults to `\"React\"`.\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 \"h\" instead of \"h.Fragment\").\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}\n```\n\nExample usage:\n\n```ts\nimport { 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});\n```\n\n## References\n\n- https://eslint.org/docs/developer-guide/scope-manager-interface\n- https://github.com/eslint/eslint-scope\n\n## Contributing\n\n[See the contributing guide here](../../CONTRIBUTING.md)\n","readmeFilename":"README.md"}