@typescript-eslint/utils 6.4.1-alpha.9 → 6.4.1

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 (33) hide show
  1. package/package.json +10 -6
  2. package/_ts4.3/dist/ast-utils/eslint-utils/PatternMatcher.d.ts +0 -48
  3. package/_ts4.3/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts +0 -76
  4. package/_ts4.3/dist/ast-utils/eslint-utils/astUtilities.d.ts +0 -76
  5. package/_ts4.3/dist/ast-utils/eslint-utils/index.d.ts +0 -6
  6. package/_ts4.3/dist/ast-utils/eslint-utils/predicates.d.ts +0 -32
  7. package/_ts4.3/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts +0 -18
  8. package/_ts4.3/dist/ast-utils/helpers.d.ts +0 -1207
  9. package/_ts4.3/dist/ast-utils/index.d.ts +0 -5
  10. package/_ts4.3/dist/ast-utils/misc.d.ts +0 -8
  11. package/_ts4.3/dist/ast-utils/predicates.d.ts +0 -70
  12. package/_ts4.3/dist/eslint-utils/InferTypesFromRule.d.ts +0 -11
  13. package/_ts4.3/dist/eslint-utils/RuleCreator.d.ts +0 -35
  14. package/_ts4.3/dist/eslint-utils/applyDefault.d.ts +0 -10
  15. package/_ts4.3/dist/eslint-utils/deepMerge.d.ts +0 -17
  16. package/_ts4.3/dist/eslint-utils/getParserServices.d.ts +0 -24
  17. package/_ts4.3/dist/eslint-utils/index.d.ts +0 -7
  18. package/_ts4.3/dist/eslint-utils/nullThrows.d.ts +0 -14
  19. package/_ts4.3/dist/index.d.ts +0 -8
  20. package/_ts4.3/dist/json-schema.d.ts +0 -388
  21. package/_ts4.3/dist/ts-eslint/AST.d.ts +0 -9
  22. package/_ts4.3/dist/ts-eslint/CLIEngine.d.ts +0 -131
  23. package/_ts4.3/dist/ts-eslint/ESLint.d.ts +0 -376
  24. package/_ts4.3/dist/ts-eslint/Linter.d.ts +0 -327
  25. package/_ts4.3/dist/ts-eslint/ParserOptions.d.ts +0 -2
  26. package/_ts4.3/dist/ts-eslint/Rule.d.ts +0 -418
  27. package/_ts4.3/dist/ts-eslint/RuleTester.d.ts +0 -161
  28. package/_ts4.3/dist/ts-eslint/Scope.d.ts +0 -44
  29. package/_ts4.3/dist/ts-eslint/SourceCode.d.ts +0 -344
  30. package/_ts4.3/dist/ts-eslint/index.d.ts +0 -10
  31. package/_ts4.3/dist/ts-estree.d.ts +0 -3
  32. package/_ts4.3/dist/ts-utils/index.d.ts +0 -2
  33. package/_ts4.3/dist/ts-utils/isArray.d.ts +0 -2
