@depup/typescript-eslint__utils 8.57.1-depup.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 (82) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +25 -0
  3. package/changes.json +5 -0
  4. package/dist/ast-utils/eslint-utils/PatternMatcher.d.ts +47 -0
  5. package/dist/ast-utils/eslint-utils/PatternMatcher.js +44 -0
  6. package/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts +75 -0
  7. package/dist/ast-utils/eslint-utils/ReferenceTracker.js +48 -0
  8. package/dist/ast-utils/eslint-utils/astUtilities.d.ts +83 -0
  9. package/dist/ast-utils/eslint-utils/astUtilities.js +101 -0
  10. package/dist/ast-utils/eslint-utils/index.d.ts +5 -0
  11. package/dist/ast-utils/eslint-utils/index.js +21 -0
  12. package/dist/ast-utils/eslint-utils/predicates.d.ts +31 -0
  13. package/dist/ast-utils/eslint-utils/predicates.js +59 -0
  14. package/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts +16 -0
  15. package/dist/ast-utils/eslint-utils/scopeAnalysis.js +51 -0
  16. package/dist/ast-utils/helpers.d.ts +18 -0
  17. package/dist/ast-utils/helpers.js +21 -0
  18. package/dist/ast-utils/index.d.ts +4 -0
  19. package/dist/ast-utils/index.js +20 -0
  20. package/dist/ast-utils/misc.d.ts +6 -0
  21. package/dist/ast-utils/misc.js +11 -0
  22. package/dist/ast-utils/predicates.d.ts +68 -0
  23. package/dist/ast-utils/predicates.js +108 -0
  24. package/dist/eslint-utils/InferTypesFromRule.d.ts +9 -0
  25. package/dist/eslint-utils/InferTypesFromRule.js +2 -0
  26. package/dist/eslint-utils/RuleCreator.d.ts +32 -0
  27. package/dist/eslint-utils/RuleCreator.js +54 -0
  28. package/dist/eslint-utils/applyDefault.d.ts +8 -0
  29. package/dist/eslint-utils/applyDefault.js +33 -0
  30. package/dist/eslint-utils/deepMerge.d.ts +14 -0
  31. package/dist/eslint-utils/deepMerge.js +46 -0
  32. package/dist/eslint-utils/getParserServices.d.ts +22 -0
  33. package/dist/eslint-utils/getParserServices.js +41 -0
  34. package/dist/eslint-utils/index.d.ts +6 -0
  35. package/dist/eslint-utils/index.js +22 -0
  36. package/dist/eslint-utils/nullThrows.d.ts +12 -0
  37. package/dist/eslint-utils/nullThrows.js +21 -0
  38. package/dist/eslint-utils/parserSeemsToBeTSESLint.d.ts +1 -0
  39. package/dist/eslint-utils/parserSeemsToBeTSESLint.js +6 -0
  40. package/dist/index.d.ts +6 -0
  41. package/dist/index.js +45 -0
  42. package/dist/json-schema.d.ts +387 -0
  43. package/dist/json-schema.js +8 -0
  44. package/dist/ts-eslint/AST.d.ts +8 -0
  45. package/dist/ts-eslint/AST.js +3 -0
  46. package/dist/ts-eslint/Config.d.ts +291 -0
  47. package/dist/ts-eslint/Config.js +3 -0
  48. package/dist/ts-eslint/ESLint.d.ts +7 -0
  49. package/dist/ts-eslint/ESLint.js +13 -0
  50. package/dist/ts-eslint/Linter.d.ts +255 -0
  51. package/dist/ts-eslint/Linter.js +13 -0
  52. package/dist/ts-eslint/Parser.d.ts +94 -0
  53. package/dist/ts-eslint/Parser.js +3 -0
  54. package/dist/ts-eslint/ParserOptions.d.ts +1 -0
  55. package/dist/ts-eslint/ParserOptions.js +2 -0
  56. package/dist/ts-eslint/Processor.d.ts +63 -0
  57. package/dist/ts-eslint/Processor.js +3 -0
  58. package/dist/ts-eslint/Rule.d.ts +614 -0
  59. package/dist/ts-eslint/Rule.js +2 -0
  60. package/dist/ts-eslint/RuleTester.d.ts +183 -0
  61. package/dist/ts-eslint/RuleTester.js +11 -0
  62. package/dist/ts-eslint/Scope.d.ts +42 -0
  63. package/dist/ts-eslint/Scope.js +43 -0
  64. package/dist/ts-eslint/SourceCode.d.ts +354 -0
  65. package/dist/ts-eslint/SourceCode.js +8 -0
  66. package/dist/ts-eslint/eslint/ESLintShared.d.ts +381 -0
  67. package/dist/ts-eslint/eslint/ESLintShared.js +2 -0
  68. package/dist/ts-eslint/eslint/FlatESLint.d.ts +87 -0
  69. package/dist/ts-eslint/eslint/FlatESLint.js +19 -0
  70. package/dist/ts-eslint/eslint/LegacyESLint.d.ts +72 -0
  71. package/dist/ts-eslint/eslint/LegacyESLint.js +36 -0
  72. package/dist/ts-eslint/index.d.ts +11 -0
  73. package/dist/ts-eslint/index.js +27 -0
  74. package/dist/ts-estree.d.ts +3 -0
  75. package/dist/ts-estree.js +9 -0
  76. package/dist/ts-utils/NoInfer.d.ts +9 -0
  77. package/dist/ts-utils/NoInfer.js +2 -0
  78. package/dist/ts-utils/index.d.ts +2 -0
  79. package/dist/ts-utils/index.js +18 -0
  80. package/dist/ts-utils/isArray.d.ts +1 -0
  81. package/dist/ts-utils/isArray.js +7 -0
  82. package/package.json +120 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 typescript-eslint and other contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # @depup/typescript-eslint__utils
