@typescript-eslint/experimental-utils 5.9.2-alpha.4 → 5.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/README.md +9 -21
  2. package/dist/index.d.ts +1 -7
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +2 -24
  5. package/dist/index.js.map +1 -1
  6. package/package.json +3 -16
  7. package/dist/ast-utils/eslint-utils/PatternMatcher.d.ts +0 -48
  8. package/dist/ast-utils/eslint-utils/PatternMatcher.d.ts.map +0 -1
  9. package/dist/ast-utils/eslint-utils/PatternMatcher.js +0 -32
  10. package/dist/ast-utils/eslint-utils/PatternMatcher.js.map +0 -1
  11. package/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts +0 -76
  12. package/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts.map +0 -1
  13. package/dist/ast-utils/eslint-utils/ReferenceTracker.js +0 -36
  14. package/dist/ast-utils/eslint-utils/ReferenceTracker.js.map +0 -1
  15. package/dist/ast-utils/eslint-utils/astUtilities.d.ts +0 -76
  16. package/dist/ast-utils/eslint-utils/astUtilities.d.ts.map +0 -1
  17. package/dist/ast-utils/eslint-utils/astUtilities.js +0 -95
  18. package/dist/ast-utils/eslint-utils/astUtilities.js.map +0 -1
  19. package/dist/ast-utils/eslint-utils/index.d.ts +0 -6
  20. package/dist/ast-utils/eslint-utils/index.d.ts.map +0 -1
  21. package/dist/ast-utils/eslint-utils/index.js +0 -18
  22. package/dist/ast-utils/eslint-utils/index.js.map +0 -1
  23. package/dist/ast-utils/eslint-utils/predicates.d.ts +0 -32
  24. package/dist/ast-utils/eslint-utils/predicates.d.ts.map +0 -1
  25. package/dist/ast-utils/eslint-utils/predicates.js +0 -68
  26. package/dist/ast-utils/eslint-utils/predicates.js.map +0 -1
  27. package/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts +0 -18
  28. package/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts.map +0 -1
  29. package/dist/ast-utils/eslint-utils/scopeAnalysis.js +0 -40
  30. package/dist/ast-utils/eslint-utils/scopeAnalysis.js.map +0 -1
  31. package/dist/ast-utils/helpers.d.ts +0 -18
  32. package/dist/ast-utils/helpers.d.ts.map +0 -1
  33. package/dist/ast-utils/helpers.js +0 -20
  34. package/dist/ast-utils/helpers.js.map +0 -1
  35. package/dist/ast-utils/index.d.ts +0 -4
  36. package/dist/ast-utils/index.d.ts.map +0 -1
  37. package/dist/ast-utils/index.js +0 -16
  38. package/dist/ast-utils/index.js.map +0 -1
  39. package/dist/ast-utils/misc.d.ts +0 -8
  40. package/dist/ast-utils/misc.d.ts.map +0 -1
  41. package/dist/ast-utils/misc.js +0 -13
  42. package/dist/ast-utils/misc.js.map +0 -1
  43. package/dist/ast-utils/predicates.d.ts +0 -180
  44. package/dist/ast-utils/predicates.d.ts.map +0 -1
  45. package/dist/ast-utils/predicates.js +0 -125
  46. package/dist/ast-utils/predicates.js.map +0 -1
  47. package/dist/eslint-utils/InferTypesFromRule.d.ts +0 -11
  48. package/dist/eslint-utils/InferTypesFromRule.d.ts.map +0 -1
  49. package/dist/eslint-utils/InferTypesFromRule.js +0 -3
  50. package/dist/eslint-utils/InferTypesFromRule.js.map +0 -1
  51. package/dist/eslint-utils/RuleCreator.d.ts +0 -35
  52. package/dist/eslint-utils/RuleCreator.d.ts.map +0 -1
  53. package/dist/eslint-utils/RuleCreator.js +0 -47
  54. package/dist/eslint-utils/RuleCreator.js.map +0 -1
  55. package/dist/eslint-utils/RuleTester.d.ts +0 -18
  56. package/dist/eslint-utils/RuleTester.d.ts.map +0 -1
  57. package/dist/eslint-utils/RuleTester.js +0 -127
  58. package/dist/eslint-utils/RuleTester.js.map +0 -1
  59. package/dist/eslint-utils/applyDefault.d.ts +0 -10
  60. package/dist/eslint-utils/applyDefault.d.ts.map +0 -1
  61. package/dist/eslint-utils/applyDefault.js +0 -32
  62. package/dist/eslint-utils/applyDefault.js.map +0 -1
  63. package/dist/eslint-utils/batchedSingleLineTests.d.ts +0 -24
  64. package/dist/eslint-utils/batchedSingleLineTests.d.ts.map +0 -1
  65. package/dist/eslint-utils/batchedSingleLineTests.js +0 -26
  66. package/dist/eslint-utils/batchedSingleLineTests.js.map +0 -1
  67. package/dist/eslint-utils/deepMerge.d.ts +0 -17
  68. package/dist/eslint-utils/deepMerge.d.ts.map +0 -1
  69. package/dist/eslint-utils/deepMerge.js +0 -48
  70. package/dist/eslint-utils/deepMerge.js.map +0 -1
  71. package/dist/eslint-utils/getParserServices.d.ts +0 -8
  72. package/dist/eslint-utils/getParserServices.d.ts.map +0 -1
  73. package/dist/eslint-utils/getParserServices.js +0 -28
  74. package/dist/eslint-utils/getParserServices.js.map +0 -1
  75. package/dist/eslint-utils/index.d.ts +0 -9
  76. package/dist/eslint-utils/index.d.ts.map +0 -1
  77. package/dist/eslint-utils/index.js +0 -21
  78. package/dist/eslint-utils/index.js.map +0 -1
  79. package/dist/eslint-utils/nullThrows.d.ts +0 -14
  80. package/dist/eslint-utils/nullThrows.d.ts.map +0 -1
  81. package/dist/eslint-utils/nullThrows.js +0 -28
  82. package/dist/eslint-utils/nullThrows.js.map +0 -1
  83. package/dist/json-schema.d.ts +0 -2
  84. package/dist/json-schema.d.ts.map +0 -1
  85. package/dist/json-schema.js +0 -6
  86. package/dist/json-schema.js.map +0 -1
  87. package/dist/ts-eslint/AST.d.ts +0 -9
  88. package/dist/ts-eslint/AST.d.ts.map +0 -1
  89. package/dist/ts-eslint/AST.js +0 -4
  90. package/dist/ts-eslint/AST.js.map +0 -1
  91. package/dist/ts-eslint/CLIEngine.d.ts +0 -137
  92. package/dist/ts-eslint/CLIEngine.d.ts.map +0 -1
  93. package/dist/ts-eslint/CLIEngine.js +0 -17
  94. package/dist/ts-eslint/CLIEngine.js.map +0 -1
  95. package/dist/ts-eslint/ESLint.d.ts +0 -338
  96. package/dist/ts-eslint/ESLint.d.ts.map +0 -1
  97. package/dist/ts-eslint/ESLint.js +0 -23
  98. package/dist/ts-eslint/ESLint.js.map +0 -1
  99. package/dist/ts-eslint/Linter.d.ts +0 -323
  100. package/dist/ts-eslint/Linter.d.ts.map +0 -1
  101. package/dist/ts-eslint/Linter.js +0 -14
  102. package/dist/ts-eslint/Linter.js.map +0 -1
  103. package/dist/ts-eslint/ParserOptions.d.ts +0 -2
  104. package/dist/ts-eslint/ParserOptions.d.ts.map +0 -1
  105. package/dist/ts-eslint/ParserOptions.js +0 -3
  106. package/dist/ts-eslint/ParserOptions.js.map +0 -1
  107. package/dist/ts-eslint/Rule.d.ts +0 -389
  108. package/dist/ts-eslint/Rule.d.ts.map +0 -1
  109. package/dist/ts-eslint/Rule.js +0 -3
  110. package/dist/ts-eslint/Rule.js.map +0 -1
  111. package/dist/ts-eslint/RuleTester.d.ts +0 -152
  112. package/dist/ts-eslint/RuleTester.d.ts.map +0 -1
  113. package/dist/ts-eslint/RuleTester.js +0 -8
  114. package/dist/ts-eslint/RuleTester.js.map +0 -1
  115. package/dist/ts-eslint/Scope.d.ts +0 -44
  116. package/dist/ts-eslint/Scope.d.ts.map +0 -1
  117. package/dist/ts-eslint/Scope.js +0 -31
  118. package/dist/ts-eslint/Scope.js.map +0 -1
  119. package/dist/ts-eslint/SourceCode.d.ts +0 -343
  120. package/dist/ts-eslint/SourceCode.d.ts.map +0 -1
  121. package/dist/ts-eslint/SourceCode.js +0 -9
  122. package/dist/ts-eslint/SourceCode.js.map +0 -1
  123. package/dist/ts-eslint/index.d.ts +0 -10
  124. package/dist/ts-eslint/index.d.ts.map +0 -1
  125. package/dist/ts-eslint/index.js +0 -22
  126. package/dist/ts-eslint/index.js.map +0 -1
  127. package/dist/ts-eslint-scope/Definition.d.ts +0 -19
  128. package/dist/ts-eslint-scope/Definition.d.ts.map +0 -1
  129. package/dist/ts-eslint-scope/Definition.js +0 -9
  130. package/dist/ts-eslint-scope/Definition.js.map +0 -1
  131. package/dist/ts-eslint-scope/Options.d.ts +0 -15
  132. package/dist/ts-eslint-scope/Options.d.ts.map +0 -1
  133. package/dist/ts-eslint-scope/Options.js +0 -3
  134. package/dist/ts-eslint-scope/Options.js.map +0 -1
  135. package/dist/ts-eslint-scope/PatternVisitor.d.ts +0 -25
  136. package/dist/ts-eslint-scope/PatternVisitor.d.ts.map +0 -1
  137. package/dist/ts-eslint-scope/PatternVisitor.js +0 -10
  138. package/dist/ts-eslint-scope/PatternVisitor.js.map +0 -1
  139. package/dist/ts-eslint-scope/Reference.d.ts +0 -28
  140. package/dist/ts-eslint-scope/Reference.d.ts.map +0 -1
  141. package/dist/ts-eslint-scope/Reference.js +0 -10
  142. package/dist/ts-eslint-scope/Reference.js.map +0 -1
  143. package/dist/ts-eslint-scope/Referencer.d.ts +0 -55
  144. package/dist/ts-eslint-scope/Referencer.d.ts.map +0 -1
  145. package/dist/ts-eslint-scope/Referencer.js +0 -11
  146. package/dist/ts-eslint-scope/Referencer.js.map +0 -1
  147. package/dist/ts-eslint-scope/Scope.d.ts +0 -103
  148. package/dist/ts-eslint-scope/Scope.d.ts.map +0 -1
  149. package/dist/ts-eslint-scope/Scope.js +0 -28
  150. package/dist/ts-eslint-scope/Scope.js.map +0 -1
  151. package/dist/ts-eslint-scope/ScopeManager.d.ts +0 -50
  152. package/dist/ts-eslint-scope/ScopeManager.d.ts.map +0 -1
  153. package/dist/ts-eslint-scope/ScopeManager.js +0 -10
  154. package/dist/ts-eslint-scope/ScopeManager.js.map +0 -1
  155. package/dist/ts-eslint-scope/Variable.d.ts +0 -17
  156. package/dist/ts-eslint-scope/Variable.d.ts.map +0 -1
  157. package/dist/ts-eslint-scope/Variable.js +0 -10
  158. package/dist/ts-eslint-scope/Variable.js.map +0 -1
  159. package/dist/ts-eslint-scope/analyze.d.ts +0 -16
  160. package/dist/ts-eslint-scope/analyze.d.ts.map +0 -1
  161. package/dist/ts-eslint-scope/analyze.js +0 -7
  162. package/dist/ts-eslint-scope/analyze.js.map +0 -1
  163. package/dist/ts-eslint-scope/index.d.ts +0 -11
  164. package/dist/ts-eslint-scope/index.d.ts.map +0 -1
  165. package/dist/ts-eslint-scope/index.js +0 -25
  166. package/dist/ts-eslint-scope/index.js.map +0 -1
  167. package/dist/ts-estree.d.ts +0 -3
  168. package/dist/ts-estree.d.ts.map +0 -1
  169. package/dist/ts-estree.js +0 -10
  170. package/dist/ts-estree.js.map +0 -1