@@ -1,5 +0,0 @@
1
- export * from './eslint-utils';
2
- export * from './helpers';
3
- export * from './misc';
4
- export * from './predicates';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1,8 +0,0 @@
1
- import type { TSESTree } from '../ts-estree';
2
- declare const LINEBREAK_MATCHER: RegExp;
3
- /**
4
- * Determines whether two adjacent tokens are on the same line
5
- */
6
- declare function isTokenOnSameLine(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token): boolean;
7
- export { isTokenOnSameLine, LINEBREAK_MATCHER };
8
- //# sourceMappingURL=misc.d.ts.map
@@ -1,70 +0,0 @@
1
- import type { TSESTree } from '../ts-estree';
2
- declare const isOptionalChainPunctuator: (token: TSESTree.Token | null | undefined) => token is {
3
- value: "?.";
4
- } & TSESTree.PunctuatorToken;
5
- declare const isNotOptionalChainPunctuator: (token: TSESTree.Token | null | undefined) => token is TSESTree.BooleanToken | TSESTree.BlockComment | TSESTree.LineComment | TSESTree.IdentifierToken | TSESTree.JSXIdentifierToken | TSESTree.JSXTextToken | TSESTree.KeywordToken | TSESTree.NullToken | TSESTree.NumericToken | TSESTree.PunctuatorToken | TSESTree.RegularExpressionToken | TSESTree.StringToken | TSESTree.TemplateToken;
6
- declare const isNonNullAssertionPunctuator: (token: TSESTree.Token | null | undefined) => token is {
7
- value: "!";
8
- } & TSESTree.PunctuatorToken;
9
- declare const isNotNonNullAssertionPunctuator: (token: TSESTree.Token | null | undefined) => token is TSESTree.BooleanToken | TSESTree.BlockComment | TSESTree.LineComment | TSESTree.IdentifierToken | TSESTree.JSXIdentifierToken | TSESTree.JSXTextToken | TSESTree.KeywordToken | TSESTree.NullToken | TSESTree.NumericToken | TSESTree.PunctuatorToken | TSESTree.RegularExpressionToken | TSESTree.StringToken | TSESTree.TemplateToken;
10
- /**
11
- * Returns true if and only if the node represents: foo?.() or foo.bar?.()
12
- */
13
- declare const isOptionalCallExpression: (node: TSESTree.Node | null | undefined) => node is {
14
- optional: boolean;
15
- } & TSESTree.CallExpression;
16
- /**
17
- * Returns true if and only if the node represents logical OR
18
- */
19
- declare const isLogicalOrOperator: (node: TSESTree.Node | null | undefined) => node is Partial<TSESTree.LogicalExpression> & TSESTree.LogicalExpression;
20
- /**
21
- * Checks if a node is a type assertion:
22
- * ```
23
- * x as foo
24
- * <foo>x
25
- * ```
26
- */
27
- declare const isTypeAssertion: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSAsExpression | TSESTree.TSTypeAssertion;
28
- declare const isVariableDeclarator: (node: TSESTree.Node | null | undefined) => node is TSESTree.VariableDeclarator;
29
- declare const isFunction: (node: TSESTree.Node | null | undefined) => node is TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName | TSESTree.FunctionExpression;
30
- declare const isFunctionType: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructorType | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSFunctionType | TSESTree.TSMethodSignatureComputedName | TSESTree.TSMethodSignatureNonComputedName;
31
- declare const isFunctionOrFunctionType: (node: TSESTree.Node | null | undefined) => node is TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName | TSESTree.FunctionExpression | TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructorType | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSFunctionType | TSESTree.TSMethodSignatureComputedName | TSESTree.TSMethodSignatureNonComputedName;
32
- declare const isTSFunctionType: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSFunctionType;
33
- declare const isTSConstructorType: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSConstructorType;
34
- 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;
35
- /**
36
- * Checks if a node is a constructor method.
37
- */
38
- declare const isConstructor: (node: TSESTree.Node | null | undefined) => node is (Partial<TSESTree.MethodDefinitionComputedName> & TSESTree.MethodDefinitionComputedName) | (Partial<TSESTree.MethodDefinitionNonComputedName> & TSESTree.MethodDefinitionNonComputedName);
39
- /**
40
- * Checks if a node is a setter method.
41
- */
42
- declare function isSetter(node: TSESTree.Node | undefined): node is {
43
- kind: 'set';
44
- } & (TSESTree.MethodDefinition | TSESTree.Property);
45
- declare const isIdentifier: (node: TSESTree.Node | null | undefined) => node is TSESTree.Identifier;
46
- /**
47
- * Checks if a node represents an `await …` expression.
48
- */
49
- declare const isAwaitExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.AwaitExpression;
50
- /**
51
- * Checks if a possible token is the `await` keyword.
52
- */
53
- declare const isAwaitKeyword: (token: TSESTree.Token | null | undefined) => token is {
54
- value: "await";
55
- } & TSESTree.IdentifierToken;
56
- /**
57
- * Checks if a possible token is the `type` keyword.
58
- */
59
- declare const isTypeKeyword: (token: TSESTree.Token | null | undefined) => token is {
60
- value: "type";
61
- } & TSESTree.IdentifierToken;
62
- /**
63
- * Checks if a possible token is the `import` keyword.
64
- */
65
- declare const isImportKeyword: (token: TSESTree.Token | null | undefined) => token is {
66
- value: "import";
67
- } & TSESTree.KeywordToken;
68
- declare const isLoop: (node: TSESTree.Node | null | undefined) => node is TSESTree.DoWhileStatement | TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement | TSESTree.WhileStatement;
69
- export { isAwaitExpression, isAwaitKeyword, isConstructor, isClassOrTypeElement, isFunction, isFunctionOrFunctionType, isFunctionType, isIdentifier, isImportKeyword, isLoop, isLogicalOrOperator, isNonNullAssertionPunctuator, isNotNonNullAssertionPunctuator, isNotOptionalChainPunctuator, isOptionalChainPunctuator, isOptionalCallExpression, isSetter, isTSConstructorType, isTSFunctionType, isTypeAssertion, isTypeKeyword, isVariableDeclarator, };
70
- //# sourceMappingURL=predicates.d.ts.map
@@ -1,11 +0,0 @@
1
- import type { RuleCreateFunction, RuleModule } from '../ts-eslint';
2
- /**
3
- * Uses type inference to fetch the TOptions type from the given RuleModule
4
- */
5
- type InferOptionsTypeFromRule<T> = T extends RuleModule<infer _TMessageIds, infer TOptions> ? TOptions : T extends RuleCreateFunction<infer _TMessageIds, infer TOptions> ? TOptions : unknown;
6
- /**
7
- * Uses type inference to fetch the TMessageIds type from the given RuleModule
8
- */
9
- type InferMessageIdsTypeFromRule<T> = T extends RuleModule<infer TMessageIds, infer _TOptions> ? TMessageIds : T extends RuleCreateFunction<infer TMessageIds, infer _TOptions> ? TMessageIds : unknown;
10
- export { InferOptionsTypeFromRule, InferMessageIdsTypeFromRule };
11
- //# sourceMappingURL=InferTypesFromRule.d.ts.map
@@ -1,35 +0,0 @@
1
- import type { RuleContext, RuleListener, RuleMetaData, RuleMetaDataDocs, RuleModule } from '../ts-eslint/Rule';
2
- export type NamedCreateRuleMetaDocs = Omit<RuleMetaDataDocs, 'url'>;
3
- export type NamedCreateRuleMeta<TMessageIds extends string> = Omit<RuleMetaData<TMessageIds>, 'docs'> & {
4
- docs: NamedCreateRuleMetaDocs;
5
- };
6
- export interface RuleCreateAndOptions<TOptions extends readonly unknown[], TMessageIds extends string> {
7
- create: (context: Readonly<RuleContext<TMessageIds, TOptions>>, optionsWithDefault: Readonly<TOptions>) => RuleListener;
8
- defaultOptions: Readonly<TOptions>;
9
- }
10
- export interface RuleWithMeta<TOptions extends readonly unknown[], TMessageIds extends string> extends RuleCreateAndOptions<TOptions, TMessageIds> {
11
- meta: RuleMetaData<TMessageIds>;
12
- }
13
- export interface RuleWithMetaAndName<TOptions extends readonly unknown[], TMessageIds extends string> extends RuleCreateAndOptions<TOptions, TMessageIds> {
14
- meta: NamedCreateRuleMeta<TMessageIds>;
15
- name: string;
16
- }
17
- /**
18
- * Creates reusable function to create rules with default options and docs URLs.
19
- *
20
- * @param urlCreator Creates a documentation URL for a given rule name.
21
- * @returns Function to create a rule with the docs URL format.
22
- */
23
- export declare function RuleCreator(urlCreator: (ruleName: string) => string): <TOptions extends readonly unknown[], TMessageIds extends string>({ name, meta, ...rule }: Readonly<RuleWithMetaAndName<TOptions, TMessageIds>>) => RuleModule<TMessageIds, TOptions, RuleListener>;
24
- export declare namespace RuleCreator {
25
- var withoutDocs: typeof createRule;
26
- }
27
- /**
28
- * Creates a well-typed TSESLint custom ESLint rule without a docs URL.
29
- *
30
- * @returns Well-typed TSESLint custom ESLint rule.
31
- * @remarks It is generally better to provide a docs URL function to RuleCreator.
32
- */
33
- declare function createRule<TOptions extends readonly unknown[], TMessageIds extends string>({ create, defaultOptions, meta, }: Readonly<RuleWithMeta<TOptions, TMessageIds>>): RuleModule<TMessageIds, TOptions>;
34
- export {};
35
- //# sourceMappingURL=RuleCreator.d.ts.map
@@ -1,10 +0,0 @@
1
- /**
2
- * Pure function - doesn't mutate either parameter!
3
- * Uses the default options and overrides with the options provided by the user
4
- * @param defaultOptions the defaults
5
- * @param userOptions the user opts
6
- * @returns the options with defaults
7
- */
8
- declare function applyDefault<TUser extends readonly unknown[], TDefault extends TUser>(defaultOptions: Readonly<TDefault>, userOptions: Readonly<TUser> | null): TDefault;
9
- export { applyDefault };
10
- //# sourceMappingURL=applyDefault.d.ts.map
@@ -1,17 +0,0 @@
1
- type ObjectLike<T = unknown> = Record<string, T>;
2
- /**
3
- * Check if the variable contains an object strictly rejecting arrays
4
- * @param obj an object
5
- * @returns `true` if obj is an object
6
- */
7
- declare function isObjectNotArray<T extends ObjectLike>(obj: unknown): obj is T;
8
- /**
9
- * Pure function - doesn't mutate either parameter!
10
- * Merges two objects together deeply, overwriting the properties in first with the properties in second
11
- * @param first The first object
12
- * @param second The second object
13
- * @returns a new object
14
- */
15
- export declare function deepMerge(first?: ObjectLike, second?: ObjectLike): Record<string, unknown>;
16
- export { isObjectNotArray };
17
- //# sourceMappingURL=deepMerge.d.ts.map
@@ -1,24 +0,0 @@
1
- import type * as TSESLint from '../ts-eslint';
2
- import type { ParserServices, ParserServicesWithTypeInformation } from '../ts-estree';
3
- /**
4
- * Try to retrieve type-aware parser service from context.
5
- * This **_will_** throw if it is not available.
6
- */
7
- declare function getParserServices<TMessageIds extends string, TOptions extends readonly unknown[]>(context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>): ParserServicesWithTypeInformation;
8
- /**
9
- * Try to retrieve type-aware parser service from context.
10
- * This **_will_** throw if it is not available.
11
- */
12
- declare function getParserServices<TMessageIds extends string, TOptions extends readonly unknown[]>(context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>, allowWithoutFullTypeInformation: false): ParserServicesWithTypeInformation;
13
- /**
14
- * Try to retrieve type-aware parser service from context.
15
- * This **_will not_** throw if it is not available.
16
- */
17
- declare function getParserServices<TMessageIds extends string, TOptions extends readonly unknown[]>(context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>, allowWithoutFullTypeInformation: true): ParserServices;
18
- /**
19
- * Try to retrieve type-aware parser service from context.
20
- * This may or may not throw if it is not available, depending on if `allowWithoutFullTypeInformation` is `true`
21
- */
22
- declare function getParserServices<TMessageIds extends string, TOptions extends readonly unknown[]>(context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>, allowWithoutFullTypeInformation: boolean): ParserServices;
23
- export { getParserServices };
24
- //# sourceMappingURL=getParserServices.d.ts.map
@@ -1,7 +0,0 @@
1
- export * from './applyDefault';
2
- export * from './getParserServices';
3
- export * from './InferTypesFromRule';
4
- export * from './RuleCreator';
5
- export * from './deepMerge';
6
- export * from './nullThrows';
7
- //# sourceMappingURL=index.d.ts.map
@@ -1,14 +0,0 @@
1
- /**
2
- * A set of common reasons for calling nullThrows
3
- */
4
- declare const NullThrowsReasons: {
5
- readonly MissingParent: "Expected node to have a parent.";
6
- readonly MissingToken: (token: string, thing: string) => string;
7
- };
8
- /**
9
- * Assert that a value must not be null or undefined.
10
- * This is a nice explicit alternative to the non-null assertion operator.
11
- */
12
- declare function nullThrows<T>(value: T | null | undefined, message: string): T;
13
- export { nullThrows, NullThrowsReasons };
14
- //# sourceMappingURL=nullThrows.d.ts.map
@@ -1,8 +0,0 @@
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 TSUtils from './ts-utils';
6
- export { ASTUtils, ESLintUtils, JSONSchema, TSESLint, TSUtils };
7
- export * from './ts-estree';
8
- //# sourceMappingURL=index.d.ts.map
@@ -1,388 +0,0 @@
1
- /**
2
- * This is a fork of https://github.com/DefinitelyTyped/DefinitelyTyped/blob/13f63c2eb8d7479caf01ab8d72f9e3683368a8f5/types/json-schema/index.d.ts
3
- * We intentionally fork this because:
4
- * - ESLint ***ONLY*** supports JSONSchema v4
5
- * - We want to provide stricter types
6
- */
7
- /**
8
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1
9
- */
10
- export type JSONSchema4TypeName = 'any' | 'array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string';
11
- /**
12
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.5
13
- */
14
- export type JSONSchema4Type = boolean | number | string | null;
15
- export type JSONSchema4TypeExtended = JSONSchema4Type | JSONSchema4Array | JSONSchema4Object;
16
- export interface JSONSchema4Object {
17
- [key: string]: JSONSchema4TypeExtended;
18
- }
19
- export interface JSONSchema4Array extends Array<JSONSchema4TypeExtended> {
20
- }
21
- /**
22
- * Meta schema
23
- *
24
- * Recommended values:
25
- * - 'http://json-schema.org/schema#'
26
- * - 'http://json-schema.org/hyper-schema#'
27
- * - 'http://json-schema.org/draft-04/schema#'
28
- * - 'http://json-schema.org/draft-04/hyper-schema#'
29
- * - 'http://json-schema.org/draft-03/schema#'
30
- * - 'http://json-schema.org/draft-03/hyper-schema#'
31
- *
32
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
33
- */
34
- export type JSONSchema4Version = string;
35
- /**
36
- * JSON Schema V4
37
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-04
38
- */
39
- export type JSONSchema4 = JSONSchema4AllOfSchema | JSONSchema4AnyOfSchema | JSONSchema4AnySchema | JSONSchema4ArraySchema | JSONSchema4BooleanSchema | JSONSchema4MultiSchema | JSONSchema4NullSchema | JSONSchema4NumberSchema | JSONSchema4ObjectSchema | JSONSchema4OneOfSchema | JSONSchema4RefSchema | JSONSchema4StringSchema;
40
- interface JSONSchema4Base {
41
- id?: string | undefined;
42
- $schema?: JSONSchema4Version | undefined;
43
- /**
44
- * A single type, or a union of simple types
45
- */
46
- type?: JSONSchema4TypeName | JSONSchema4TypeName[] | undefined;
47
- /**
48
- * Path to a schema defined in `definitions`/`$defs` that will form the base
49
- * for this schema.
50
- *
51
- * If you are defining an "array" schema (`schema: [ ... ]`) for your rule
52
- * then you should prefix this with `items/0` so that the validator can find
53
- * your definitions.
54
- *
55
- * eg: `'#/items/0/definitions/myDef'`
56
- *
57
- * Otherwise if you are defining an "object" schema (`schema: { ... }`) for
58
- * your rule you can directly reference your definitions
59
- *
60
- * eg: `'#/definitions/myDef'`
61
- */
62
- $ref?: string | undefined;
63
- /**
64
- * This attribute is a string that provides a short description of the
65
- * instance property.
66
- *
67
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.21
68
- */
69
- title?: string | undefined;
70
- /**
71
- * This attribute is a string that provides a full description of the of
72
- * purpose the instance property.
73
- *
74
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.22
75
- */
76
- description?: string | undefined;
77
- /**
78
- * Reusable definitions that can be referenced via `$ref`
79
- */
80
- definitions?: Record<string, JSONSchema4> | undefined;
81
- /**
82
- * Reusable definitions that can be referenced via `$ref`
83
- */
84
- $defs?: Record<string, JSONSchema4> | undefined;
85
- /**
86
- * The value of this property MUST be another schema which will provide
87
- * a base schema which the current schema will inherit from. The
88
- * inheritance rules are such that any instance that is valid according
89
- * to the current schema MUST be valid according to the referenced
90
- * schema. This MAY also be an array, in which case, the instance MUST
91
- * be valid for all the schemas in the array. A schema that extends
92
- * another schema MAY define additional attributes, constrain existing
93
- * attributes, or add other constraints.
94
- *
95
- * Conceptually, the behavior of extends can be seen as validating an
96
- * instance against all constraints in the extending schema as well as
97
- * the extended schema(s).
98
- *
99
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.26
100
- */
101
- extends?: string[] | string | undefined;
102
- /**
103
- * The default value for the item if not present
104
- */
105
- default?: JSONSchema4TypeExtended | undefined;
106
- /**
107
- * This attribute indicates if the instance must have a value, and not
108
- * be undefined. This is false by default, making the instance
109
- * optional.
110
- *
111
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.7
112
- */
113
- required?: string[] | boolean | undefined;
114
- /**
115
- * (NOT) Must not be valid against the given schema
116
- */
117
- not?: JSONSchema4 | undefined;
118
- /**
119
- * (AND) Must be valid against all of the sub-schemas
120
- */
121
- allOf?: JSONSchema4[] | undefined;
122
- /**
123
- * (OR) Must be valid against any of the sub-schemas
124
- */
125
- anyOf?: JSONSchema4[] | undefined;
126
- /**
127
- * (XOR) Must be valid against exactly one of the sub-schemas
128
- */
129
- oneOf?: JSONSchema4[] | undefined;
130
- }
131
- export interface JSONSchema4RefSchema extends JSONSchema4Base {
132
- type?: undefined;
133
- $ref: string;
134
- }
135
- export interface JSONSchema4AllOfSchema extends JSONSchema4Base {
136
- type?: undefined;
137
- allOf: JSONSchema4[];
138
- }
139
- export interface JSONSchema4AnyOfSchema extends JSONSchema4Base {
140
- type?: undefined;
141
- anyOf: JSONSchema4[];
142
- }
143
- export interface JSONSchema4OneOfSchema extends JSONSchema4Base {
144
- type?: undefined;
145
- oneOf: JSONSchema4[];
146
- }
147
- export interface JSONSchema4MultiSchema extends Omit<JSONSchema4ObjectSchema, 'enum' | 'type'>, Omit<JSONSchema4ArraySchema, 'enum' | 'type'>, Omit<JSONSchema4StringSchema, 'enum' | 'type'>, Omit<JSONSchema4NumberSchema, 'enum' | 'type'>, Omit<JSONSchema4BooleanSchema, 'enum' | 'type'>, Omit<JSONSchema4NullSchema, 'enum' | 'type'>, Omit<JSONSchema4AnySchema, 'enum' | 'type'> {
148
- type: JSONSchema4TypeName[];
149
- /**
150
- * This provides an enumeration of all possible values that are valid
151
- * for the instance property. This MUST be an array, and each item in
152
- * the array represents a possible value for the instance value. If
153
- * this attribute is defined, the instance value MUST be one of the
154
- * values in the array in order for the schema to be valid.
155
- *
156
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
157
- */
158
- enum?: JSONSchema4Type[];
159
- }
160
- /**
161
- * @see https://json-schema.org/understanding-json-schema/reference/object.html
162
- */
163
- export interface JSONSchema4ObjectSchema extends JSONSchema4Base {
164
- type: 'object';
165
- /**
166
- * This attribute defines a schema for all properties that are not
167
- * explicitly defined in an object type definition. If specified, the
168
- * value MUST be a schema or a boolean. If false is provided, no
169
- * additional properties are allowed beyond the properties defined in
170
- * the schema. The default value is an empty schema which allows any
171
- * value for additional properties.
172
- *
173
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4
174
- */
175
- additionalProperties?: JSONSchema4 | boolean | undefined;
176
- /**
177
- * This attribute is an object with property definitions that define the
178
- * valid values of instance object property values. When the instance
179
- * value is an object, the property values of the instance object MUST
180
- * conform to the property definitions in this object. In this object,
181
- * each property definition's value MUST be a schema, and the property's
182
- * name MUST be the name of the instance property that it defines. The
183
- * instance property value MUST be valid according to the schema from
184
- * the property definition. Properties are considered unordered, the
185
- * order of the instance properties MAY be in any order.
186
- *
187
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.2
188
- */
189
- properties?: Record<string, JSONSchema4> | undefined;
190
- /**
191
- * This attribute is an object that defines the schema for a set of
192
- * property names of an object instance. The name of each property of
193
- * this attribute's object is a regular expression pattern in the ECMA
194
- * 262/Perl 5 format, while the value is a schema. If the pattern
195
- * matches the name of a property on the instance object, the value of
196
- * the instance's property MUST be valid against the pattern name's
197
- * schema value.
198
- *
199
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.3
200
- */
201
- patternProperties?: Record<string, JSONSchema4> | undefined;
202
- /**
203
- * The `dependencies` keyword conditionally applies a sub-schema when a given
204
- * property is present. This schema is applied in the same way `allOf` applies
205
- * schemas. Nothing is merged or extended. Both schemas apply independently.
206
- */
207
- dependencies?: Record<string, JSONSchema4 | string[]> | undefined;
208
- /**
209
- * The maximum number of properties allowed for record-style schemas
210
- */
211
- maxProperties?: number | undefined;
212
- /**
213
- * The minimum number of properties required for record-style schemas
214
- */
215
- minProperties?: number | undefined;
216
- }
217
- /**
218
- * @see https://json-schema.org/understanding-json-schema/reference/array.html
219
- */
220
- export interface JSONSchema4ArraySchema extends JSONSchema4Base {
221
- type: 'array';
222
- /**
223
- * May only be defined when "items" is defined, and is a tuple of JSONSchemas.
224
- *
225
- * This provides a definition for additional items in an array instance
226
- * when tuple definitions of the items is provided. This can be false
227
- * to indicate additional items in the array are not allowed, or it can
228
- * be a schema that defines the schema of the additional items.
229
- *
230
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.6
231
- */
232
- additionalItems?: JSONSchema4 | boolean | undefined;
233
- /**
234
- * This attribute defines the allowed items in an instance array, and
235
- * MUST be a schema or an array of schemas. The default value is an
236
- * empty schema which allows any value for items in the instance array.
237
- *
238
- * When this attribute value is a schema and the instance value is an
239
- * array, then all the items in the array MUST be valid according to the
240
- * schema.
241
- *
242
- * When this attribute value is an array of schemas and the instance
243
- * value is an array, each position in the instance array MUST conform
244
- * to the schema in the corresponding position for this array. This
245
- * called tuple typing. When tuple typing is used, additional items are
246
- * allowed, disallowed, or constrained by the "additionalItems"
247
- * (Section 5.6) attribute using the same rules as
248
- * "additionalProperties" (Section 5.4) for objects.
249
- *
250
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.5
251
- */
252
- items?: JSONSchema4 | JSONSchema4[] | undefined;
253
- /**
254
- * Defines the maximum length of an array
255
- */
256
- maxItems?: number | undefined;
257
- /**
258
- * Defines the minimum length of an array
259
- */
260
- minItems?: number | undefined;
261
- /**
262
- * Enforces that all items in the array are unique
263
- */
264
- uniqueItems?: boolean | undefined;
265
- }
266
- /**
267
- * @see https://json-schema.org/understanding-json-schema/reference/string.html
268
- */
269
- export interface JSONSchema4StringSchema extends JSONSchema4Base {
270
- type: 'string';
271
- /**
272
- * The maximum allowed length for the string
273
- */
274
- maxLength?: number | undefined;
275
- /**
276
- * The minimum allowed length for the string
277
- */
278
- minLength?: number | undefined;
279
- /**
280
- * The `pattern` keyword is used to restrict a string to a particular regular
281
- * expression. The regular expression syntax is the one defined in JavaScript
282
- * (ECMA 262 specifically) with Unicode support.
283
- *
284
- * When defining the regular expressions, it’s important to note that the
285
- * string is considered valid if the expression matches anywhere within the
286
- * string. For example, the regular expression "p" will match any string with
287
- * a p in it, such as "apple" not just a string that is simply "p". Therefore,
288
- * it is usually less confusing, as a matter of course, to surround the
289
- * regular expression in ^...$, for example, "^p$", unless there is a good
290
- * reason not to do so.
291
- */
292
- pattern?: string | undefined;
293
- /**
294
- * The `format` keyword allows for basic semantic identification of certain
295
- * kinds of string values that are commonly used.
296
- *
297
- * For example, because JSON doesn’t have a “DateTime” type, dates need to be
298
- * encoded as strings. `format` allows the schema author to indicate that the
299
- * string value should be interpreted as a date.
300
- *
301
- * ajv v6 provides a few built-in formats - all other strings will cause AJV
302
- * to throw during schema compilation
303
- */
304
- format?: 'date-time' | 'date' | 'email' | 'hostname' | 'ipv4' | 'ipv6' | 'json-pointer-uri-fragment' | 'json-pointer' | 'regex' | 'relative-json-pointer' | 'time' | 'uri-reference' | 'uri-template' | 'uri' | 'url' | 'uuid' | undefined;
305
- enum?: string[] | undefined;
306
- }
307
- /**
308
- * @see https://json-schema.org/understanding-json-schema/reference/numeric.html
309
- */
310
- export interface JSONSchema4NumberSchema extends JSONSchema4Base {
311
- type: 'integer' | 'number';
312
- /**
313
- * Numbers can be restricted to a multiple of a given number, using the
314
- * `multipleOf` keyword. It may be set to any positive number.
315
- */
316
- multipleOf?: number | undefined;
317
- /**
318
- * The maximum allowed value for the number
319
- */
320
- maximum?: number | undefined;
321
- /**
322
- * The minimum allowed value for the number
323
- */
324
- minimum?: number | undefined;
325
- /**
326
- * The exclusive minimum allowed value for the number
327
- * - `true` = `x < maximum`
328
- * - `false` = `x <= maximum`
329
- *
330
- * Default is `false`
331
- */
332
- exclusiveMaximum?: boolean | undefined;
333
- /**
334
- * Indicates whether or not `minimum` is the inclusive or exclusive minimum
335
- * - `true` = `x > minimum`
336
- * - `false` = `x ≥ minimum`
337
- *
338
- * Default is `false`
339
- */
340
- exclusiveMinimum?: boolean | undefined;
341
- /**
342
- * This provides an enumeration of all possible values that are valid
343
- * for the instance property. This MUST be an array, and each item in
344
- * the array represents a possible value for the instance value. If
345
- * this attribute is defined, the instance value MUST be one of the
346
- * values in the array in order for the schema to be valid.
347
- *
348
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
349
- */
350
- enum?: number[] | undefined;
351
- }
352
- /**
353
- * @see https://json-schema.org/understanding-json-schema/reference/boolean.html
354
- */
355
- export interface JSONSchema4BooleanSchema extends JSONSchema4Base {
356
- type: 'boolean';
357
- /**
358
- * This provides an enumeration of all possible values that are valid
359
- * for the instance property. This MUST be an array, and each item in
360
- * the array represents a possible value for the instance value. If
361
- * this attribute is defined, the instance value MUST be one of the
362
- * values in the array in order for the schema to be valid.
363
- *
364
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
365
- */
366
- enum?: boolean[] | undefined;
367
- }
368
- /**
369
- * @see https://json-schema.org/understanding-json-schema/reference/null.html
370
- */
371
- export interface JSONSchema4NullSchema extends JSONSchema4Base {
372
- type: 'null';
373
- /**
374
- * This provides an enumeration of all possible values that are valid
375
- * for the instance property. This MUST be an array, and each item in
376
- * the array represents a possible value for the instance value. If
377
- * this attribute is defined, the instance value MUST be one of the
378
- * values in the array in order for the schema to be valid.
379
- *
380
- * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
381
- */
382
- enum?: null[] | undefined;
383
- }
384
- export interface JSONSchema4AnySchema extends JSONSchema4Base {
385
- type: 'any';
386
- }
387
- export {};
388
- //# sourceMappingURL=json-schema.d.ts.map
@@ -1,9 +0,0 @@
1
- import type { AST_TOKEN_TYPES, TSESTree } from '../ts-estree';
2
- declare namespace AST {
3
- type TokenType = AST_TOKEN_TYPES;
4
- type Token = TSESTree.Token;
5
- type SourceLocation = TSESTree.SourceLocation;
6
- type Range = TSESTree.Range;
7
- }
8
- export { AST };
9
- //# sourceMappingURL=AST.d.ts.map