2
+
3
+ > Dependency-bumped version of [@typescript-eslint/utils](https://www.npmjs.com/package/@typescript-eslint/utils)
4
+
5
+ Generated by [DepUp](https://github.com/depup/npm) -- all production
6
+ dependencies bumped to latest versions.
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install @depup/typescript-eslint__utils
12
+ ```
13
+
14
+ | Field | Value |
15
+ |-------|-------|
16
+ | Original | [@typescript-eslint/utils](https://www.npmjs.com/package/@typescript-eslint/utils) @ 8.57.1 |
17
+ | Processed | 2026-03-17 |
18
+ | Smoke test | passed |
19
+ | Deps updated | 0 |
20
+
21
+ ---
22
+
23
+ Source: https://github.com/depup/npm | Original: https://www.npmjs.com/package/@typescript-eslint/utils
24
+
25
+ License inherited from the original package.
package/changes.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "bumped": {},
3
+ "timestamp": "2026-03-17T16:34:22.653Z",
4
+ "totalUpdated": 0
5
+ }
@@ -0,0 +1,47 @@
1
+ interface PatternMatcher {
2
+ /**
3
+ * Replace all matched parts by a given replacer.
4
+ *
5
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#matcher-symbol-replace}
6
+ * @example
7
+ * const { PatternMatcher } = require("eslint-utils")
8
+ * const matcher = new PatternMatcher(/\\p{Script=Greek}/g)
9
+ *
10
+ * module.exports = {
11
+ * meta: {},
12
+ * create(context) {
13
+ * return {
14
+ * "Literal[regex]"(node) {
15
+ * const replacedPattern = node.regex.pattern.replace(
16
+ * matcher,
17
+ * "[\\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]"
18
+ * )
19
+ * },
20
+ * }
21
+ * },
22
+ * }
23
+ */
24
+ [Symbol.replace](str: string, replacer: string | ((...strs: string[]) => string)): string;
25
+ /**
26
+ * Iterate all matched parts in a given string.
27
+ *
28
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#matcher-execall}
29
+ */
30
+ execAll(str: string): IterableIterator<RegExpExecArray>;
31
+ /**
32
+ * Check whether this pattern matches a given string or not.
33
+ *
34
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#matcher-test}
35
+ */
36
+ test(str: string): boolean;
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-community.github.io/eslint-utils/api/ast-utils.html#patternmatcher-class}
43
+ */
44
+ export declare const PatternMatcher: new (pattern: RegExp, options?: {
45
+ escaped?: boolean;
46
+ }) => PatternMatcher;
47
+ export {};
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.PatternMatcher = void 0;
37
+ const eslintUtils = __importStar(require("@eslint-community/eslint-utils"));
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-community.github.io/eslint-utils/api/ast-utils.html#patternmatcher-class}
43
+ */
44
+ exports.PatternMatcher = eslintUtils.PatternMatcher;
@@ -0,0 +1,75 @@
1
+ import type * as TSESLint from '../../ts-eslint';
2
+ import type { TSESTree } from '../../ts-estree';
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 `require()` expression.
11
+ *
12
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#tracker-iteratecjsreferences}
13
+ */
14
+ iterateCjsReferences<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 `import`/`export` declarations.
18
+ *
19
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#tracker-iterateesmreferences}
20
+ */
21
+ iterateEsmReferences<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 global variables.
25
+ *
26
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#tracker-iterateglobalreferences}
27
+ */
28
+ iterateGlobalReferences<T>(traceMap: ReferenceTracker.TraceMap<T>): IterableIterator<ReferenceTracker.FoundReference<T>>;
29
+ }
30
+ interface ReferenceTrackerStatic {
31
+ readonly CALL: typeof ReferenceTrackerCALL;
32
+ readonly CONSTRUCT: typeof ReferenceTrackerCONSTRUCT;
33
+ readonly ESM: typeof ReferenceTrackerESM;
34
+ new (globalScope: TSESLint.Scope.Scope, options?: {
35
+ /**
36
+ * The name list of Global Object. Optional. Default is `["global", "globalThis", "self", "window"]`.
37
+ */
38
+ globalObjectNames?: readonly string[];
39
+ /**
40
+ * The mode which determines how the `tracker.iterateEsmReferences()` method scans CommonJS modules.
41
+ * If this is `"strict"`, the method binds CommonJS modules to the default export. Otherwise, the method binds
42
+ * CommonJS modules to both the default export and named exports. Optional. Default is `"strict"`.
43
+ */
44
+ mode?: 'legacy' | 'strict';
45
+ }): ReferenceTracker;
46
+ readonly READ: typeof ReferenceTrackerREAD;
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 = CALL | CONSTRUCT | READ;
54
+ type TraceMap<T = any> = Record<string, TraceMapElement<T>>;
55
+ interface TraceMapElement<T> {
56
+ [key: string]: TraceMapElement<T>;
57
+ [ReferenceTrackerCALL]?: T;
58
+ [ReferenceTrackerCONSTRUCT]?: T;
59
+ [ReferenceTrackerESM]?: true;
60
+ [ReferenceTrackerREAD]?: T;
61
+ }
62
+ interface FoundReference<T = any> {
63
+ info: T;
64
+ node: TSESTree.Node;
65
+ path: readonly string[];
66
+ type: ReferenceType;
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-community.github.io/eslint-utils/api/scope-utils.html#referencetracker-class}
73
+ */
74
+ export declare const ReferenceTracker: ReferenceTrackerStatic;
75
+ export {};
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.ReferenceTracker = void 0;
37
+ /* eslint-disable @typescript-eslint/no-namespace */
38
+ const eslintUtils = __importStar(require("@eslint-community/eslint-utils"));
39
+ const ReferenceTrackerREAD = eslintUtils.ReferenceTracker.READ;
40
+ const ReferenceTrackerCALL = eslintUtils.ReferenceTracker.CALL;
41
+ const ReferenceTrackerCONSTRUCT = eslintUtils.ReferenceTracker.CONSTRUCT;
42
+ const ReferenceTrackerESM = eslintUtils.ReferenceTracker.ESM;
43
+ /**
44
+ * The tracker for references. This provides reference tracking for global variables, CommonJS modules, and ES modules.
45
+ *
46
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#referencetracker-class}
47
+ */
48
+ exports.ReferenceTracker = eslintUtils.ReferenceTracker;
@@ -0,0 +1,83 @@
1
+ import type * as TSESLint from '../../ts-eslint';
2
+ import type { TSESTree } from '../../ts-estree';
3
+ /**
4
+ * Get the proper location of a given function node to report.
5
+ *
6
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionheadlocation}
7
+ */
8
+ export declare const getFunctionHeadLocation: (node: TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression, sourceCode: TSESLint.SourceCode) => TSESTree.SourceLocation;
9
+ /**
10
+ * Get the name and kind of a given function node.
11
+ *
12
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionnamewithkind}
13
+ */
14
+ export declare const getFunctionNameWithKind: (node: TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression, sourceCode?: TSESLint.SourceCode) => 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-community.github.io/eslint-utils/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
+ export declare const getPropertyName: (node: TSESTree.MemberExpression | TSESTree.MethodDefinition | TSESTree.Property | TSESTree.PropertyDefinition, initialScope?: TSESLint.Scope.Scope) => 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`, `Symbol.for('k')`, ` String.raw``hello`` `, and `Object.freeze({a: 1}).a` as static, but `Symbol('k')` is not static.
29
+ *
30
+ * @see {@link https://eslint-community.github.io/eslint-utils/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
+ export declare const getStaticValue: (node: TSESTree.Node, initialScope?: TSESLint.Scope.Scope) => {
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-community.github.io/eslint-utils/api/ast-utils.html#getstringifconstant}
42
+ */
43
+ export declare const getStringIfConstant: (node: TSESTree.Node, initialScope?: TSESLint.Scope.Scope) => 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-community.github.io/eslint-utils/api/ast-utils.html#hassideeffect}
66
+ */
67
+ export declare const hasSideEffect: (node: TSESTree.Node, sourceCode: TSESLint.SourceCode, options?: {
68
+ considerGetters?: boolean;
69
+ considerImplicitTypeConversion?: boolean;
70
+ }) => boolean;
71
+ export declare const isParenthesized: {
72
+ (times: number, node: TSESTree.Node, sourceCode: TSESLint.SourceCode): boolean;
73
+ /**
74
+ * Check whether a given node is parenthesized or not.
75
+ * This function detects it correctly even if it's parenthesized by specific syntax.
76
+ *
77
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#isparenthesized}
78
+ * @returns `true` if the node is parenthesized.
79
+ * If `times` was given, it returns `true` only if the node is parenthesized the `times` times.
80
+ * For example, `isParenthesized(2, node, sourceCode)` returns true for `((foo))`, but not for `(foo)`.
81
+ */
82
+ (node: TSESTree.Node, sourceCode: TSESLint.SourceCode): boolean;
83
+ };
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.isParenthesized = exports.hasSideEffect = exports.getStringIfConstant = exports.getStaticValue = exports.getPropertyName = exports.getFunctionNameWithKind = exports.getFunctionHeadLocation = void 0;
37
+ const eslintUtils = __importStar(require("@eslint-community/eslint-utils"));
38
+ /**
39
+ * Get the proper location of a given function node to report.
40
+ *
41
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionheadlocation}
42
+ */
43
+ exports.getFunctionHeadLocation = eslintUtils.getFunctionHeadLocation;
44
+ /**
45
+ * Get the name and kind of a given function node.
46
+ *
47
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionnamewithkind}
48
+ */
49
+ exports.getFunctionNameWithKind = eslintUtils.getFunctionNameWithKind;
50
+ /**
51
+ * Get the property name of a given property node.
52
+ * If the node is a computed property, this tries to compute the property name by the getStringIfConstant function.
53
+ *
54
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getpropertyname}
55
+ * @returns The property name of the node. If the property name is not constant then it returns `null`.
56
+ */
57
+ exports.getPropertyName = eslintUtils.getPropertyName;
58
+ /**
59
+ * Get the value of a given node if it can decide the value statically.
60
+ * If the 2nd parameter `initialScope` was given, this function tries to resolve identifier references which are in the
61
+ * given node as much as possible. In the resolving way, it does on the assumption that built-in global objects have
62
+ * not been modified.
63
+ * For example, it considers `Symbol.iterator`, `Symbol.for('k')`, ` String.raw``hello`` `, and `Object.freeze({a: 1}).a` as static, but `Symbol('k')` is not static.
64
+ *
65
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstaticvalue}
66
+ * @returns The `{ value: any }` shaped object. The `value` property is the static value. If it couldn't compute the
67
+ * static value of the node, it returns `null`.
68
+ */
69
+ exports.getStaticValue = eslintUtils.getStaticValue;
70
+ /**
71
+ * Get the string value of a given node.
72
+ * This function is a tiny wrapper of the getStaticValue function.
73
+ *
74
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstringifconstant}
75
+ */
76
+ exports.getStringIfConstant = eslintUtils.getStringIfConstant;
77
+ /**
78
+ * Check whether a given node has any side effect or not.
79
+ * The side effect means that it may modify a certain variable or object member. This function considers the node which
80
+ * contains the following types as the node which has side effects:
81
+ * - `AssignmentExpression`
82
+ * - `AwaitExpression`
83
+ * - `CallExpression`
84
+ * - `ImportExpression`
85
+ * - `NewExpression`
86
+ * - `UnaryExpression([operator = "delete"])`
87
+ * - `UpdateExpression`
88
+ * - `YieldExpression`
89
+ * - When `options.considerGetters` is `true`:
90
+ * - `MemberExpression`
91
+ * - When `options.considerImplicitTypeConversion` is `true`:
92
+ * - `BinaryExpression([operator = "==" | "!=" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in"])`
93
+ * - `MemberExpression([computed = true])`
94
+ * - `MethodDefinition([computed = true])`
95
+ * - `Property([computed = true])`
96
+ * - `UnaryExpression([operator = "-" | "+" | "!" | "~"])`
97
+ *
98
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#hassideeffect}
99
+ */
100
+ exports.hasSideEffect = eslintUtils.hasSideEffect;
101
+ exports.isParenthesized = eslintUtils.isParenthesized;
@@ -0,0 +1,5 @@
1
+ export * from './astUtilities';
2
+ export * from './PatternMatcher';
3
+ export * from './predicates';
4
+ export * from './ReferenceTracker';
5
+ export * from './scopeAnalysis';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./astUtilities"), exports);
18
+ __exportStar(require("./PatternMatcher"), exports);
19
+ __exportStar(require("./predicates"), exports);
20
+ __exportStar(require("./ReferenceTracker"), exports);
21
+ __exportStar(require("./scopeAnalysis"), exports);
@@ -0,0 +1,31 @@
1
+ import type { TSESTree } from '../../ts-estree';
2
+ type IsSpecificTokenFunction<SpecificToken extends TSESTree.Token> = (token: TSESTree.Token) => token is SpecificToken;
3
+ type IsNotSpecificTokenFunction<SpecificToken extends TSESTree.Token> = (token: TSESTree.Token) => token is Exclude<TSESTree.Token, SpecificToken>;
4
+ type PunctuatorTokenWithValue<Value extends string> = {
5
+ value: Value;
6
+ } & TSESTree.PunctuatorToken;
7
+ type IsPunctuatorTokenWithValueFunction<Value extends string> = IsSpecificTokenFunction<PunctuatorTokenWithValue<Value>>;
8
+ type IsNotPunctuatorTokenWithValueFunction<Value extends string> = IsNotSpecificTokenFunction<PunctuatorTokenWithValue<Value>>;
9
+ export declare const isArrowToken: IsPunctuatorTokenWithValueFunction<"=>">;
10
+ export declare const isNotArrowToken: IsNotPunctuatorTokenWithValueFunction<"=>">;
11
+ export declare const isClosingBraceToken: IsPunctuatorTokenWithValueFunction<"}">;
12
+ export declare const isNotClosingBraceToken: IsNotPunctuatorTokenWithValueFunction<"}">;
13
+ export declare const isClosingBracketToken: IsPunctuatorTokenWithValueFunction<"]">;
14
+ export declare const isNotClosingBracketToken: IsNotPunctuatorTokenWithValueFunction<"]">;
15
+ export declare const isClosingParenToken: IsPunctuatorTokenWithValueFunction<")">;
16
+ export declare const isNotClosingParenToken: IsNotPunctuatorTokenWithValueFunction<")">;
17
+ export declare const isColonToken: IsPunctuatorTokenWithValueFunction<":">;
18
+ export declare const isNotColonToken: IsNotPunctuatorTokenWithValueFunction<":">;
19
+ export declare const isCommaToken: IsPunctuatorTokenWithValueFunction<",">;
20
+ export declare const isNotCommaToken: IsNotPunctuatorTokenWithValueFunction<",">;
21
+ export declare const isCommentToken: IsSpecificTokenFunction<TSESTree.Comment>;
22
+ export declare const isNotCommentToken: IsNotSpecificTokenFunction<TSESTree.Comment>;
23
+ export declare const isOpeningBraceToken: IsPunctuatorTokenWithValueFunction<"{">;
24
+ export declare const isNotOpeningBraceToken: IsNotPunctuatorTokenWithValueFunction<"{">;
25
+ export declare const isOpeningBracketToken: IsPunctuatorTokenWithValueFunction<"[">;
26
+ export declare const isNotOpeningBracketToken: IsNotPunctuatorTokenWithValueFunction<"[">;
27
+ export declare const isOpeningParenToken: IsPunctuatorTokenWithValueFunction<"(">;
28
+ export declare const isNotOpeningParenToken: IsNotPunctuatorTokenWithValueFunction<"(">;
29
+ export declare const isSemicolonToken: IsPunctuatorTokenWithValueFunction<";">;
30
+ export declare const isNotSemicolonToken: IsNotPunctuatorTokenWithValueFunction<";">;
31
+ export {};
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.isNotSemicolonToken = exports.isSemicolonToken = exports.isNotOpeningParenToken = exports.isOpeningParenToken = exports.isNotOpeningBracketToken = exports.isOpeningBracketToken = exports.isNotOpeningBraceToken = exports.isOpeningBraceToken = exports.isNotCommentToken = exports.isCommentToken = exports.isNotCommaToken = exports.isCommaToken = exports.isNotColonToken = exports.isColonToken = exports.isNotClosingParenToken = exports.isClosingParenToken = exports.isNotClosingBracketToken = exports.isClosingBracketToken = exports.isNotClosingBraceToken = exports.isClosingBraceToken = exports.isNotArrowToken = exports.isArrowToken = void 0;
37
+ const eslintUtils = __importStar(require("@eslint-community/eslint-utils"));
38
+ exports.isArrowToken = eslintUtils.isArrowToken;
39
+ exports.isNotArrowToken = eslintUtils.isNotArrowToken;
40
+ exports.isClosingBraceToken = eslintUtils.isClosingBraceToken;
41
+ exports.isNotClosingBraceToken = eslintUtils.isNotClosingBraceToken;
42
+ exports.isClosingBracketToken = eslintUtils.isClosingBracketToken;
43
+ exports.isNotClosingBracketToken = eslintUtils.isNotClosingBracketToken;
44
+ exports.isClosingParenToken = eslintUtils.isClosingParenToken;
45
+ exports.isNotClosingParenToken = eslintUtils.isNotClosingParenToken;
46
+ exports.isColonToken = eslintUtils.isColonToken;
47
+ exports.isNotColonToken = eslintUtils.isNotColonToken;
48
+ exports.isCommaToken = eslintUtils.isCommaToken;
49
+ exports.isNotCommaToken = eslintUtils.isNotCommaToken;
50
+ exports.isCommentToken = eslintUtils.isCommentToken;
51
+ exports.isNotCommentToken = eslintUtils.isNotCommentToken;
52
+ exports.isOpeningBraceToken = eslintUtils.isOpeningBraceToken;
53
+ exports.isNotOpeningBraceToken = eslintUtils.isNotOpeningBraceToken;
54
+ exports.isOpeningBracketToken = eslintUtils.isOpeningBracketToken;
55
+ exports.isNotOpeningBracketToken = eslintUtils.isNotOpeningBracketToken;
56
+ exports.isOpeningParenToken = eslintUtils.isOpeningParenToken;
57
+ exports.isNotOpeningParenToken = eslintUtils.isNotOpeningParenToken;
58
+ exports.isSemicolonToken = eslintUtils.isSemicolonToken;
59
+ exports.isNotSemicolonToken = eslintUtils.isNotSemicolonToken;
@@ -0,0 +1,16 @@
1
+ import type * as TSESLint from '../../ts-eslint';
2
+ import type { TSESTree } from '../../ts-estree';
3
+ /**
4
+ * Get the variable of a given name.
5
+ *
6
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#findvariable}
7
+ */
8
+ export declare const findVariable: (initialScope: TSESLint.Scope.Scope, nameOrNode: string | TSESTree.Identifier) => TSESLint.Scope.Variable | null;
9
+ /**
10
+ * Get the innermost scope which contains a given node.
11
+ *
12
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#getinnermostscope}
13
+ * @returns The innermost scope which contains the given node.
14
+ * If such scope doesn't exist then it returns the 1st argument `initialScope`.
15
+ */
16
+ export declare const getInnermostScope: (initialScope: TSESLint.Scope.Scope, node: TSESTree.Node) => TSESLint.Scope.Scope;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.getInnermostScope = exports.findVariable = void 0;
37
+ const eslintUtils = __importStar(require("@eslint-community/eslint-utils"));
38
+ /**
39
+ * Get the variable of a given name.
40
+ *
41
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#findvariable}
42
+ */
43
+ exports.findVariable = eslintUtils.findVariable;
44
+ /**
45
+ * Get the innermost scope which contains a given node.
46
+ *
47
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#getinnermostscope}
48
+ * @returns The innermost scope which contains the given node.
49
+ * If such scope doesn't exist then it returns the 1st argument `initialScope`.
50
+ */
51
+ exports.getInnermostScope = eslintUtils.getInnermostScope;