package/README.md CHANGED
@@ -4,33 +4,21 @@
4
4
 
5
5
  <p align="center">
6
6
  <img src="https://github.com/typescript-eslint/typescript-eslint/workflows/CI/badge.svg" alt="CI" />
7
- <a href="https://www.npmjs.com/package/@typescript-eslint/eslint-plugin"><img src="https://img.shields.io/npm/v/@typescript-eslint/eslint-plugin.svg?style=flat-square" alt="NPM Version" /></a>
8
- <a href="https://www.npmjs.com/package/@typescript-eslint/eslint-plugin"><img src="https://img.shields.io/npm/dm/@typescript-eslint/eslint-plugin.svg?style=flat-square" alt="NPM Downloads" /></a>
7
+ <a href="https://www.npmjs.com/package/@typescript-eslint/experimental-utils"><img src="https://img.shields.io/npm/v/@typescript-eslint/experimental-utils.svg?style=flat-square" alt="NPM Version" /></a>
8
+ <a href="https://www.npmjs.com/package/@typescript-eslint/experimental-utils"><img src="https://img.shields.io/npm/dm/@typescript-eslint/experimental-utils.svg?style=flat-square" alt="NPM Downloads" /></a>
9
9
  </p>
10
10
 
11
11
  ## Note
12
12
 
