@interlace/eslint-devkit 2.1.2 → 2.3.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.
- package/package.json +1 -6
- package/src/ast/ast-utils.d.ts +1 -1
- package/src/ast/module-binding.d.ts +1 -1
- package/src/ast/spellings.d.ts +1 -1
- package/src/ast/static-expression.d.ts +1 -1
- package/src/ast/type-syntax.d.ts +1 -1
- package/src/ast-node-types.d.ts +1 -1
- package/src/index.d.ts +6 -3
- package/src/resolver/dependency-analysis.d.ts +29 -0
- package/src/resolver/dependency-analysis.js +1 -1
- package/src/resolver/resolver-fallback.d.ts +17 -0
- package/src/resolver/resolver-fallback.js +1 -0
- package/src/resolver/resolver.d.ts +3 -6
- package/src/resolver/resolver.js +1 -1
- package/src/rule-creation/browser-escape-hatch-rule.d.ts +1 -1
- package/src/rule-creation/connection-config.d.ts +1 -1
- package/src/rule-creation/driver-origin.d.ts +1 -1
- package/src/rule-creation/generated-file.d.ts +1 -1
- package/src/rule-creation/hardcoded-credentials-rule.d.ts +9 -2
- package/src/rule-creation/mass-assignment-rule.d.ts +9 -2
- package/src/rule-creation/message-source.d.ts +1 -1
- package/src/rule-creation/minified-file.d.ts +1 -1
- package/src/rule-creation/mock-context.d.ts +1 -1
- package/src/rule-creation/module-evidence.d.ts +1 -1
- package/src/rule-creation/raw-identifier-rule.d.ts +9 -2
- package/src/rule-creation/request-source.d.ts +1 -1
- package/src/rule-creation/require-tls-rule.d.ts +8 -2
- package/src/rule-creation/rule-creator.d.ts +1 -1
- package/src/rule-creation/rule-creator.js +1 -1
- package/src/rule-creation/sdk-api-key-rule.d.ts +1 -1
- package/src/rule-creation/sdk-flow.d.ts +1 -1
- package/src/rule-creation/sql-injection-rule.d.ts +8 -2
- package/src/rule-creation/sql-position.d.ts +1 -1
- package/src/rule-creation/sql-safety.d.ts +1 -1
- package/src/rule-creation/system-prompt-injection-rule.d.ts +1 -1
- package/src/rule-creation/unscoped-mutation-rule.d.ts +9 -2
- package/src/rule-creation/value-follow.d.ts +1 -1
- package/src/security/security-utils.d.ts +1 -1
- package/src/types/estree/project-service/createProjectService.d.ts +67 -0
- package/src/types/estree/project-service/index.d.ts +3 -0
- package/src/types/estree/scope-manager/ScopeManager.d.ts +77 -0
- package/src/types/estree/scope-manager/analyze.d.ts +55 -0
- package/src/types/estree/scope-manager/definition/CatchClauseDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/ClassNameDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/Definition.d.ts +14 -0
- package/src/types/estree/scope-manager/definition/DefinitionBase.d.ts +35 -0
- package/src/types/estree/scope-manager/definition/DefinitionType.d.ts +15 -0
- package/src/types/estree/scope-manager/definition/FunctionNameDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/ImplicitGlobalVariableDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/ImportBindingDefinition.d.ts +11 -0
- package/src/types/estree/scope-manager/definition/ParameterDefinition.d.ts +14 -0
- package/src/types/estree/scope-manager/definition/TSEnumMemberDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/TSEnumNameDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/TSModuleNameDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/TypeDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/VariableDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/index.d.ts +15 -0
- package/src/types/estree/scope-manager/index.d.ts +10 -0
- package/src/types/estree/scope-manager/referencer/PatternVisitor.d.ts +16 -0
- package/src/types/estree/scope-manager/referencer/Reference.d.ts +88 -0
- package/src/types/estree/scope-manager/referencer/Referencer.d.ts +28 -0
- package/src/types/estree/scope-manager/referencer/Visitor.d.ts +13 -0
- package/src/types/estree/scope-manager/referencer/VisitorBase.d.ts +22 -0
- package/src/types/estree/scope-manager/referencer/index.d.ts +3 -0
- package/src/types/estree/scope-manager/scope/BlockScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/CatchScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/ClassFieldInitializerScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/ClassScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/ClassStaticBlockScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/ConditionalTypeScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/ForScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/FunctionExpressionNameScope.d.ts +11 -0
- package/src/types/estree/scope-manager/scope/FunctionScope.d.ts +12 -0
- package/src/types/estree/scope-manager/scope/FunctionTypeScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/GlobalScope.d.ts +18 -0
- package/src/types/estree/scope-manager/scope/MappedTypeScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/ModuleScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/Scope.d.ts +21 -0
- package/src/types/estree/scope-manager/scope/ScopeBase.d.ts +91 -0
- package/src/types/estree/scope-manager/scope/ScopeType.d.ts +22 -0
- package/src/types/estree/scope-manager/scope/SwitchScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/TSEnumScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/TSModuleScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/TypeScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/WithScope.d.ts +11 -0
- package/src/types/estree/scope-manager/scope/index.d.ts +22 -0
- package/src/types/estree/scope-manager/variable/ESLintScopeVariable.d.ts +34 -0
- package/src/types/estree/scope-manager/variable/ImplicitLibVariable.d.ts +29 -0
- package/src/types/estree/scope-manager/variable/Variable.d.ts +18 -0
- package/src/types/estree/scope-manager/variable/VariableBase.d.ts +44 -0
- package/src/types/estree/scope-manager/variable/index.d.ts +8 -0
- package/src/types/estree/types/generated/ast-spec.d.ts +2215 -0
- package/src/types/estree/types/index.d.ts +6 -0
- package/src/types/estree/types/lib.d.ts +3 -0
- package/src/types/estree/types/parser-options.d.ts +83 -0
- package/src/types/estree/types/ts-estree.d.ts +190 -0
- package/src/types/estree/typescript-estree/clear-caches.d.ts +11 -0
- package/src/types/estree/typescript-estree/create-program/getScriptKind.d.ts +5 -0
- package/src/types/estree/typescript-estree/create-program/shared.d.ts +29 -0
- package/src/types/estree/typescript-estree/create-program/useProvidedPrograms.d.ts +13 -0
- package/src/types/estree/typescript-estree/getModifiers.d.ts +5 -0
- package/src/types/estree/typescript-estree/index.d.ts +16 -0
- package/src/types/estree/typescript-estree/node-utils.d.ts +191 -0
- package/src/types/estree/typescript-estree/parseSettings/ExpiringCache.d.ts +17 -0
- package/src/types/estree/typescript-estree/parseSettings/candidateTSConfigRootDirs.d.ts +5 -0
- package/src/types/estree/typescript-estree/parseSettings/index.d.ts +128 -0
- package/src/types/estree/typescript-estree/parser-options.d.ts +220 -0
- package/src/types/estree/typescript-estree/parser.d.ts +19 -0
- package/src/types/estree/typescript-estree/simple-traverse.d.ts +13 -0
- package/src/types/estree/typescript-estree/ts-estree/estree-to-ts-node-types.d.ts +180 -0
- package/src/types/estree/typescript-estree/ts-estree/index.d.ts +5 -0
- package/src/types/estree/typescript-estree/ts-estree/ts-nodes.d.ts +19 -0
- package/src/types/estree/typescript-estree/version-check.d.ts +6 -0
- package/src/types/estree/typescript-estree/version.d.ts +3 -0
- package/src/types/estree/typescript-estree/withoutProjectParserOptions.d.ts +11 -0
- package/src/types/estree/utils/ast-utils/eslint-utils/PatternMatcher.d.ts +49 -0
- package/src/types/estree/utils/ast-utils/eslint-utils/ReferenceTracker.d.ts +73 -0
- package/src/types/estree/utils/ast-utils/eslint-utils/astUtilities.d.ts +85 -0
- package/src/types/estree/utils/ast-utils/eslint-utils/index.d.ts +7 -0
- package/src/types/estree/utils/ast-utils/eslint-utils/predicates.d.ts +33 -0
- package/src/types/estree/utils/ast-utils/eslint-utils/scopeAnalysis.d.ts +18 -0
- package/src/types/estree/utils/ast-utils/helpers.d.ts +20 -0
- package/src/types/estree/utils/ast-utils/index.d.ts +6 -0
- package/src/types/estree/utils/ast-utils/misc.d.ts +12 -0
- package/src/types/estree/utils/ast-utils/predicates.d.ts +70 -0
- package/src/types/estree/utils/eslint-utils/InferTypesFromRule.d.ts +11 -0
- package/src/types/estree/utils/eslint-utils/RuleCreator.d.ts +34 -0
- package/src/types/estree/utils/eslint-utils/applyDefault.d.ts +10 -0
- package/src/types/estree/utils/eslint-utils/deepMerge.d.ts +16 -0
- package/src/types/estree/utils/eslint-utils/getParserServices.d.ts +24 -0
- package/src/types/estree/utils/eslint-utils/index.d.ts +8 -0
- package/src/types/estree/utils/eslint-utils/nullThrows.d.ts +14 -0
- package/src/types/estree/utils/index.d.ts +8 -0
- package/src/types/estree/utils/json-schema.d.ts +389 -0
- package/src/types/estree/utils/ts-eslint/AST.d.ts +10 -0
- package/src/types/estree/utils/ts-eslint/Config.d.ts +293 -0
- package/src/types/estree/utils/ts-eslint/ESLint.d.ts +9 -0
- package/src/types/estree/utils/ts-eslint/Linter.d.ts +257 -0
- package/src/types/estree/utils/ts-eslint/Parser.d.ts +96 -0
- package/src/types/estree/utils/ts-eslint/ParserOptions.d.ts +3 -0
- package/src/types/estree/utils/ts-eslint/Processor.d.ts +65 -0
- package/src/types/estree/utils/ts-eslint/Rule.d.ts +633 -0
- package/src/types/estree/utils/ts-eslint/RuleTester.d.ts +185 -0
- package/src/types/estree/utils/ts-eslint/Scope.d.ts +44 -0
- package/src/types/estree/utils/ts-eslint/SourceCode.d.ts +356 -0
- package/src/types/estree/utils/ts-eslint/eslint/ESLintShared.d.ts +383 -0
- package/src/types/estree/utils/ts-eslint/eslint/FlatESLint.d.ts +89 -0
- package/src/types/estree/utils/ts-eslint/eslint/LegacyESLint.d.ts +74 -0
- package/src/types/estree/utils/ts-eslint/index.d.ts +13 -0
- package/src/types/estree/utils/ts-estree.d.ts +5 -0
- package/src/types/estree/utils/ts-utils/NoInfer.d.ts +11 -0
- package/src/types/estree/utils/ts-utils/index.d.ts +4 -0
- package/src/types/estree/utils/ts-utils/isArray.d.ts +3 -0
- package/src/types/estree/visitor-keys/get-keys.d.ts +4 -0
- package/src/types/estree/visitor-keys/index.d.ts +4 -0
- package/src/types/estree/visitor-keys/visitor-keys.d.ts +4 -0
- package/src/types/meta-augmentation.d.ts +1 -1
- package/src/types/type-utils.d.ts +1 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
interface PatternMatcher {
|
|
4
|
+
/**
|
|
5
|
+
* Replace all matched parts by a given replacer.
|
|
6
|
+
*
|
|
7
|
+
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#matcher-symbol-replace}
|
|
8
|
+
* @example
|
|
9
|
+
* const { PatternMatcher } = require("eslint-utils")
|
|
10
|
+
* const matcher = new PatternMatcher(/\\p{Script=Greek}/g)
|
|
11
|
+
*
|
|
12
|
+
* module.exports = {
|
|
13
|
+
* meta: {},
|
|
14
|
+
* create(context) {
|
|
15
|
+
* return {
|
|
16
|
+
* "Literal[regex]"(node) {
|
|
17
|
+
* const replacedPattern = node.regex.pattern.replace(
|
|
18
|
+
* matcher,
|
|
19
|
+
* "[\\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]"
|
|
20
|
+
* )
|
|
21
|
+
* },
|
|
22
|
+
* }
|
|
23
|
+
* },
|
|
24
|
+
* }
|
|
25
|
+
*/
|
|
26
|
+
[Symbol.replace](str: string, replacer: string | ((...strs: string[]) => string)): string;
|
|
27
|
+
/**
|
|
28
|
+
* Iterate all matched parts in a given string.
|
|
29
|
+
*
|
|
30
|
+
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#matcher-execall}
|
|
31
|
+
*/
|
|
32
|
+
execAll(str: string): IterableIterator<RegExpExecArray>;
|
|
33
|
+
/**
|
|
34
|
+
* Check whether this pattern matches a given string or not.
|
|
35
|
+
*
|
|
36
|
+
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#matcher-test}
|
|
37
|
+
*/
|
|
38
|
+
test(str: string): boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The class to find a pattern in strings as handling escape sequences.
|
|
42
|
+
* It ignores the found pattern if it's escaped with `\`.
|
|
43
|
+
*
|
|
44
|
+
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#patternmatcher-class}
|
|
45
|
+
*/
|
|
46
|
+
export declare const PatternMatcher: new (pattern: RegExp, options?: {
|
|
47
|
+
escaped?: boolean;
|
|
48
|
+
}) => PatternMatcher;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
import type * as TSESLint from '../../ts-eslint';
|
|
4
|
+
import type { TSESTree } from '../../ts-estree';
|
|
5
|
+
declare const ReferenceTrackerREAD: symbol;
|
|
6
|
+
declare const ReferenceTrackerCALL: symbol;
|
|
7
|
+
declare const ReferenceTrackerCONSTRUCT: symbol;
|
|
8
|
+
declare const ReferenceTrackerESM: symbol;
|
|
9
|
+
interface ReferenceTracker {
|
|
10
|
+
/**
|
|
11
|
+
* Iterate the references that the given `traceMap` determined.
|
|
12
|
+
* This method starts to search from `require()` expression.
|
|
13
|
+
*
|
|
14
|
+
* @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#tracker-iteratecjsreferences}
|
|
15
|
+
*/
|
|
16
|
+
iterateCjsReferences<T>(traceMap: ReferenceTracker.TraceMap<T>): IterableIterator<ReferenceTracker.FoundReference<T>>;
|
|
17
|
+
/**
|
|
18
|
+
* Iterate the references that the given `traceMap` determined.
|
|
19
|
+
* This method starts to search from `import`/`export` declarations.
|
|
20
|
+
*
|
|
21
|
+
* @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#tracker-iterateesmreferences}
|
|
22
|
+
*/
|
|
23
|
+
iterateEsmReferences<T>(traceMap: ReferenceTracker.TraceMap<T>): IterableIterator<ReferenceTracker.FoundReference<T>>;
|
|
24
|
+
/**
|
|
25
|
+
* Iterate the references that the given `traceMap` determined.
|
|
26
|
+
* This method starts to search from global variables.
|
|
27
|
+
*
|
|
28
|
+
* @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#tracker-iterateglobalreferences}
|
|
29
|
+
*/
|
|
30
|
+
iterateGlobalReferences<T>(traceMap: ReferenceTracker.TraceMap<T>): IterableIterator<ReferenceTracker.FoundReference<T>>;
|
|
31
|
+
}
|
|
32
|
+
interface ReferenceTrackerStatic {
|
|
33
|
+
readonly CALL: typeof ReferenceTrackerCALL;
|
|
34
|
+
readonly CONSTRUCT: typeof ReferenceTrackerCONSTRUCT;
|
|
35
|
+
readonly ESM: typeof ReferenceTrackerESM;
|
|
36
|
+
new (globalScope: TSESLint.Scope.Scope, options?: {
|
|
37
|
+
/**
|
|
38
|
+
* The name list of Global Object. Optional. Default is `["global", "globalThis", "self", "window"]`.
|
|
39
|
+
*/
|
|
40
|
+
globalObjectNames?: readonly string[];
|
|
41
|
+
/**
|
|
42
|
+
* The mode which determines how the `tracker.iterateEsmReferences()` method scans CommonJS modules.
|
|
43
|
+
* If this is `"strict"`, the method binds CommonJS modules to the default export. Otherwise, the method binds
|
|
44
|
+
* CommonJS modules to both the default export and named exports. Optional. Default is `"strict"`.
|
|
45
|
+
*/
|
|
46
|
+
mode?: 'legacy' | 'strict';
|
|
47
|
+
}): ReferenceTracker;
|
|
48
|
+
readonly READ: typeof ReferenceTrackerREAD;
|
|
49
|
+
}
|
|
50
|
+
declare namespace ReferenceTracker {
|
|
51
|
+
type READ = ReferenceTrackerStatic['READ'];
|
|
52
|
+
type CALL = ReferenceTrackerStatic['CALL'];
|
|
53
|
+
type CONSTRUCT = ReferenceTrackerStatic['CONSTRUCT'];
|
|
54
|
+
type ESM = ReferenceTrackerStatic['ESM'];
|
|
55
|
+
type ReferenceType = symbol;
|
|
56
|
+
type TraceMap<T = any> = Record<string, TraceMapElement<T>>;
|
|
57
|
+
interface TraceMapElement<T> {
|
|
58
|
+
[key: string]: TraceMapElement<T>;
|
|
59
|
+
}
|
|
60
|
+
interface FoundReference<T = any> {
|
|
61
|
+
info: T;
|
|
62
|
+
node: TSESTree.Node;
|
|
63
|
+
path: readonly string[];
|
|
64
|
+
type: ReferenceType;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The tracker for references. This provides reference tracking for global variables, CommonJS modules, and ES modules.
|
|
69
|
+
*
|
|
70
|
+
* @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#referencetracker-class}
|
|
71
|
+
*/
|
|
72
|
+
export declare const ReferenceTracker: ReferenceTrackerStatic;
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
import type * as TSESLint from '../../ts-eslint';
|
|
4
|
+
import type { TSESTree } from '../../ts-estree';
|
|
5
|
+
/**
|
|
6
|
+
* Get the proper location of a given function node to report.
|
|
7
|
+
*
|
|
8
|
+
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionheadlocation}
|
|
9
|
+
*/
|
|
10
|
+
export declare const getFunctionHeadLocation: (node: TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression, sourceCode: TSESLint.SourceCode) => TSESTree.SourceLocation;
|
|
11
|
+
/**
|
|
12
|
+
* Get the name and kind of a given function node.
|
|
13
|
+
*
|
|
14
|
+
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionnamewithkind}
|
|
15
|
+
*/
|
|
16
|
+
export declare const getFunctionNameWithKind: (node: TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression, sourceCode?: TSESLint.SourceCode) => string;
|
|
17
|
+
/**
|
|
18
|
+
* Get the property name of a given property node.
|
|
19
|
+
* If the node is a computed property, this tries to compute the property name by the getStringIfConstant function.
|
|
20
|
+
*
|
|
21
|
+
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getpropertyname}
|
|
22
|
+
* @returns The property name of the node. If the property name is not constant then it returns `null`.
|
|
23
|
+
*/
|
|
24
|
+
export declare const getPropertyName: (node: TSESTree.MemberExpression | TSESTree.MethodDefinition | TSESTree.Property | TSESTree.PropertyDefinition, initialScope?: TSESLint.Scope.Scope) => string | null;
|
|
25
|
+
/**
|
|
26
|
+
* Get the value of a given node if it can decide the value statically.
|
|
27
|
+
* If the 2nd parameter `initialScope` was given, this function tries to resolve identifier references which are in the
|
|
28
|
+
* given node as much as possible. In the resolving way, it does on the assumption that built-in global objects have
|
|
29
|
+
* not been modified.
|
|
30
|
+
* 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.
|
|
31
|
+
*
|
|
32
|
+
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstaticvalue}
|
|
33
|
+
* @returns The `{ value: any }` shaped object. The `value` property is the static value. If it couldn't compute the
|
|
34
|
+
* static value of the node, it returns `null`.
|
|
35
|
+
*/
|
|
36
|
+
export declare const getStaticValue: (node: TSESTree.Node, initialScope?: TSESLint.Scope.Scope) => {
|
|
37
|
+
value: unknown;
|
|
38
|
+
} | null;
|
|
39
|
+
/**
|
|
40
|
+
* Get the string value of a given node.
|
|
41
|
+
* This function is a tiny wrapper of the getStaticValue function.
|
|
42
|
+
*
|
|
43
|
+
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstringifconstant}
|
|
44
|
+
*/
|
|
45
|
+
export declare const getStringIfConstant: (node: TSESTree.Node, initialScope?: TSESLint.Scope.Scope) => string | null;
|
|
46
|
+
/**
|
|
47
|
+
* Check whether a given node has any side effect or not.
|
|
48
|
+
* The side effect means that it may modify a certain variable or object member. This function considers the node which
|
|
49
|
+
* contains the following types as the node which has side effects:
|
|
50
|
+
* - `AssignmentExpression`
|
|
51
|
+
* - `AwaitExpression`
|
|
52
|
+
* - `CallExpression`
|
|
53
|
+
* - `ImportExpression`
|
|
54
|
+
* - `NewExpression`
|
|
55
|
+
* - `UnaryExpression([operator = "delete"])`
|
|
56
|
+
* - `UpdateExpression`
|
|
57
|
+
* - `YieldExpression`
|
|
58
|
+
* - When `options.considerGetters` is `true`:
|
|
59
|
+
* - `MemberExpression`
|
|
60
|
+
* - When `options.considerImplicitTypeConversion` is `true`:
|
|
61
|
+
* - `BinaryExpression([operator = "==" | "!=" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in"])`
|
|
62
|
+
* - `MemberExpression([computed = true])`
|
|
63
|
+
* - `MethodDefinition([computed = true])`
|
|
64
|
+
* - `Property([computed = true])`
|
|
65
|
+
* - `UnaryExpression([operator = "-" | "+" | "!" | "~"])`
|
|
66
|
+
*
|
|
67
|
+
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#hassideeffect}
|
|
68
|
+
*/
|
|
69
|
+
export declare const hasSideEffect: (node: TSESTree.Node, sourceCode: TSESLint.SourceCode, options?: {
|
|
70
|
+
considerGetters?: boolean;
|
|
71
|
+
considerImplicitTypeConversion?: boolean;
|
|
72
|
+
}) => boolean;
|
|
73
|
+
export declare const isParenthesized: {
|
|
74
|
+
(times: number, node: TSESTree.Node, sourceCode: TSESLint.SourceCode): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Check whether a given node is parenthesized or not.
|
|
77
|
+
* This function detects it correctly even if it's parenthesized by specific syntax.
|
|
78
|
+
*
|
|
79
|
+
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#isparenthesized}
|
|
80
|
+
* @returns `true` if the node is parenthesized.
|
|
81
|
+
* If `times` was given, it returns `true` only if the node is parenthesized the `times` times.
|
|
82
|
+
* For example, `isParenthesized(2, node, sourceCode)` returns true for `((foo))`, but not for `(foo)`.
|
|
83
|
+
*/
|
|
84
|
+
(node: TSESTree.Node, sourceCode: TSESLint.SourceCode): boolean;
|
|
85
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
export * from './astUtilities';
|
|
4
|
+
export * from './PatternMatcher';
|
|
5
|
+
export * from './predicates';
|
|
6
|
+
export * from './ReferenceTracker';
|
|
7
|
+
export * from './scopeAnalysis';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
import type { TSESTree } from '../../ts-estree';
|
|
4
|
+
type IsSpecificTokenFunction<SpecificToken extends TSESTree.Token> = (token: TSESTree.Token) => token is SpecificToken;
|
|
5
|
+
type IsNotSpecificTokenFunction<SpecificToken extends TSESTree.Token> = (token: TSESTree.Token) => token is Exclude<TSESTree.Token, SpecificToken>;
|
|
6
|
+
type PunctuatorTokenWithValue<Value extends string> = {
|
|
7
|
+
value: Value;
|
|
8
|
+
} & TSESTree.PunctuatorToken;
|
|
9
|
+
type IsPunctuatorTokenWithValueFunction<Value extends string> = IsSpecificTokenFunction<PunctuatorTokenWithValue<Value>>;
|
|
10
|
+
type IsNotPunctuatorTokenWithValueFunction<Value extends string> = IsNotSpecificTokenFunction<PunctuatorTokenWithValue<Value>>;
|
|
11
|
+
export declare const isArrowToken: IsPunctuatorTokenWithValueFunction<'=>'>;
|
|
12
|
+
export declare const isNotArrowToken: IsNotPunctuatorTokenWithValueFunction<'=>'>;
|
|
13
|
+
export declare const isClosingBraceToken: IsPunctuatorTokenWithValueFunction<'}'>;
|
|
14
|
+
export declare const isNotClosingBraceToken: IsNotPunctuatorTokenWithValueFunction<'}'>;
|
|
15
|
+
export declare const isClosingBracketToken: IsPunctuatorTokenWithValueFunction<']'>;
|
|
16
|
+
export declare const isNotClosingBracketToken: IsNotPunctuatorTokenWithValueFunction<']'>;
|
|
17
|
+
export declare const isClosingParenToken: IsPunctuatorTokenWithValueFunction<')'>;
|
|
18
|
+
export declare const isNotClosingParenToken: IsNotPunctuatorTokenWithValueFunction<')'>;
|
|
19
|
+
export declare const isColonToken: IsPunctuatorTokenWithValueFunction<':'>;
|
|
20
|
+
export declare const isNotColonToken: IsNotPunctuatorTokenWithValueFunction<':'>;
|
|
21
|
+
export declare const isCommaToken: IsPunctuatorTokenWithValueFunction<','>;
|
|
22
|
+
export declare const isNotCommaToken: IsNotPunctuatorTokenWithValueFunction<','>;
|
|
23
|
+
export declare const isCommentToken: IsSpecificTokenFunction<TSESTree.Comment>;
|
|
24
|
+
export declare const isNotCommentToken: IsNotSpecificTokenFunction<TSESTree.Comment>;
|
|
25
|
+
export declare const isOpeningBraceToken: IsPunctuatorTokenWithValueFunction<'{'>;
|
|
26
|
+
export declare const isNotOpeningBraceToken: IsNotPunctuatorTokenWithValueFunction<'{'>;
|
|
27
|
+
export declare const isOpeningBracketToken: IsPunctuatorTokenWithValueFunction<'['>;
|
|
28
|
+
export declare const isNotOpeningBracketToken: IsNotPunctuatorTokenWithValueFunction<'['>;
|
|
29
|
+
export declare const isOpeningParenToken: IsPunctuatorTokenWithValueFunction<'('>;
|
|
30
|
+
export declare const isNotOpeningParenToken: IsNotPunctuatorTokenWithValueFunction<'('>;
|
|
31
|
+
export declare const isSemicolonToken: IsPunctuatorTokenWithValueFunction<';'>;
|
|
32
|
+
export declare const isNotSemicolonToken: IsNotPunctuatorTokenWithValueFunction<';'>;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
import type * as TSESLint from '../../ts-eslint';
|
|
4
|
+
import type { TSESTree } from '../../ts-estree';
|
|
5
|
+
/**
|
|
6
|
+
* Get the variable of a given name.
|
|
7
|
+
*
|
|
8
|
+
* @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#findvariable}
|
|
9
|
+
*/
|
|
10
|
+
export declare const findVariable: (initialScope: TSESLint.Scope.Scope, nameOrNode: string | TSESTree.Identifier) => TSESLint.Scope.Variable | null;
|
|
11
|
+
/**
|
|
12
|
+
* Get the innermost scope which contains a given node.
|
|
13
|
+
*
|
|
14
|
+
* @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#getinnermostscope}
|
|
15
|
+
* @returns The innermost scope which contains the given node.
|
|
16
|
+
* If such scope doesn't exist then it returns the 1st argument `initialScope`.
|
|
17
|
+
*/
|
|
18
|
+
export declare const getInnermostScope: (initialScope: TSESLint.Scope.Scope, node: TSESTree.Node) => TSESLint.Scope.Scope;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
import type { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree } from '../ts-estree';
|
|
4
|
+
export declare const isNodeOfType: <NodeType extends AST_NODE_TYPES>(nodeType: NodeType) => (node: TSESTree.Node | null | undefined) => node is Extract<TSESTree.Node, {
|
|
5
|
+
type: NodeType;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const isNodeOfTypes: <NodeTypes extends readonly AST_NODE_TYPES[]>(nodeTypes: NodeTypes) => (node: TSESTree.Node | null | undefined) => node is Extract<TSESTree.Node, {
|
|
8
|
+
type: NodeTypes[number];
|
|
9
|
+
}>;
|
|
10
|
+
export declare const isNodeOfTypeWithConditions: <NodeType extends AST_NODE_TYPES, ExtractedNode extends Extract<TSESTree.Node, {
|
|
11
|
+
type: NodeType;
|
|
12
|
+
}>, Conditions extends Partial<ExtractedNode>>(nodeType: NodeType, conditions: Conditions) => ((node: TSESTree.Node | null | undefined) => node is Conditions & ExtractedNode);
|
|
13
|
+
export declare const isTokenOfTypeWithConditions: <TokenType extends AST_TOKEN_TYPES, ExtractedToken extends Extract<TSESTree.Token, {
|
|
14
|
+
type: TokenType;
|
|
15
|
+
}>, Conditions extends Partial<{
|
|
16
|
+
type: TokenType;
|
|
17
|
+
} & TSESTree.Token>>(tokenType: TokenType, conditions: Conditions) => ((token: TSESTree.Token | null | undefined) => token is Conditions & ExtractedToken);
|
|
18
|
+
export declare const isNotTokenOfTypeWithConditions: <TokenType extends AST_TOKEN_TYPES, ExtractedToken extends Extract<TSESTree.Token, {
|
|
19
|
+
type: TokenType;
|
|
20
|
+
}>, Conditions extends Partial<ExtractedToken>>(tokenType: TokenType, conditions: Conditions) => ((token: TSESTree.Token | null | undefined) => token is Exclude<TSESTree.Token, Conditions & ExtractedToken>);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
export * from './eslint-utils';
|
|
4
|
+
export * from './helpers';
|
|
5
|
+
export * from './misc';
|
|
6
|
+
export * from './predicates';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
import type { TSESTree } from '../ts-estree';
|
|
4
|
+
/**
|
|
5
|
+
* A regular expression to match line terminators.
|
|
6
|
+
* @see https://tc39.es/ecma262/multipage/ecmascript-language-lexical-grammar.html#prod-LineTerminator
|
|
7
|
+
*/
|
|
8
|
+
export declare const LINEBREAK_MATCHER: RegExp;
|
|
9
|
+
/**
|
|
10
|
+
* Determines whether two adjacent tokens are on the same line
|
|
11
|
+
*/
|
|
12
|
+
export declare function isTokenOnSameLine(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token): boolean;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
import type { TSESTree } from '../ts-estree';
|
|
4
|
+
export declare const isOptionalChainPunctuator: (token: TSESTree.Token | null | undefined) => token is {
|
|
5
|
+
value: "?.";
|
|
6
|
+
} & TSESTree.PunctuatorToken;
|
|
7
|
+
export declare const isNotOptionalChainPunctuator: (token: TSESTree.Token | null | undefined) => token is TSESTree.BlockComment | TSESTree.BooleanToken | TSESTree.IdentifierToken | TSESTree.JSXIdentifierToken | TSESTree.JSXTextToken | TSESTree.KeywordToken | TSESTree.LineComment | TSESTree.NullToken | TSESTree.NumericToken | TSESTree.PrivateIdentifierToken | TSESTree.PunctuatorToken | TSESTree.RegularExpressionToken | TSESTree.StringToken | TSESTree.TemplateToken;
|
|
8
|
+
export declare const isNonNullAssertionPunctuator: (token: TSESTree.Token | null | undefined) => token is {
|
|
9
|
+
value: "!";
|
|
10
|
+
} & TSESTree.PunctuatorToken;
|
|
11
|
+
export declare const isNotNonNullAssertionPunctuator: (token: TSESTree.Token | null | undefined) => token is TSESTree.BlockComment | TSESTree.BooleanToken | TSESTree.IdentifierToken | TSESTree.JSXIdentifierToken | TSESTree.JSXTextToken | TSESTree.KeywordToken | TSESTree.LineComment | TSESTree.NullToken | TSESTree.NumericToken | TSESTree.PrivateIdentifierToken | TSESTree.PunctuatorToken | TSESTree.RegularExpressionToken | TSESTree.StringToken | TSESTree.TemplateToken;
|
|
12
|
+
/**
|
|
13
|
+
* Returns true if and only if the node represents: foo?.() or foo.bar?.()
|
|
14
|
+
*/
|
|
15
|
+
export declare const isOptionalCallExpression: (node: TSESTree.Node | null | undefined) => node is {
|
|
16
|
+
optional: boolean;
|
|
17
|
+
} & TSESTree.CallExpression;
|
|
18
|
+
/**
|
|
19
|
+
* Returns true if and only if the node represents logical OR
|
|
20
|
+
*/
|
|
21
|
+
export declare const isLogicalOrOperator: (node: TSESTree.Node | null | undefined) => node is Partial<TSESTree.LogicalExpression> & TSESTree.LogicalExpression;
|
|
22
|
+
/**
|
|
23
|
+
* Checks if a node is a type assertion:
|
|
24
|
+
* ```
|
|
25
|
+
* x as foo
|
|
26
|
+
* <foo>x
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare const isTypeAssertion: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSAsExpression | TSESTree.TSTypeAssertion;
|
|
30
|
+
export declare const isVariableDeclarator: (node: TSESTree.Node | null | undefined) => node is TSESTree.UsingInForOfDeclarator | TSESTree.UsingInNormalContextDeclarator | TSESTree.VariableDeclaratorDefiniteAssignment | TSESTree.VariableDeclaratorMaybeInit | TSESTree.VariableDeclaratorNoInit;
|
|
31
|
+
export declare const isFunction: (node: TSESTree.Node | null | undefined) => node is TSESTree.ArrowFunctionExpressionWithBlockBody | TSESTree.ArrowFunctionExpressionWithExpressionBody | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName | TSESTree.FunctionExpression;
|
|
32
|
+
export declare const isFunctionType: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSConstructorType | TSESTree.TSDeclareFunctionNoDeclare | TSESTree.TSDeclareFunctionWithDeclare | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSFunctionType | TSESTree.TSMethodSignatureComputedName | TSESTree.TSMethodSignatureNonComputedName;
|
|
33
|
+
export declare const isFunctionOrFunctionType: (node: TSESTree.Node | null | undefined) => node is TSESTree.ArrowFunctionExpressionWithBlockBody | TSESTree.ArrowFunctionExpressionWithExpressionBody | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName | TSESTree.FunctionExpression | TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSConstructorType | TSESTree.TSDeclareFunctionNoDeclare | TSESTree.TSDeclareFunctionWithDeclare | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSFunctionType | TSESTree.TSMethodSignatureComputedName | TSESTree.TSMethodSignatureNonComputedName;
|
|
34
|
+
export declare const isTSFunctionType: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSFunctionType;
|
|
35
|
+
export declare const isTSConstructorType: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSConstructorType;
|
|
36
|
+
export declare const isClassOrTypeElement: (node: TSESTree.Node | null | undefined) => node is TSESTree.FunctionExpression | TSESTree.MethodDefinitionComputedName | TSESTree.MethodDefinitionNonComputedName | TSESTree.PropertyDefinitionComputedName | TSESTree.PropertyDefinitionNonComputedName | TSESTree.TSAbstractMethodDefinitionComputedName | TSESTree.TSAbstractMethodDefinitionNonComputedName | TSESTree.TSAbstractPropertyDefinitionComputedName | TSESTree.TSAbstractPropertyDefinitionNonComputedName | TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSIndexSignature | TSESTree.TSMethodSignatureComputedName | TSESTree.TSMethodSignatureNonComputedName | TSESTree.TSPropertySignatureComputedName | TSESTree.TSPropertySignatureNonComputedName;
|
|
37
|
+
/**
|
|
38
|
+
* Checks if a node is a constructor method.
|
|
39
|
+
*/
|
|
40
|
+
export declare const isConstructor: (node: TSESTree.Node | null | undefined) => node is (Partial<TSESTree.MethodDefinitionComputedName> & TSESTree.MethodDefinitionComputedName) | (Partial<TSESTree.MethodDefinitionNonComputedName> & TSESTree.MethodDefinitionNonComputedName);
|
|
41
|
+
/**
|
|
42
|
+
* Checks if a node is a setter method.
|
|
43
|
+
*/
|
|
44
|
+
export declare function isSetter(node: TSESTree.Node | undefined): node is {
|
|
45
|
+
kind: 'set';
|
|
46
|
+
} & (TSESTree.MethodDefinition | TSESTree.Property);
|
|
47
|
+
export declare const isIdentifier: (node: TSESTree.Node | null | undefined) => node is TSESTree.Identifier;
|
|
48
|
+
/**
|
|
49
|
+
* Checks if a node represents an `await …` expression.
|
|
50
|
+
*/
|
|
51
|
+
export declare const isAwaitExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.AwaitExpression;
|
|
52
|
+
/**
|
|
53
|
+
* Checks if a possible token is the `await` keyword.
|
|
54
|
+
*/
|
|
55
|
+
export declare const isAwaitKeyword: (token: TSESTree.Token | null | undefined) => token is {
|
|
56
|
+
value: "await";
|
|
57
|
+
} & TSESTree.IdentifierToken;
|
|
58
|
+
/**
|
|
59
|
+
* Checks if a possible token is the `type` keyword.
|
|
60
|
+
*/
|
|
61
|
+
export declare const isTypeKeyword: (token: TSESTree.Token | null | undefined) => token is {
|
|
62
|
+
value: "type";
|
|
63
|
+
} & TSESTree.IdentifierToken;
|
|
64
|
+
/**
|
|
65
|
+
* Checks if a possible token is the `import` keyword.
|
|
66
|
+
*/
|
|
67
|
+
export declare const isImportKeyword: (token: TSESTree.Token | null | undefined) => token is {
|
|
68
|
+
value: "import";
|
|
69
|
+
} & TSESTree.KeywordToken;
|
|
70
|
+
export declare const isLoop: (node: TSESTree.Node | null | undefined) => node is TSESTree.DoWhileStatement | TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement | TSESTree.WhileStatement;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
import type { RuleCreateFunction, RuleModule } from '../ts-eslint';
|
|
4
|
+
/**
|
|
5
|
+
* Uses type inference to fetch the Options type from the given RuleModule
|
|
6
|
+
*/
|
|
7
|
+
export type InferOptionsTypeFromRule<T> = T extends RuleModule<infer _MessageIds, infer Options> ? Options : T extends RuleCreateFunction<infer _MessageIds, infer Options> ? Options : unknown;
|
|
8
|
+
/**
|
|
9
|
+
* Uses type inference to fetch the MessageIds type from the given RuleModule
|
|
10
|
+
*/
|
|
11
|
+
export type InferMessageIdsTypeFromRule<T> = T extends RuleModule<infer MessageIds, infer _TOptions> ? MessageIds : T extends RuleCreateFunction<infer MessageIds, infer _TOptions> ? MessageIds : unknown;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
import type { RuleContext, RuleListener, RuleMetaData, RuleMetaDataDocs, RuleModule } from '../ts-eslint/Rule';
|
|
4
|
+
export type NamedCreateRuleMetaDocs = Omit<RuleMetaDataDocs, 'url'>;
|
|
5
|
+
export type NamedCreateRuleMeta<MessageIds extends string, PluginDocs = unknown, Options extends readonly unknown[] = []> = {
|
|
6
|
+
docs: PluginDocs & RuleMetaDataDocs;
|
|
7
|
+
} & Omit<RuleMetaData<MessageIds, PluginDocs, Options>, 'docs'>;
|
|
8
|
+
export interface RuleCreateAndOptions<Options extends readonly unknown[], MessageIds extends string> {
|
|
9
|
+
create: (context: Readonly<RuleContext<MessageIds, Options>>, optionsWithDefault: Readonly<Options>) => RuleListener;
|
|
10
|
+
/** @deprecated Use meta.defaultOptions instead */
|
|
11
|
+
defaultOptions?: Readonly<Options>;
|
|
12
|
+
}
|
|
13
|
+
export interface RuleWithMeta<Options extends readonly unknown[], MessageIds extends string, Docs = unknown> extends RuleCreateAndOptions<Options, MessageIds> {
|
|
14
|
+
meta: RuleMetaData<MessageIds, Docs, Options>;
|
|
15
|
+
name?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface RuleWithMetaAndName<Options extends readonly unknown[], MessageIds extends string, Docs = unknown> extends RuleCreateAndOptions<Options, MessageIds> {
|
|
18
|
+
meta: NamedCreateRuleMeta<MessageIds, Docs, Options>;
|
|
19
|
+
name: string;
|
|
20
|
+
}
|
|
21
|
+
type RuleModuleWithName<MessageIds extends string, Options extends readonly unknown[] = [], Docs = unknown, ExtendedRuleListener extends RuleListener = RuleListener> = RuleModule<MessageIds, Options, Docs, ExtendedRuleListener> & {
|
|
22
|
+
name: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Creates reusable function to create rules with default options and docs URLs.
|
|
26
|
+
*
|
|
27
|
+
* @param urlCreator Creates a documentation URL for a given rule name.
|
|
28
|
+
* @returns Function to create a rule with the docs URL format.
|
|
29
|
+
*/
|
|
30
|
+
export declare function RuleCreator<PluginDocs = unknown>(urlCreator: (ruleName: string) => string): <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<RuleWithMetaAndName<Options, MessageIds, PluginDocs>>) => RuleModuleWithName<MessageIds, Options, PluginDocs>;
|
|
31
|
+
export declare namespace RuleCreator {
|
|
32
|
+
var withoutDocs: <Options extends readonly unknown[], MessageIds extends string>(args: Readonly<RuleWithMeta<Options, MessageIds>>) => RuleModule<MessageIds, Options>;
|
|
33
|
+
}
|
|
34
|
+
export { type RuleListener, type RuleModule } from '../ts-eslint/Rule';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
/**
|
|
4
|
+
* Pure function - doesn't mutate either parameter!
|
|
5
|
+
* Uses the default options and overrides with the options provided by the user
|
|
6
|
+
* @param defaultOptions the defaults
|
|
7
|
+
* @param userOptions the user opts
|
|
8
|
+
* @returns the options with defaults
|
|
9
|
+
*/
|
|
10
|
+
export declare function applyDefault<User extends readonly unknown[], Default extends User>(defaultOptions: Readonly<Default>, userOptions: Readonly<User> | null): Default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
export type ObjectLike<T = unknown> = Record<string, T>;
|
|
4
|
+
/**
|
|
5
|
+
* Check if the variable contains an object strictly rejecting arrays
|
|
6
|
+
* @returns `true` if obj is an object
|
|
7
|
+
*/
|
|
8
|
+
export declare function isObjectNotArray(obj: unknown): obj is ObjectLike;
|
|
9
|
+
/**
|
|
10
|
+
* Pure function - doesn't mutate either parameter!
|
|
11
|
+
* Merges two objects together deeply, overwriting the properties in first with the properties in second
|
|
12
|
+
* @param first The first object
|
|
13
|
+
* @param second The second object
|
|
14
|
+
* @returns a new object
|
|
15
|
+
*/
|
|
16
|
+
export declare function deepMerge(first?: ObjectLike, second?: ObjectLike): Record<string, unknown>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
import type * as TSESLint from '../ts-eslint';
|
|
4
|
+
import type { ParserServices, ParserServicesWithTypeInformation } from '../ts-estree';
|
|
5
|
+
/**
|
|
6
|
+
* Try to retrieve type-aware parser service from context.
|
|
7
|
+
* This **_will_** throw if it is not available.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getParserServices<MessageIds extends string, Options extends readonly unknown[]>(context: Readonly<TSESLint.RuleContext<MessageIds, Options>>): ParserServicesWithTypeInformation;
|
|
10
|
+
/**
|
|
11
|
+
* Try to retrieve type-aware parser service from context.
|
|
12
|
+
* This **_will_** throw if it is not available.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getParserServices<MessageIds extends string, Options extends readonly unknown[]>(context: Readonly<TSESLint.RuleContext<MessageIds, Options>>, allowWithoutFullTypeInformation: false): ParserServicesWithTypeInformation;
|
|
15
|
+
/**
|
|
16
|
+
* Try to retrieve type-aware parser service from context.
|
|
17
|
+
* This **_will not_** throw if it is not available.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getParserServices<MessageIds extends string, Options extends readonly unknown[]>(context: Readonly<TSESLint.RuleContext<MessageIds, Options>>, allowWithoutFullTypeInformation: true): ParserServices;
|
|
20
|
+
/**
|
|
21
|
+
* Try to retrieve type-aware parser service from context.
|
|
22
|
+
* This may or may not throw if it is not available, depending on if `allowWithoutFullTypeInformation` is `true`
|
|
23
|
+
*/
|
|
24
|
+
export declare function getParserServices<MessageIds extends string, Options extends readonly unknown[]>(context: Readonly<TSESLint.RuleContext<MessageIds, Options>>, allowWithoutFullTypeInformation: boolean): ParserServices;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
export * from './applyDefault';
|
|
4
|
+
export * from './deepMerge';
|
|
5
|
+
export * from './getParserServices';
|
|
6
|
+
export * from './InferTypesFromRule';
|
|
7
|
+
export * from './nullThrows';
|
|
8
|
+
export * from './RuleCreator';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
/**
|
|
4
|
+
* A set of common reasons for calling nullThrows
|
|
5
|
+
*/
|
|
6
|
+
export declare const NullThrowsReasons: {
|
|
7
|
+
readonly MissingParent: 'Expected node to have a parent.';
|
|
8
|
+
readonly MissingToken: (token: string, thing: string) => string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Assert that a value must not be null or undefined.
|
|
12
|
+
* This is a nice explicit alternative to the non-null assertion operator.
|
|
13
|
+
*/
|
|
14
|
+
export declare function nullThrows<T>(value: T, message: string): NonNullable<T>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
export * as ASTUtils from './ast-utils';
|
|
4
|
+
export * as ESLintUtils from './eslint-utils';
|
|
5
|
+
export * as JSONSchema from './json-schema';
|
|
6
|
+
export * as TSESLint from './ts-eslint';
|
|
7
|
+
export * from './ts-estree';
|
|
8
|
+
export * as TSUtils from './ts-utils';
|