13
- This package has inherited its version number from the `@typescript-eslint` project.
14
- Meaning that even though this package is `2.x.y`, you shouldn't expect 100% stability between minor version bumps.
15
- i.e. treat it as a `0.x.y` package.
13
+ **This package is purely a re-export of `@typescript-eslint/utils`.**
14
+ You should switch to importing from that non-experimental package instead.
16
15
 
17
- Feel free to use it now, and let us know what utilities you need or send us PRs with utilities you build on top of it.
16
+ ```diff
17
+ - import { RuleCreator } from '@typescript-eslint/experimental-utils';
18
+ + import { RuleCreator } from '@typescript-eslint/utils';
19
+ ```
18
20
 
19
- Once it is stable, it will be renamed to `@typescript-eslint/util` for a `6.0.0` release.
20
-
21
- ## Exports
22
-
23
- | Name | Description |
24
- | -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
25
- | [`ASTUtils`](./src/ast-utils) | Tools for operating on the ESTree AST. Also includes the [`eslint-utils`](https://www.npmjs.com/package/eslint-utils) package, correctly typed to work with the types found in `TSESTree` |
26
- | [`ESLintUtils`](./src/eslint-utils) | Tools for creating ESLint rules with TypeScript. |
27
- | `JSONSchema` | Types from the [`@types/json-schema`](https://www.npmjs.com/package/@types/json-schema) package, re-exported to save you having to manually import them. Also ensures you're using the same version of the types as this package. |
28
- | [`TSESLint`](./src/ts-eslint) | Types for ESLint, correctly typed to work with the types found in `TSESTree`. |
29
- | [`TSESLintScope`](./src/ts-eslint-scope) | The [`eslint-scope`](https://www.npmjs.com/package/eslint-scope) package, correctly typed to work with the types found in both `TSESTree` and `TSESLint` |
30
- | [`TSESTree`](../types/src/ts-estree.ts) | Types for the TypeScript flavor of ESTree created by `@typescript-eslint/typescript-estree`. |
31
- | [`AST_NODE_TYPES`](../types/src/ast-node-types.ts) | An enum with the names of every single _node_ found in `TSESTree`. |
32
- | [`AST_TOKEN_TYPES`](../types/src/ast-token-types.ts) | An enum with the names of every single _token_ found in `TSESTree`. |
33
- | [`ParserServices`](../typescript-estree/src/parser-options.ts) | Typing for the parser services provided when parsing a file using `@typescript-eslint/typescript-estree`. |
21
+ > A future major version of this old package will `console.warn` to ask you to switch.
34
22
 
35
23
  ## Contributing
36
24
 
package/dist/index.d.ts CHANGED
@@ -1,8 +1,2 @@
1
- import * as ASTUtils from './ast-utils';
2
- import * as ESLintUtils from './eslint-utils';
3
- import * as JSONSchema from './json-schema';
4
- import * as TSESLint from './ts-eslint';
5
- import * as TSESLintScope from './ts-eslint-scope';
6
- export { ASTUtils, ESLintUtils, JSONSchema, TSESLint, TSESLintScope };
7
- export * from './ts-estree';
1
+ export * from '@typescript-eslint/utils';
8
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,aAAa,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AACtE,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,0BAA0B,CAAC"}
package/dist/index.js CHANGED
@@ -6,32 +6,10 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
6
6
  if (k2 === undefined) k2 = k;
7
7
  o[k2] = m[k];
8
8
  }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
9
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
22
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23
11
  };
24
12
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.TSESLintScope = exports.TSESLint = exports.JSONSchema = exports.ESLintUtils = exports.ASTUtils = void 0;
26
- const ASTUtils = __importStar(require("./ast-utils"));
27
- exports.ASTUtils = ASTUtils;
28
- const ESLintUtils = __importStar(require("./eslint-utils"));
29
- exports.ESLintUtils = ESLintUtils;
30
- const JSONSchema = __importStar(require("./json-schema"));
31
- exports.JSONSchema = JSONSchema;
32
- const TSESLint = __importStar(require("./ts-eslint"));
33
- exports.TSESLint = TSESLint;
34
- const TSESLintScope = __importStar(require("./ts-eslint-scope"));
35
- exports.TSESLintScope = TSESLintScope;
36
- __exportStar(require("./ts-estree"), exports);
13
+ // TODO (#4139): Once typescript-eslint hits v7, this package will console.warn to switch...
14
+ __exportStar(require("@typescript-eslint/utils"), exports);
37
15
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAwC;AAM/B,4BAAQ;AALjB,4DAA8C;AAK3B,kCAAW;AAJ9B,0DAA4C;AAIZ,gCAAU;AAH1C,sDAAwC;AAGI,4BAAQ;AAFpD,iEAAmD;AAEG,sCAAa;AACnE,8CAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4FAA4F;AAC5F,2DAAyC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typescript-eslint/experimental-utils",
3
- "version": "5.9.2-alpha.4+e61e388a",
3
+ "version": "5.10.0",
4
4
  "description": "(Experimental) Utilities for working with TypeScript + ESLint together",
5
5
  "keywords": [
6
6
  "eslint",
@@ -35,16 +35,10 @@
35
35
  "postclean": "rimraf dist && rimraf _ts3.4 && rimraf coverage",
36
36
  "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore",
37
37
  "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'",
38
- "test": "jest --coverage",
39
38
  "typecheck": "tsc -p tsconfig.json --noEmit"
40
39
  },
41
40
  "dependencies": {
42
- "@types/json-schema": "^7.0.9",
43
- "@typescript-eslint/scope-manager": "5.9.2-alpha.4+e61e388a",
44
- "@typescript-eslint/types": "5.9.2-alpha.4+e61e388a",
45
- "@typescript-eslint/typescript-estree": "5.9.2-alpha.4+e61e388a",
46
- "eslint-scope": "^5.1.1",
47
- "eslint-utils": "^3.0.0"
41
+ "@typescript-eslint/utils": "5.10.0"
48
42
  },
49
43
  "peerDependencies": {
50
44
  "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
@@ -56,12 +50,5 @@
56
50
  "type": "opencollective",
57
51
  "url": "https://opencollective.com/typescript-eslint"
58
52
  },
59
- "typesVersions": {
60
- "<3.8": {
61
- "*": [
62
- "_ts3.4/*"
63
- ]
64
- }
65
- },
66
- "gitHead": "e61e388a9820fae393bb76f7e484079515166972"
53
+ "gitHead": "88941065097ce71a0e385cb2e00c1b263dbc69ab"
67
54
  }
@@ -1,48 +0,0 @@
1
- interface PatternMatcher {
2
- /**
3
- * Iterate all matched parts in a given string.
4
- *
5
- * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#matcher-execall}
6
- */
7
- execAll(str: string): IterableIterator<RegExpExecArray>;
8
- /**
9
- * Check whether this pattern matches a given string or not.
10
- *
11
- * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#matcher-test}
12
- */
13
- test(str: string): boolean;
14
- /**
15
- * Replace all matched parts by a given replacer.
16
- *
17
- * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#matcher-symbol-replace}
18
- * @example
19
- * const { PatternMatcher } = require("eslint-utils")
20
- * const matcher = new PatternMatcher(/\\p{Script=Greek}/g)
21
- *
22
- * module.exports = {
23
- * meta: {},
24
- * create(context) {
25
- * return {
26
- * "Literal[regex]"(node) {
27
- * const replacedPattern = node.regex.pattern.replace(
28
- * matcher,
29
- * "[\\u0370-\\u0373\\u0375-\\u0377\\u037A-\\u037D\\u037F\\u0384\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03E1\\u03F0-\\u03FF\\u1D26-\\u1D2A\\u1D5D-\\u1D61\\u1D66-\\u1D6A\\u1DBF\\u1F00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FC4\\u1FC6-\\u1FD3\\u1FD6-\\u1FDB\\u1FDD-\\u1FEF\\u1FF2-\\u1FF4\\u1FF6-\\u1FFE\\u2126\\uAB65]|\\uD800[\\uDD40-\\uDD8E\\uDDA0]|\\uD834[\\uDE00-\\uDE45]"
30
- * )
31
- * },
32
- * }
33
- * },
34
- * }
35
- */
36
- [Symbol.replace](str: string, replacer: string | ((...strs: string[]) => string)): string;
37
- }
38
- /**
39
- * The class to find a pattern in strings as handling escape sequences.
40
- * It ignores the found pattern if it's escaped with `\`.
41
- *
42
- * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#patternmatcher-class}
43
- */
44
- declare const PatternMatcher: new (pattern: RegExp, options?: {
45
- escaped?: boolean | undefined;
46
- } | undefined) => PatternMatcher;
47
- export { PatternMatcher };
48
- //# sourceMappingURL=PatternMatcher.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PatternMatcher.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/PatternMatcher.ts"],"names":[],"mappings":"AAEA,UAAU,cAAc;IACtB;;;;OAIG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAExD;;;;OAIG;IACH,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAE3B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC,CACd,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC,GACjD,MAAM,CAAC;CACX;AAED;;;;;GAKG;AACH,QAAA,MAAM,cAAc,gBACJ,MAAM;;kBAAoC,cACzD,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.PatternMatcher = void 0;
23
- const eslintUtils = __importStar(require("eslint-utils"));
24
- /**
25
- * The class to find a pattern in strings as handling escape sequences.
26
- * It ignores the found pattern if it's escaped with `\`.
27
- *
28
- * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#patternmatcher-class}
29
- */
30
- const PatternMatcher = eslintUtils.PatternMatcher;
31
- exports.PatternMatcher = PatternMatcher;
32
- //# sourceMappingURL=PatternMatcher.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PatternMatcher.js","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/PatternMatcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AA6C5C;;;;;GAKG;AACH,MAAM,cAAc,GAAG,WAAW,CAAC,cAElC,CAAC;AAEO,wCAAc"}
@@ -1,76 +0,0 @@
1
- import { TSESTree } from '../../ts-estree';
2
- import * as TSESLint from '../../ts-eslint';
3
- declare const ReferenceTrackerREAD: unique symbol;
4
- declare const ReferenceTrackerCALL: unique symbol;
5
- declare const ReferenceTrackerCONSTRUCT: unique symbol;
6
- declare const ReferenceTrackerESM: unique symbol;
7
- interface ReferenceTracker {
8
- /**
9
- * Iterate the references that the given `traceMap` determined.
10
- * This method starts to search from global variables.
11
- *
12
- * @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#tracker-iterateglobalreferences}
13
- */
14
- iterateGlobalReferences<T>(traceMap: ReferenceTracker.TraceMap<T>): IterableIterator<ReferenceTracker.FoundReference<T>>;
15
- /**
16
- * Iterate the references that the given `traceMap` determined.
17
- * This method starts to search from `require()` expression.
18
- *
19
- * @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#tracker-iteratecjsreferences}
20
- */
21
- iterateCjsReferences<T>(traceMap: ReferenceTracker.TraceMap<T>): IterableIterator<ReferenceTracker.FoundReference<T>>;
22
- /**
23
- * Iterate the references that the given `traceMap` determined.
24
- * This method starts to search from `import`/`export` declarations.
25
- *
26
- * @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#tracker-iterateesmreferences}
27
- */
28
- iterateEsmReferences<T>(traceMap: ReferenceTracker.TraceMap<T>): IterableIterator<ReferenceTracker.FoundReference<T>>;
29
- }
30
- interface ReferenceTrackerStatic {
31
- new (globalScope: TSESLint.Scope.Scope, options?: {
32
- /**
33
- * The mode which determines how the `tracker.iterateEsmReferences()` method scans CommonJS modules.
34
- * If this is `"strict"`, the method binds CommonJS modules to the default export. Otherwise, the method binds
35
- * CommonJS modules to both the default export and named exports. Optional. Default is `"strict"`.
36
- */
37
- mode?: 'strict' | 'legacy';
38
- /**
39
- * The name list of Global Object. Optional. Default is `["global", "globalThis", "self", "window"]`.
40
- */
41
- globalObjectNames?: readonly string[];
42
- }): ReferenceTracker;
43
- readonly READ: typeof ReferenceTrackerREAD;
44
- readonly CALL: typeof ReferenceTrackerCALL;
45
- readonly CONSTRUCT: typeof ReferenceTrackerCONSTRUCT;
46
- readonly ESM: typeof ReferenceTrackerESM;
47
- }
48
- declare namespace ReferenceTracker {
49
- type READ = ReferenceTrackerStatic['READ'];
50
- type CALL = ReferenceTrackerStatic['CALL'];
51
- type CONSTRUCT = ReferenceTrackerStatic['CONSTRUCT'];
52
- type ESM = ReferenceTrackerStatic['ESM'];
53
- type ReferenceType = READ | CALL | CONSTRUCT;
54
- type TraceMap<T = any> = Record<string, TraceMapElement<T>>;
55
- interface TraceMapElement<T> {
56
- [ReferenceTrackerREAD]?: T;
57
- [ReferenceTrackerCALL]?: T;
58
- [ReferenceTrackerCONSTRUCT]?: T;
59
- [ReferenceTrackerESM]?: true;
60
- [key: string]: TraceMapElement<T>;
61
- }
62
- interface FoundReference<T = any> {
63
- node: TSESTree.Node;
64
- path: readonly string[];
65
- type: ReferenceType;
66
- info: T;
67
- }
68
- }
69
- /**
70
- * The tracker for references. This provides reference tracking for global variables, CommonJS modules, and ES modules.
71
- *
72
- * @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#referencetracker-class}
73
- */
74
- declare const ReferenceTracker: ReferenceTrackerStatic;
75
- export { ReferenceTracker };
76
- //# sourceMappingURL=ReferenceTracker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReferenceTracker.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/ReferenceTracker.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,QAAA,MAAM,oBAAoB,EAAE,OAAO,MAA0C,CAAC;AAC9E,QAAA,MAAM,oBAAoB,EAAE,OAAO,MAA0C,CAAC;AAC9E,QAAA,MAAM,yBAAyB,EAAE,OAAO,MACA,CAAC;AACzC,QAAA,MAAM,mBAAmB,EAAE,OAAO,MAAyC,CAAC;AAE5E,UAAU,gBAAgB;IACxB;;;;;OAKG;IACH,uBAAuB,CAAC,CAAC,EACvB,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,GACrC,gBAAgB,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAExD;;;;;OAKG;IACH,oBAAoB,CAAC,CAAC,EACpB,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,GACrC,gBAAgB,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAExD;;;;;OAKG;IACH,oBAAoB,CAAC,CAAC,EACpB,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,GACrC,gBAAgB,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;CACzD;AACD,UAAU,sBAAsB;IAC9B,KACE,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,EACjC,OAAO,CAAC,EAAE;QACR;;;;WAIG;QACH,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;QAC3B;;WAEG;QACH,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;KACvC,GACA,gBAAgB,CAAC;IAEpB,QAAQ,CAAC,IAAI,EAAE,OAAO,oBAAoB,CAAC;IAC3C,QAAQ,CAAC,IAAI,EAAE,OAAO,oBAAoB,CAAC;IAC3C,QAAQ,CAAC,SAAS,EAAE,OAAO,yBAAyB,CAAC;IACrD,QAAQ,CAAC,GAAG,EAAE,OAAO,mBAAmB,CAAC;CAC1C;AAED,kBAAU,gBAAgB,CAAC;IACzB,KAAY,IAAI,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAClD,KAAY,IAAI,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAClD,KAAY,SAAS,GAAG,sBAAsB,CAAC,WAAW,CAAC,CAAC;IAC5D,KAAY,GAAG,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAChD,KAAY,aAAa,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;IAEpD,KAAY,QAAQ,CAAC,CAAC,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,UAAiB,eAAe,CAAC,CAAC;QAChC,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC;QAC3B,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC;QAC3B,CAAC,yBAAyB,CAAC,CAAC,EAAE,CAAC,CAAC;QAChC,CAAC,mBAAmB,CAAC,CAAC,EAAE,IAAI,CAAC;QAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;KACnC;IAED,UAAiB,cAAc,CAAC,CAAC,GAAG,GAAG;QACrC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;QACpB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;QACxB,IAAI,EAAE,aAAa,CAAC;QACpB,IAAI,EAAE,CAAC,CAAC;KACT;CACF;AAED;;;;GAIG;AACH,QAAA,MAAM,gBAAgB,wBAAyD,CAAC;AAEhF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,36 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.ReferenceTracker = void 0;
23
- /* eslint-disable @typescript-eslint/no-namespace */
24
- const eslintUtils = __importStar(require("eslint-utils"));
25
- const ReferenceTrackerREAD = eslintUtils.ReferenceTracker.READ;
26
- const ReferenceTrackerCALL = eslintUtils.ReferenceTracker.CALL;
27
- const ReferenceTrackerCONSTRUCT = eslintUtils.ReferenceTracker.CONSTRUCT;
28
- const ReferenceTrackerESM = eslintUtils.ReferenceTracker.ESM;
29
- /**
30
- * The tracker for references. This provides reference tracking for global variables, CommonJS modules, and ES modules.
31
- *
32
- * @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#referencetracker-class}
33
- */
34
- const ReferenceTracker = eslintUtils.ReferenceTracker;
35
- exports.ReferenceTracker = ReferenceTracker;
36
- //# sourceMappingURL=ReferenceTracker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReferenceTracker.js","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/ReferenceTracker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAoD;AACpD,0DAA4C;AAI5C,MAAM,oBAAoB,GAAkB,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC;AAC9E,MAAM,oBAAoB,GAAkB,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC;AAC9E,MAAM,yBAAyB,GAC7B,WAAW,CAAC,gBAAgB,CAAC,SAAS,CAAC;AACzC,MAAM,mBAAmB,GAAkB,WAAW,CAAC,gBAAgB,CAAC,GAAG,CAAC;AAgF5E;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,WAAW,CAAC,gBAA0C,CAAC;AAEvE,4CAAgB"}
@@ -1,76 +0,0 @@
1
- import * as TSESLint from '../../ts-eslint';
2
- import { TSESTree } from '../../ts-estree';
3
- /**
4
- * Get the proper location of a given function node to report.
5
- *
6
- * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getfunctionheadlocation}
7
- */
8
- declare const getFunctionHeadLocation: (node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression, sourceCode: TSESLint.SourceCode) => TSESTree.SourceLocation;
9
- /**
10
- * Get the name and kind of a given function node.
11
- *
12
- * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getfunctionnamewithkind}
13
- */
14
- declare const getFunctionNameWithKind: (node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression, sourceCode?: TSESLint.SourceCode | undefined) => string;
15
- /**
16
- * Get the property name of a given property node.
17
- * If the node is a computed property, this tries to compute the property name by the getStringIfConstant function.
18
- *
19
- * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getpropertyname}
20
- * @returns The property name of the node. If the property name is not constant then it returns `null`.
21
- */
22
- declare const getPropertyName: (node: TSESTree.MemberExpression | TSESTree.Property | TSESTree.MethodDefinition | TSESTree.PropertyDefinition, initialScope?: import("@typescript-eslint/scope-manager/dist/scope/Scope").Scope | undefined) => string | null;
23
- /**
24
- * Get the value of a given node if it can decide the value statically.
25
- * If the 2nd parameter `initialScope` was given, this function tries to resolve identifier references which are in the
26
- * given node as much as possible. In the resolving way, it does on the assumption that built-in global objects have
27
- * not been modified.
28
- * For example, it considers `Symbol.iterator`, ` String.raw``hello`` `, and `Object.freeze({a: 1}).a` as static.
29
- *
30
- * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstaticvalue}
31
- * @returns The `{ value: any }` shaped object. The `value` property is the static value. If it couldn't compute the
32
- * static value of the node, it returns `null`.
33
- */
34
- declare const getStaticValue: (node: TSESTree.Node, initialScope?: import("@typescript-eslint/scope-manager/dist/scope/Scope").Scope | undefined) => {
35
- value: unknown;
36
- } | null;
37
- /**
38
- * Get the string value of a given node.
39
- * This function is a tiny wrapper of the getStaticValue function.
40
- *
41
- * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstringifconstant}
42
- */
43
- declare const getStringIfConstant: (node: TSESTree.Node, initialScope?: import("@typescript-eslint/scope-manager/dist/scope/Scope").Scope | undefined) => string | null;
44
- /**
45
- * Check whether a given node has any side effect or not.
46
- * The side effect means that it may modify a certain variable or object member. This function considers the node which
47
- * contains the following types as the node which has side effects:
48
- * - `AssignmentExpression`
49
- * - `AwaitExpression`
50
- * - `CallExpression`
51
- * - `ImportExpression`
52
- * - `NewExpression`
53
- * - `UnaryExpression([operator = "delete"])`
54
- * - `UpdateExpression`
55
- * - `YieldExpression`
56
- * - When `options.considerGetters` is `true`:
57
- * - `MemberExpression`
58
- * - When `options.considerImplicitTypeConversion` is `true`:
59
- * - `BinaryExpression([operator = "==" | "!=" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in"])`
60
- * - `MemberExpression([computed = true])`
61
- * - `MethodDefinition([computed = true])`
62
- * - `Property([computed = true])`
63
- * - `UnaryExpression([operator = "-" | "+" | "!" | "~"])`
64
- *
65
- * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#hassideeffect}
66
- */
67
- declare const hasSideEffect: (node: TSESTree.Node, sourceCode: TSESLint.SourceCode, options?: {
68
- considerGetters?: boolean | undefined;
69
- considerImplicitTypeConversion?: boolean | undefined;
70
- } | undefined) => boolean;
71
- declare const isParenthesized: {
72
- (node: TSESTree.Node, sourceCode: TSESLint.SourceCode): boolean;
73
- (times: number, node: TSESTree.Node, sourceCode: TSESLint.SourceCode): boolean;
74
- };
75
- export { getFunctionHeadLocation, getFunctionNameWithKind, getPropertyName, getStaticValue, getStringIfConstant, hasSideEffect, isParenthesized, };
76
- //# sourceMappingURL=astUtilities.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"astUtilities.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/astUtilities.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;;;GAIG;AACH,QAAA,MAAM,uBAAuB,SAEvB,SAAS,mBAAmB,GAC5B,SAAS,kBAAkB,GAC3B,SAAS,uBAAuB,cACxB,SAAS,UAAU,KAC5B,SAAS,cAAc,CAAC;AAE7B;;;;GAIG;AACH,QAAA,MAAM,uBAAuB,SAEvB,SAAS,mBAAmB,GAC5B,SAAS,kBAAkB,GAC3B,SAAS,uBAAuB,mDAEjC,MAAM,CAAC;AAEZ;;;;;;GAMG;AACH,QAAA,MAAM,eAAe,SAEf,SAAS,gBAAgB,GACzB,SAAS,QAAQ,GACjB,SAAS,gBAAgB,GACzB,SAAS,kBAAkB,mGAE5B,MAAM,GAAG,IAAI,CAAC;AAEnB;;;;;;;;;;GAUG;AACH,QAAA,MAAM,cAAc,SACZ,SAAS,IAAI,mGAEhB;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAAC;AAE/B;;;;;GAKG;AACH,QAAA,MAAM,mBAAmB,SACjB,SAAS,IAAI,mGAEhB,MAAM,GAAG,IAAI,CAAC;AAEnB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,aAAa,SACX,SAAS,IAAI,cACP,SAAS,UAAU;;;kBAK5B,OAAO,CAAC;AAEb,QAAA,MAAM,eAAe;WAUZ,SAAS,IAAI,cAAc,SAAS,UAAU,GAAG,OAAO;YAEtD,MAAM,QACP,SAAS,IAAI,cACP,SAAS,UAAU,GAC9B,OAAO;CACX,CAAC;AAEF,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,eAAe,GAChB,CAAC"}
@@ -1,95 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.isParenthesized = exports.hasSideEffect = exports.getStringIfConstant = exports.getStaticValue = exports.getPropertyName = exports.getFunctionNameWithKind = exports.getFunctionHeadLocation = void 0;
23
- const eslintUtils = __importStar(require("eslint-utils"));
24
- /**
25
- * Get the proper location of a given function node to report.
26
- *
27
- * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getfunctionheadlocation}
28
- */
29
- const getFunctionHeadLocation = eslintUtils.getFunctionHeadLocation;
30
- exports.getFunctionHeadLocation = getFunctionHeadLocation;
31
- /**
32
- * Get the name and kind of a given function node.
33
- *
34
- * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getfunctionnamewithkind}
35
- */
36
- const getFunctionNameWithKind = eslintUtils.getFunctionNameWithKind;
37
- exports.getFunctionNameWithKind = getFunctionNameWithKind;
38
- /**
39
- * Get the property name of a given property node.
40
- * If the node is a computed property, this tries to compute the property name by the getStringIfConstant function.
41
- *
42
- * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getpropertyname}
43
- * @returns The property name of the node. If the property name is not constant then it returns `null`.
44
- */
45
- const getPropertyName = eslintUtils.getPropertyName;
46
- exports.getPropertyName = getPropertyName;
47
- /**
48
- * Get the value of a given node if it can decide the value statically.
49
- * If the 2nd parameter `initialScope` was given, this function tries to resolve identifier references which are in the
50
- * given node as much as possible. In the resolving way, it does on the assumption that built-in global objects have
51
- * not been modified.
52
- * For example, it considers `Symbol.iterator`, ` String.raw``hello`` `, and `Object.freeze({a: 1}).a` as static.
53
- *
54
- * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstaticvalue}
55
- * @returns The `{ value: any }` shaped object. The `value` property is the static value. If it couldn't compute the
56
- * static value of the node, it returns `null`.
57
- */
58
- const getStaticValue = eslintUtils.getStaticValue;
59
- exports.getStaticValue = getStaticValue;
60
- /**
61
- * Get the string value of a given node.
62
- * This function is a tiny wrapper of the getStaticValue function.
63
- *
64
- * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstringifconstant}
65
- */
66
- const getStringIfConstant = eslintUtils.getStringIfConstant;
67
- exports.getStringIfConstant = getStringIfConstant;
68
- /**
69
- * Check whether a given node has any side effect or not.
70
- * The side effect means that it may modify a certain variable or object member. This function considers the node which
71
- * contains the following types as the node which has side effects:
72
- * - `AssignmentExpression`
73
- * - `AwaitExpression`
74
- * - `CallExpression`
75
- * - `ImportExpression`
76
- * - `NewExpression`
77
- * - `UnaryExpression([operator = "delete"])`
78
- * - `UpdateExpression`
79
- * - `YieldExpression`
80
- * - When `options.considerGetters` is `true`:
81
- * - `MemberExpression`
82
- * - When `options.considerImplicitTypeConversion` is `true`:
83
- * - `BinaryExpression([operator = "==" | "!=" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in"])`
84
- * - `MemberExpression([computed = true])`
85
- * - `MethodDefinition([computed = true])`
86
- * - `Property([computed = true])`
87
- * - `UnaryExpression([operator = "-" | "+" | "!" | "~"])`
88
- *
89
- * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#hassideeffect}
90
- */
91
- const hasSideEffect = eslintUtils.hasSideEffect;
92
- exports.hasSideEffect = hasSideEffect;
93
- const isParenthesized = eslintUtils.isParenthesized;
94
- exports.isParenthesized = isParenthesized;
95
- //# sourceMappingURL=astUtilities.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"astUtilities.js","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/astUtilities.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AAI5C;;;;GAIG;AACH,MAAM,uBAAuB,GAAG,WAAW,CAAC,uBAMhB,CAAC;AA6G3B,0DAAuB;AA3GzB;;;;GAIG;AACH,MAAM,uBAAuB,GAAG,WAAW,CAAC,uBAMjC,CAAC;AAiGV,0DAAuB;AA/FzB;;;;;;GAMG;AACH,MAAM,eAAe,GAAG,WAAW,CAAC,eAOlB,CAAC;AAkFjB,0CAAe;AAhFjB;;;;;;;;;;GAUG;AACH,MAAM,cAAc,GAAG,WAAW,CAAC,cAGL,CAAC;AAmE7B,wCAAc;AAjEhB;;;;;GAKG;AACH,MAAM,mBAAmB,GAAG,WAAW,CAAC,mBAGtB,CAAC;AAyDjB,kDAAmB;AAvDrB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,aAAa,GAAG,WAAW,CAAC,aAOtB,CAAC;AA0BX,sCAAa;AAxBf,MAAM,eAAe,GAAG,WAAW,CAAC,eAgBnC,CAAC;AASA,0CAAe"}
@@ -1,6 +0,0 @@
1
- export * from './astUtilities';
2
- export * from './PatternMatcher';
3
- export * from './predicates';
4
- export * from './ReferenceTracker';
5
- export * from './scopeAnalysis';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./astUtilities"), exports);
14
- __exportStar(require("./PatternMatcher"), exports);
15
- __exportStar(require("./predicates"), exports);
16
- __exportStar(require("./ReferenceTracker"), exports);
17
- __exportStar(require("./scopeAnalysis"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA+B;AAC/B,mDAAiC;AACjC,+CAA6B;AAC7B,qDAAmC;AACnC,kDAAgC"}
@@ -1,32 +0,0 @@
1
- import { TSESTree } from '../../ts-estree';
2
- declare type IsSpecificTokenFunction<SpecificToken extends TSESTree.Token> = (token: TSESTree.Token) => token is SpecificToken;
3
- declare type IsNotSpecificTokenFunction<SpecificToken extends TSESTree.Token> = (token: TSESTree.Token) => token is Exclude<TSESTree.Token, SpecificToken>;
4
- declare type PunctuatorTokenWithValue<Value extends string> = TSESTree.PunctuatorToken & {
5
- value: Value;
6
- };
7
- declare type IsPunctuatorTokenWithValueFunction<Value extends string> = IsSpecificTokenFunction<PunctuatorTokenWithValue<Value>>;
8
- declare type IsNotPunctuatorTokenWithValueFunction<Value extends string> = IsNotSpecificTokenFunction<PunctuatorTokenWithValue<Value>>;
9
- declare const isArrowToken: IsPunctuatorTokenWithValueFunction<"=>">;
10
- declare const isNotArrowToken: IsNotPunctuatorTokenWithValueFunction<"=>">;
11
- declare const isClosingBraceToken: IsPunctuatorTokenWithValueFunction<"}">;
12
- declare const isNotClosingBraceToken: IsNotPunctuatorTokenWithValueFunction<"}">;
13
- declare const isClosingBracketToken: IsPunctuatorTokenWithValueFunction<"]">;
14
- declare const isNotClosingBracketToken: IsNotPunctuatorTokenWithValueFunction<"]">;
15
- declare const isClosingParenToken: IsPunctuatorTokenWithValueFunction<")">;
16
- declare const isNotClosingParenToken: IsNotPunctuatorTokenWithValueFunction<")">;
17
- declare const isColonToken: IsPunctuatorTokenWithValueFunction<":">;
18
- declare const isNotColonToken: IsNotPunctuatorTokenWithValueFunction<":">;
19
- declare const isCommaToken: IsPunctuatorTokenWithValueFunction<",">;
20
- declare const isNotCommaToken: IsNotPunctuatorTokenWithValueFunction<",">;
21
- declare const isCommentToken: IsSpecificTokenFunction<TSESTree.Comment>;
22
- declare const isNotCommentToken: IsNotSpecificTokenFunction<TSESTree.Comment>;
23
- declare const isOpeningBraceToken: IsPunctuatorTokenWithValueFunction<"{">;
24
- declare const isNotOpeningBraceToken: IsNotPunctuatorTokenWithValueFunction<"{">;
25
- declare const isOpeningBracketToken: IsPunctuatorTokenWithValueFunction<"[">;
26
- declare const isNotOpeningBracketToken: IsNotPunctuatorTokenWithValueFunction<"[">;
27
- declare const isOpeningParenToken: IsPunctuatorTokenWithValueFunction<"(">;
28
- declare const isNotOpeningParenToken: IsNotPunctuatorTokenWithValueFunction<"(">;
29
- declare const isSemicolonToken: IsPunctuatorTokenWithValueFunction<";">;
30
- declare const isNotSemicolonToken: IsNotPunctuatorTokenWithValueFunction<";">;
31
- export { isArrowToken, isClosingBraceToken, isClosingBracketToken, isClosingParenToken, isColonToken, isCommaToken, isCommentToken, isNotArrowToken, isNotClosingBraceToken, isNotClosingBracketToken, isNotClosingParenToken, isNotColonToken, isNotCommaToken, isNotCommentToken, isNotOpeningBraceToken, isNotOpeningBracketToken, isNotOpeningParenToken, isNotSemicolonToken, isOpeningBraceToken, isOpeningBracketToken, isOpeningParenToken, isSemicolonToken, };
32
- //# sourceMappingURL=predicates.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"predicates.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/predicates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,aAAK,uBAAuB,CAAC,aAAa,SAAS,QAAQ,CAAC,KAAK,IAAI,CACnE,KAAK,EAAE,QAAQ,CAAC,KAAK,KAClB,KAAK,IAAI,aAAa,CAAC;AAE5B,aAAK,0BAA0B,CAAC,aAAa,SAAS,QAAQ,CAAC,KAAK,IAAI,CACtE,KAAK,EAAE,QAAQ,CAAC,KAAK,KAClB,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;AAErD,aAAK,wBAAwB,CAAC,KAAK,SAAS,MAAM,IAChD,QAAQ,CAAC,eAAe,GAAG;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC;AAC9C,aAAK,kCAAkC,CAAC,KAAK,SAAS,MAAM,IAC1D,uBAAuB,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAC;AAC3D,aAAK,qCAAqC,CAAC,KAAK,SAAS,MAAM,IAC7D,0BAA0B,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAC;AAE9D,QAAA,MAAM,YAAY,0CACoD,CAAC;AACvE,QAAA,MAAM,eAAe,6CACuD,CAAC;AAE7E,QAAA,MAAM,mBAAmB,yCACmD,CAAC;AAC7E,QAAA,MAAM,sBAAsB,4CACsD,CAAC;AAEnF,QAAA,MAAM,qBAAqB,yCACmD,CAAC;AAC/E,QAAA,MAAM,wBAAwB,4CACsD,CAAC;AAErF,QAAA,MAAM,mBAAmB,yCACmD,CAAC;AAC7E,QAAA,MAAM,sBAAsB,4CACsD,CAAC;AAEnF,QAAA,MAAM,YAAY,yCACmD,CAAC;AACtE,QAAA,MAAM,eAAe,4CACsD,CAAC;AAE5E,QAAA,MAAM,YAAY,yCACmD,CAAC;AACtE,QAAA,MAAM,eAAe,4CACsD,CAAC;AAE5E,QAAA,MAAM,cAAc,2CACqD,CAAC;AAC1E,QAAA,MAAM,iBAAiB,8CACwD,CAAC;AAEhF,QAAA,MAAM,mBAAmB,yCACmD,CAAC;AAC7E,QAAA,MAAM,sBAAsB,4CACsD,CAAC;AAEnF,QAAA,MAAM,qBAAqB,yCACmD,CAAC;AAC/E,QAAA,MAAM,wBAAwB,4CACsD,CAAC;AAErF,QAAA,MAAM,mBAAmB,yCACmD,CAAC;AAC7E,QAAA,MAAM,sBAAsB,4CACsD,CAAC;AAEnF,QAAA,MAAM,gBAAgB,yCACmD,CAAC;AAC1E,QAAA,MAAM,mBAAmB,4CACsD,CAAC;AAEhF,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,GACjB,CAAC"}